1. 程式人生 > >Oracle11g(RedHat Enterprise Linux6.7)-ASM

Oracle11g(RedHat Enterprise Linux6.7)-ASM

launch ces admin raw ulimit 空間 removing -h packages

Oracle11g(RedHat Enterprise Linux6.7)-ASM
基礎環境說明:
操作系統:RedHat Enterprise Linux 6.7 x86_64
IP地址: 192.168.56.10
Oracle版本:Oracle11.2.0.4
Oracle安裝目錄:/u01
Oracle數據目錄:asm_disk
Oracle歸檔目錄:/archive
所有的ASMLib安裝需要oracleasmlib和oracleasm-support安裝包
oracleasm-support包可以從http://public-yum.oracle.com下載,
oracleasm kernel driver已經被集成到Unbreakable Enterprise Kernel for Oracle Linux 6,不需要手工安裝。

RedHat 編譯版本的oracleasm kernel driver可以從http://public-yum.oracle.com通過yum工具安裝
#yum install kmod-oracleasm
RedHat Enterprise Linux 6.7 x86_64環境中需要安裝的ASM相關包為:
rpm -ivh kmod-oracleasm-2.0.8-5.el6_7.x86_64.rpm
rpm -ivh oracleasm-support-2.1.8-1.el6.x86_64.rpm
rpm -ivh oracleasmlib-2.0.4-1.el6.x86_64.rpm
關閉不必要的系統服務
chkconfig cups off
chkconfig sendmail off
chkconfig isdn off
chkconfig smartd off
chkconfig iptables off
reboot
編輯主機HOST配置文件
vi /etc/hosts
192.168.56.10 asm11g
創建共享盤
cd C:\Program Files (x86)\VMware\VMware Workstation
vmware-vdiskmanager.exe -c -s 5000Mb -a lsilogic -t 2 E:\VMware-OS\asm11g\asmdisk\asm_disk01.vmdk
vmware-vdiskmanager.exe -c -s 5000Mb -a lsilogic -t 2 E:\VMware-OS\asm11g\asmdisk\asm_disk02.vmdk
vmware-vdiskmanager.exe -c -s 5000Mb -a lsilogic -t 2 E:\VMware-OS\asm11g\asmdisk\asm_disk03.vmdk
這條語句是為了新建ASM DISKGROUP使用的
vmware-vdiskmanager.exe -c -s 10000Mb -a lsilogic -t 2 E:\VMware-OS\asm11g\asmdisk\asm_disk04.vmdk
編輯vmx文件,識別共享磁盤
下面類容添加到 asm11g中的asm11g.vmx中
scsi1.present = "TRUE"
scsi1.virtualDev = "lsilogic"
scsi1.sharedBus = "virtual"
scsi1:1.present = "TRUE"
scsi1:1.mode = "independent-persistent"
scsi1:1.filename = "asmdisk\asm_disk01.vmdk"
scsi1:1.deviceType = "plainDisk"
scsi1:2.present = "TRUE"
scsi1:2.mode = "independent-persistent"
scsi1:2.filename = "asmdisk\asm_disk02.vmdk"
scsi1:2.deviceType = "plainDisk"
scsi1:3.present = "TRUE"
scsi1:3.mode = "independent-persistent"
scsi1:3.filename = "asmdisk\asm_disk03.vmdk"
scsi1:3.deviceType = "plainDisk"
disk.locking = "false"
diskLib.dataCacheMaxSize = "0"
diskLib.dataCacheMaxReadAheadSize = "0"
diskLib.DataCacheMinReadAheadSize = "0"
diskLib.dataCachePageSize = "4096"
diskLib.maxUnsyncedWrites = "0"
需要添加內容結束(可選項)
後期追加 asm_data4,查看 asmdisk 和 普通disk 在asm 中的應用【空間不夠用時的擴展】
vmware-vdiskmanager.exe -c -s 5000Mb -a lsilogic -t 2 H:/VM_ware/ora_11g/oel6disk/asm_data4.vmdk
scsi1:4.present = "TRUE"
scsi1:4.mode = "independent-persistent"
scsi1:4.filename = "H:/VM_ware/ora_11g/oel6disk/asm_data4.vmdk"
scsi1:4.deviceType = "plainDisk"
用發現asmca 在linux下是只能看到 asmdisk(oracleasm 創建) 或者 rawdisk(udev 配置),是看不到rawpartition(裸區)的
修改 rhel57_11gr2asm 的信息
默認網關必須設置
不然 vipca 報錯
vi /etc/sysconfig/network
NETWORKING=yes
NETWORKING_IPV6=no
HOSTNAME=dbasm
vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE=eth0
BOOTPROTO=static
HWADDR=00:0C:29:59:4B:00
ONBOOT=yes
IPADDR=192.168.249.15
NETMASK=255.255.255.0
GATEWAY=192.168.249.1
vi /etc/hosts
192.168.249.15 dbasm
--重啟網絡服務,使修改生效
service network restart
建立oracle,grid用戶
11gr2建議將oracle用戶的權限分離,當然不分離也是可以的,不過分離是應該的,
把數據庫用戶和存儲用戶區別開,就好比 data tablespace 和index tablespace 一樣讓人概念清晰,管理方便
估計會在12c中強制分離
創建Oracle及想應的用戶組
groupadd oinstall
groupadd dba
groupadd oper
groupadd asmadmin
groupadd asmdba
groupadd asmoper
--創建oracle用戶及grid用戶,這裏可以看出grid的權限是比oracle大的
useradd -g oinstall -G asmdba,dba,oper oracle
useradd -g oinstall -G asmadmin,asmdba,asmoper,dba,oper grid
passwd oracle
passwd grid
--檢查
[[email protected] ~]# id oracle
uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba),502(oper),504(asmdba)
[[email protected] ~]# id grid
uid=501(grid) gid=500(oinstall) groups=500(oinstall),501(dba),502(oper),503(asmadmin),504(asmdba),505(asmoper)
[[email protected] ~]# id nobody
uid=99(nobody) gid=99(nobody) groups=99(nobody)
創建Oracle相關目錄
mkdir -p /u01/app/oracle/product/11.2.0/db_1
mkdir -p /u01/app/grid/product/11.2.0/grid_1
mkdir -p /u01/app/gridbase
chown -R oracle:oinstall /u01
chown -R grid:oinstall /u01/app/grid
chown -R grid:oinstall /u01/app/gridbase
chmod -R 775 /u01
--如果有錯可以用usermod 命令修改
[[email protected] ~]# usermod -G osasm,osdba,osoper,dba,oper oracle
--查看oracle,grid 用戶是否配置正確
[[email protected] ~]# id oracle
uid=500(oracle) gid=500(oinstall) groups=500(oinstall),501(dba),502(oper),504(asmdba)
[[email protected] ~]# id grid
uid=501(grid) gid=500(oinstall) groups=500(oinstall),501(dba),502(oper),503(asmadmin),504(asmdba),505(asmoper)
配置Oracle基礎配置文件
vi /etc/security/limits.conf
#ORACLE SETTING
grid soft nproc 2047
grid hard nproc 16384
grid soft nofile 1024
grid hard nofile 65536
oracle soft nproc 2047
oracle hard nproc 16384
oracle soft nofile 1024
oracle hard nofile 65536
vi /etc/pam.d/login
#ORACLE SETTING
session required pam_limits.so
vi /etc/sysctl.conf
#ORACLE SETTING
#kernel.shmall = 2097152
#kernel.shmmax = 536870912
kernel.shmmni = 4096
fs.aio-max-nr = 1048576
fs.file-max = 6815744
kernel.sem = 250 32000 100 128
net.ipv4.ip_local_port_range = 9000 65500
net.core.rmem_default = 262144
net.core.rmem_max = 4194304
net.core.wmem_default = 262144
net.core.wmem_max = 1048586
立即生效
sysctl -p
vi /etc/selinux/config
SELINUX=disabled
--應該是不需要的,單機需要時間同步?在11gr2 中確實是需要這樣做的
禁用NTP服務
gird時間同步所需要的設置(需要執行,否則安裝grid時間會報錯),
Network Time Protocol Setting
/sbin/service ntpd stop
chkconfig ntpd off
mv /etc/ntp.conf /etc/ntp.conf.bak 或者 rm /etc/ntp.conf
fdisk 處理裸設備,使其變為裸區,切記不要格式化為文件系統
通過如下命令創建分區,
fdisk /dev/sdb
fdisk /dev/sdc
fdisk /dev/sdd
/dev/sdb1
/dev/sdb2
/dev/sdc1
/dev/sdc2
/dev/sdd1
/dev/sdd2
其中sdd1,sdd2為擴展vg所用(又要啰嗦的說下安裝前的規劃是何等重要)
--創建PV
# pvcreate /dev/sdd1
# pvcreate /dev/sdd2
--PV添加到VG
# vgextend VolGroup00 /dev/sdd1
# vgextend VolGroup00 /dev/sdd2
--查看PV
# pvs
# lvdisplay
--擴容LV
# lvextend -L +3000M /dev/VolGroup00/LogVol00
--擴大文件系統
# resize2fs -p /dev/mapper/VolGroup00-LogVol00
--查看擴容是否成功
# df -h
不再配置裸設備,直接使用裸區,以下直接忽略
vi /etc/udev/rules.d/60-raw.rules
ACTION=="add", KERNEL=="sdb1",RUN+="/bin/raw /dev/raw/raw1 %N"
ACTION=="add", KERNEL=="sdb2",RUN+="/bin/raw /dev/raw/raw2 %N"
ACTION=="add", KERNEL=="sdc1",RUN+="/bin/raw /dev/raw/raw3 %N"
ACTION=="add", KERNEL=="sdc2",RUN+="/bin/raw /dev/raw/raw4 %N"
ACTION=="add",KERNEL=="raw[1-4]", OWNER="grid", GROUP="asmadmin", MODE="660"
[[email protected] ~]# start_udev
[[email protected] ~]# ls -lrt /dev/raw
在ASMLIB相關軟件包已經安裝的前提下執行如下命令完成ASM的相關配置
[[email protected] 11.2.0]# /etc/init.d/oracleasm configure
Configuring the Oracle ASM library driver.
This will configure the on-boot properties of the Oracle ASM library
driver. The following questions will determine whether the driver is
loaded on boot and what permissions it will have. The current values
will be shown in brackets (‘[]‘). Hitting <ENTER> without typing an
answer will keep that current value. Ctrl-C will abort.
Default user to own the driver interface []: grid
Default group to own the driver interface []: asmadmin
Start Oracle ASM library driver on boot (y/n) [n]: y
Scan for Oracle ASM disks on boot (y/n) [y]:
Writing Oracle ASM library driver configuration: done
開始創建 asm盤(一定要改參數 asm_diskstring="ORCL:*")
在本次實驗中(11.2.0.3)中創建ASM盤遇到N多問題,解決問題的過程,了解到些東西。
在root用戶下操作
/etc/init.d/oracleasm createdisk VOL1_SDB1 /dev/sdb1
/etc/init.d/oracleasm createdisk VOL2_SDB2 /dev/sdb2
/etc/init.d/oracleasm createdisk VOL3_SDC1 /dev/sdc1
/etc/init.d/oracleasm createdisk VOL4_SDC2 /dev/sdc2
/etc/init.d/oracleasm createdisk VOL5_SDD1 /dev/sdd1
/etc/init.d/oracleasm createdisk VOL6_SDD2 /dev/sdd2
掃描ASM磁盤
/etc/init.d/oracleasm scandisks
查看ASM磁盤
/etc/init.d/oracleasm listdisks
oracleasm的log:
tail -20 /var/log/oracleasm
oracle 用戶的.bash_profile 文件
vi /home/oracle/.bash_profile
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/11.2.0/db_1
export ORACLE_SID=asm11g
export TNS_ADMIN=$ORACLE_HOME/network/admin
export ORA_NLS10=$ORACLE_HOME/nls/data
export NLS_LANG=AMERICAN_AMERICA.ZHS16GBK
export PATH=.:${PATH}:$HOME/bin:$ORACLE_HOME/bin
export PATH=${PATH}:/usr/bin:/bin:/usr/bin/X11:/usr/local/bin
export PATH=${PATH}:$ORACLE_BASE/common/oracle/bin
export LD_LIBRARY_PATH=$ORACLE_HOME/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:$ORACLE_HOME/oracm/lib
export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:/lib:/usr/lib:/usr/local/lib
export CLASSPATH=$ORACLE_HOME/JRE
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/rdbms/jlib
export CLASSPATH=${CLASSPATH}:$ORACLE_HOME/network/jlib
export TEMP=/tmp
export TMPDIR=/tmp
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
grid 用戶配置文件 ORACLE_HOSTNAME請自行設置
vi /home/grid/.bash_profile
export ORACLE_BASE=/u01/app/gridbase
export ORACLE_HOME=/u01/app/grid/product/11.2.0/grid_1
export ORACLE_SID=+ASM
export TEMP=/tmp
export TMPDIR=/tmp
PATH=$ORACLE_HOME/bin:$PATH; export PATH
if [ $USER = "oracle" ] || [ $USER = "grid" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
umask 022
fi
安裝的整體思路為:ASM軟件,配置ASM,數據庫軟件,配置數據庫。
在客戶端機器中執行
$export DISPLAY=192.168.1.103:0.0
$xhost +
RedHat Enterprise Linux 6.7 x64環境下安裝Oracle 11.2.0.4需要安裝的軟件包;
1、gcc軟件包
rpm -ivh gcc-4.4.7-16.el6.x86_64.rpm cloog-ppl-0.15.7-1.2.el6.x86_64.rpm cpp-4.4.7-16.el6.x86_64.rpm ppl-0.10.2-11.el6.x86_64.rpm mpfr-2.4.1-6.el6.x86_64.rpm
2、compat-libstdc++軟件包
rpm -ivh compat-libstdc++-33-3.2.3-69.el6.x86_64.rpm
3、elfutils-libelf-devel軟件包
rpm -ivh elfutils-libelf-devel-0.161-3.el6.x86_64.rpm
4、gcc-c++軟件包
rpm -ivh gcc-c++-4.4.7-16.el6.x86_64.rpm libstdc++-devel-4.4.7-16.el6.x86_64.rpm
5、libaio-devel 軟件包
rpm -ivh libaio-devel-0.3.107-10.el6.x86_64.rpm
6、pdksh軟件包
rpm -ivh pdksh-5.2.14-37.el5_8.1.x86_64.rpm
grid軟件安裝
最後運行彈出窗口的腳本
/u01/app/oraInventory/orainstRoot.sh
/u01/app/grid/product/11.2.0/grid_1/root.sh
一下為執行過程orainstRoot.sh
[[email protected] ~]# /u01/app/oraInventory/orainstRoot.sh
Changing permissions of /u01/app/oraInventory.
Adding read,write permissions for group.
Removing read,write,execute permissions for world.
Changing groupname of /u01/app/oraInventory to oinstall.
The execution of the script is complete.
執行root.sh
[[email protected] ~]# /u01/app/grid/product/11.2.0/grid_1/root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /u01/app/grid/product/11.2.0/grid_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
Copying dbhome to /usr/local/bin ...
Copying oraenv to /usr/local/bin ...
Copying coraenv to /usr/local/bin ...
Creating /etc/oratab file...
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
To configure Grid Infrastructure for a Stand-Alone Server run the following command as the root user:
/u01/app/grid/product/11.2.0/grid_1/perl/bin/perl -I/u01/app/grid/product/11.2.0/grid_1/perl/lib -I/u01/app/grid/product/11.2.0/grid_1/crs/install /u01/app/grid/product/11.2.0/grid_1/crs/install/roothas.pl
To configure Grid Infrastructure for a Cluster execute the following command:
/u01/app/grid/product/11.2.0/grid_1/crs/config/config.sh
This command launches the Grid Infrastructure Configuration Wizard. The wizard also supports silent operation, and the parameters can be passed through the response file that is available in the installation media.
按照上面的提示執行roothas.pl
[[email protected] ~]#/u01/app/grid/product/11.2.0/grid_1/perl/bin/perl -I/u01/app/grid/product/11.2.0/grid_1/perl/lib -I/u01/app/grid/product/11.2.0/grid_1/crs/install /u01/app/grid/product/11.2.0/grid_1/crs/install/roothas.pl
Using configuration parameter file: /u01/app/grid/product/11.2.0/grid_1/crs/install/crsconfig_params
Creating trace directory
/u01/app/grid/product/11.2.0/grid_1/bin/clscfg.bin: error while loading shared libraries: libcap.so.1: cannot open shared object file: No such file or directory
Failed to create keys in the OLR, rc = 127, Message:
Failed to create keys in the OLR at /u01/app/grid/product/11.2.0/grid_1/crs/install/crsconfig_lib.pm line 7660.
上面的錯誤處理步驟如下:
[[email protected] Packages]# cd /lib64
[[email protected] lib64]# ls -lrt libcap*
[[email protected] lib64]# ls -lrt libcap.so.2
[[email protected] lib64]# ln -s libcap.so.2.16 libcap.so.1
再次執行roothas.pl
[[email protected] ~]#/u01/app/grid/product/11.2.0/grid_1/perl/bin/perl -I/u01/app/grid/product/11.2.0/grid_1/perl/lib -I/u01/app/grid/product/11.2.0/grid_1/crs/install /u01/app/grid/product/11.2.0/grid_1/crs/install/roothas.pl
Using configuration parameter file: /u01/app/grid/product/11.2.0/grid_1/crs/install/crsconfig_params
Improper Oracle Grid Infrastructure configuration found on this host
Deconfigure the existing cluster configuration before starting
to configure a new Grid Infrastructure
run ‘/u01/app/grid/product/11.2.0/grid_1/crs/install/roothas.pl -deconfig‘
to configure existing failed configuration and then rerun root.sh
重新執行roothas.pl
[[email protected] ~]#/u01/app/grid/product/11.2.0/grid_1/crs/install/roothas.pl -deconfig
Using configuration parameter file: /u01/app/grid/product/11.2.0/grid_1/crs/install/crsconfig_params
Oracle Restart stack is not active on this node
Restart the SIHA stack (use /u01/app/grid/product/11.2.0/grid_1/bin/crsctl start has) and retry
Failed to verify HA resources
執行刪除命令
/u01/app/grid/product/11.2.0/grid_1/crs/install/rootcrs.pl -deconfig -force -verbose
再次執行root腳本
[[email protected] ~]# /u01/app/grid/product/11.2.0/grid_1/root.sh
Performing root user operation for Oracle 11g
The following environment variables are set as:
ORACLE_OWNER= grid
ORACLE_HOME= /u01/app/grid/product/11.2.0/grid_1
Enter the full pathname of the local bin directory: [/usr/local/bin]:
The contents of "dbhome" have not changed. No need to overwrite.
The contents of "oraenv" have not changed. No need to overwrite.
The contents of "coraenv" have not changed. No need to overwrite.
Entries will be added to the /etc/oratab file as needed by
Database Configuration Assistant when a database is created
Finished running generic part of root script.
Now product-specific root actions will be performed.
To configure Grid Infrastructure for a Stand-Alone Server run the following command as the root user:
/u01/app/grid/product/11.2.0/grid_1/perl/bin/perl -I/u01/app/grid/product/11.2.0/grid_1/perl/lib -I/u01/app/grid/product/11.2.0/grid_1/crs/install /u01/app/grid/product/11.2.0/grid_1/crs/install/roothas.pl
To configure Grid Infrastructure for a Cluster execute the following command:
/u01/app/grid/product/11.2.0/grid_1/crs/config/config.sh
This command launches the Grid Infrastructure Configuration Wizard. The wizard also supports silent operation, and the parameters can be passed through the response file that is available in the installation media.
按照上面的提示執行roothas.pl
[[email protected] ~]# /u01/app/grid/product/11.2.0/grid_1/perl/bin/perl -I/u01/app/grid/product/11.2.0/grid_1/perl/lib -I/u01/app/grid/product/11.2.0/grid_1/crs/install /u01/app/grid/product/11.2.0/grid_1/crs/install/roothas.pl
Using configuration parameter file: /u01/app/grid/product/11.2.0/grid_1/crs/install/crsconfig_params
LOCAL ADD MODE
Creating OCR keys for user ‘grid‘, privgrp ‘oinstall‘..
Operation successful.
LOCAL ONLY MODE
Successfully accumulated necessary OCR keys.
Creating OCR keys for user ‘root‘, privgrp ‘root‘..
Operation successful.
CRS-4664: Node asm11g successfully pinned.
Adding Clusterware entries to upstart
asm11g 2015/10/05 22:54:23 /u01/app/grid/product/11.2.0/grid_1/cdata/asm11g/backup_20151005_225423.olr
Successfully configured Oracle Grid Infrastructure for a Standalone Server
運行 netca 配置監聽(在grid用戶下)
運行 asmca (從dbca中分離了出來)
--沒有配置linux raw 時看不到任何設備,為什麽,重啟後可以看到!神器了!
asm實例的用戶密碼均為oracle
註意 asm_diskstring 賦值為 "ORCL:*"
alter system set asm_diskstring="ORCL:*"
裸區被標記為asmdisk後,系統會優先掃描裸區,這樣asmdisk雖然可見,但是不可用,
修改 asm_diskstring="ORCL:*" 那asm就僅能看見 asmdisk
如果配置 asmca 時出錯,退出後重新運行 asmca 就可以了!
建議asm disk group 有個遠景規劃,比如預計100G左右的數據庫要按照1000G的數據庫去規劃
DG_DATA01
最後提示如下時,說明asm實例創建成功
ASM created and started successfully.
Disk Group DG_DATA01 created successfully.
grid 用戶下,註意用sysasm登錄(11g新加的角色)
[[email protected] ~]$ sqlplus /nolog
SQL> conn / as sysasm
Connected.
SQL> shutdown immediate
ASM diskgroups dismounted
ASM instance shutdown
安裝數據庫(僅安裝數據庫軟件)
下一步,一直下一步 註意選擇 only database software
/u01/app/oracle/product/10.2.0/db_1/root.sh
分別運行後 數據庫軟件就算安裝完畢了
開始創建數據庫,運行dbca
[[email protected] database]$ dbca
註意存儲時選擇ASM,
DG_DATA01
註意選擇數據庫的編碼
再後面是創建數據庫了,沒什麽好說的了
------------
11g grid 下啟動asm實例會報 ORA-29701 錯誤
[[email protected] ~]$ sqlplus / as sysasm
SQL*Plus: Release 11.2.0.3.0 Production on Sun May 12 00:29:57 2013
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to an idle instance.
SQL> startup
ORA-01078: failure in processing system parameters
ORA-29701: unable to connect to Cluster Synchronization Service
那是因為css沒有起來,可以手動起來,或者稍等一下,因為重啟後會隨著系統啟動,存在延遲
註意用戶.bash_profile 的 ORACLE_SID 和dbca 的實例名的大小寫
--檢查css
crsctl check css
ps -ef|grep cssd
--檢查has
crsctl check has
ps -ef|grep d.bin
手動啟動css
crsctl start resource ora.cssd
手動啟動全部資源
crsctl start resource -all
[[email protected] bin]$ ./crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora....A_01.dg ora....up.type 0/5 0/ ONLINE ONLINE dbasm
ora....ER.lsnr ora....er.type 0/5 0/ ONLINE ONLINE dbasm
ora.asm ora.asm.type 0/5 0/ ONLINE ONLINE dbasm
ora.cssd ora.cssd.type 0/5 0/5 ONLINE ONLINE dbasm
ora.diskmon ora....on.type 0/10 0/5 OFFLINE OFFLINE
ora.evmd ora.evm.type 0/10 0/5 ONLINE ONLINE dbasm
ora.ons ora.ons.type 0/3 0/ OFFLINE OFFLINE
crsctl status resource -t
[[email protected] admin]$ crsctl status resource -t
--------------------------------------------------------------------------------
NAME TARGET STATE SERVER STATE_DETAILS
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DG_DATA_01.dg
ONLINE ONLINE dbasm
ora.LISTENER.lsnr
ONLINE ONLINE dbasm
ora.asm
ONLINE ONLINE dbasm Started
ora.ons
OFFLINE OFFLINE dbasm
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.bidb.db
1 ONLINE ONLINE dbasm Open
ora.cssd
1 ONLINE ONLINE dbasm
ora.diskmon
1 OFFLINE OFFLINE
ora.evmd
1 ONLINE ONLINE dbasm
1)默認情況下HAS(High Availability Service)是自動啟動的.通過如下命令可以取消和啟用自動啟動
crsctl disable has
crsctl enable has
2)HAS手動啟動和停止
crsctl start has
crsctl stop has
3)查看HAS的狀態
crsctl check has
4)如果想讓ora.css和ora.diskmon服務隨著HAS的啟動而自動啟動,
那麽你可以這兩個服務的AUTO_START屬性
crsctl modify resource "ora.cssd" -attr "AUTO_START=1"
or
crsctl modify resource "ora.diskmon" -attr "AUTO_START=1"
5)如果想取消ora.css和ora.diskmon的Auto start
crsctl modify resource "ora.cssd" -attr "AUTO_START=never"
or
crsctl modify resource "ora.diskmon" -attr "AUTO_START=never"
但是我發現在RHEL6.3上啟動has服務並不能只使用crsctl start has 這個命令來啟動,還必須以root用戶去執行
/etc/init.d/init.ohasd run 這命令,才能啟動has服務,不然crsctl start has 會一直掛著且也不能啟動。
查看資源屬性
crs_stat -p ora.cssd
AUTO_START=never
crs_stat -p ora.diskmon
AUTO_START=never
----------------------------------------------------------
init.ohasd

Oracle11g(RedHat Enterprise Linux6.7)-ASM