RAC环境为两个节点环境节点1为udb1节点为udb2,集群环境启动的正常
1. 在节点1上增加一个服务mdspr并启动服务 节点1udb1为主用节点,节点2udb2为备用节点
mdsp01:oracle:orcl1 > srvctl add service -d udb -s mdspr -r udb1 -a udb2
mdsp01:oracle:orcl1 > srvctl start service -d udb -s mdspr
mdsp01:oracle:orcl1 >
查看节点1的服务
SQL> show parameter service
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
service_names string mdspr
SQL>
mdsp02:oracle:orcl1 > crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora....SM1.asm application 0/5 0/0 ONLINE ONLINE mdsp01
ora....01.lsnr application 0/5 0/0 ONLINE ONLINE mdsp01
ora.mdsp01.gsd application 0/5 0/0 ONLINE ONLINE mdsp01
ora.mdsp01.ons application 0/3 0/0 ONLINE ONLINE mdsp01
ora.mdsp01.vip application 0/0 0/0 ONLINE ONLINE mdsp01
ora....SM2.asm application 0/5 0/0 ONLINE ONLINE mdsp02
ora....02.lsnr application 0/5 0/0 ONLINE ONLINE mdsp02
ora.mdsp02.gsd application 0/5 0/0 ONLINE ONLINE mdsp02
ora.mdsp02.ons application 0/3 0/0 ONLINE ONLINE mdsp02
ora.mdsp02.vip application 0/0 0/0 ONLINE ONLINE mdsp02
ora.udb.db application 0/0 0/1 ONLINE ONLINE mdsp02
ora....dspr.cs application 0/0 0/1 ONLINE ONLINE mdsp01
ora....db1.srv application 0/0 0/0 ONLINE ONLINE mdsp01
ora....b1.inst application 0/5 0/0 ONLINE ONLINE mdsp01
ora....b2.inst application 0/5 0/0 ONLINE ONLINE mdsp02
2 . 增加一个服务mdspw并启动服务 节点2udb2为主用节点,节点1udb1为备用节点
mdsp01:oracle:orcl1 > srvctl add service -d udb -s mdsp2 -r udb2 -a udb1
mdsp01:oracle:orcl1 > srvctl start service -d udb -s mdspw
mdsp01:oracle:orcl1 >
mdsp02:oracle:orcl1 > crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora....SM1.asm application 0/5 0/0 ONLINE ONLINE mdsp01
ora....01.lsnr application 0/5 0/0 ONLINE ONLINE mdsp01
ora.mdsp01.gsd application 0/5 0/0 ONLINE ONLINE mdsp01
ora.mdsp01.ons application 0/3 0/0 ONLINE ONLINE mdsp01
ora.mdsp01.vip application 0/0 0/0 ONLINE ONLINE mdsp01
ora....SM2.asm application 0/5 0/0 ONLINE ONLINE mdsp02
ora....02.lsnr application 0/5 0/0 ONLINE ONLINE mdsp02
ora.mdsp02.gsd application 0/5 0/0 ONLINE ONLINE mdsp02
ora.mdsp02.ons application 0/3 0/0 ONLINE ONLINE mdsp02
ora.mdsp02.vip application 0/0 0/0 ONLINE ONLINE mdsp02
ora.udb.db application 0/0 0/1 ONLINE ONLINE mdsp02
ora....dspr.cs application 0/0 0/1 ONLINE ONLINE mdsp01
ora....db1.srv application 0/0 0/0 ONLINE ONLINE mdsp01
ora....dspw.cs application 0/0 0/1 ONLINE ONLINE mdsp02
ora....db2.srv application 0/0 0/0 ONLINE ONLINE mdsp02
ora....b1.inst application 0/5 0/0 ONLINE ONLINE mdsp01
ora....b2.inst application 0/5 0/0 ONLINE ONLINE mdsp02
查看节点的服务
SQL> show parameter service
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
service_names string mdspw
SQL>
3 . 重启节点2
mdsp02:/oracle/crs/bin # reboot
Broadcast message from root (pts/3) (Sat May 5 13:11:19 2012):
The system is going down for reboot NOW!
mdsp02:/oracle/crs/bin #
4 . 节点2的服务mdspw和vip资源切换到节点上了,查看节点1的状态如下:
mdsp01:oracle:orcl1 > crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora....SM1.asm application 0/5 0/0 ONLINE ONLINE mdsp01
ora....01.lsnr application 0/5 0/0 ONLINE ONLINE mdsp01
ora.mdsp01.gsd application 0/5 0/0 ONLINE ONLINE mdsp01
ora.mdsp01.ons application 0/3 0/0 ONLINE ONLINE mdsp01
ora.mdsp01.vip application 0/0 0/0 ONLINE ONLINE mdsp01
ora....SM2.asm application 0/5 0/0 ONLINE OFFLINE
ora....02.lsnr application 0/5 0/0 OFFLINE OFFLINE
ora.mdsp02.gsd application 0/5 0/0 ONLINE OFFLINE
ora.mdsp02.ons application 0/3 0/0 ONLINE OFFLINE
ora.mdsp02.vip application 0/0 0/0 ONLINE ONLINE mdsp01
ora.udb.db application 0/0 0/1 ONLINE ONLINE mdsp01
ora....dspr.cs application 0/0 0/1 ONLINE ONLINE mdsp01
ora....db1.srv application 0/0 0/0 ONLINE ONLINE mdsp01
ora....dspw.cs application 0/0 0/1 ONLINE ONLINE mdsp01
ora....db2.srv application 0/0 0/0 ONLINE ONLINE mdsp01
ora....b1.inst application 0/5 0/0 ONLINE ONLINE mdsp01
ora....b2.inst application 0/5 0/0 ONLINE OFFLINE
服务被切换到节点1上
SQL> show parameter service
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
service_names string mdspr, udb, mdspw
SQL>
5. 把节点2上资源启动恢复节点2 (mdspw服务不会切换回去,需要手动切换回来)
crs_start -all
mdsp02:oracle:orcl1 > crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora....SM1.asm application 0/5 0/0 ONLINE ONLINE mdsp01
ora....01.lsnr application 0/5 0/0 ONLINE ONLINE mdsp01
ora.mdsp01.gsd application 0/5 0/0 ONLINE ONLINE mdsp01
ora.mdsp01.ons application 0/3 0/0 ONLINE ONLINE mdsp01
ora.mdsp01.vip application 0/0 0/0 ONLINE ONLINE mdsp01
ora....SM2.asm application 0/5 0/0 ONLINE ONLINE mdsp02
ora....02.lsnr application 0/5 0/0 ONLINE ONLINE mdsp02
ora.mdsp02.gsd application 0/5 0/0 ONLINE ONLINE mdsp02
ora.mdsp02.ons application 0/3 0/0 ONLINE ONLINE mdsp02
ora.mdsp02.vip application 0/0 0/0 ONLINE ONLINE mdsp02
ora.udb.db application 0/0 0/1 ONLINE ONLINE mdsp01
ora....dspr.cs application 0/0 0/1 ONLINE ONLINE mdsp01
ora....db1.srv application 0/0 0/0 ONLINE ONLINE mdsp01
ora....dspw.cs application 0/0 0/1 ONLINE ONLINE mdsp01
ora....db2.srv application 0/0 0/0 ONLINE ONLINE mdsp01
ora....b1.inst application 0/5 0/0 ONLINE ONLINE mdsp01
ora....b2.inst application 0/5 0/0 ONLINE OFFLINE
启动节点2的数据库
srvctl start database -d udb
6 . 手动重启mdspw服务使服务切换会mdsp2上
mdsp01:oracle:orcl1 > srvctl stop service -d udb -s mdspw
mdsp01:oracle:orcl1 > srvctl start service -d udb -s mdspw
mdsp01:oracle:orcl1 > crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora....SM1.asm application 0/5 0/0 ONLINE ONLINE mdsp01
ora....01.lsnr application 0/5 0/0 ONLINE ONLINE mdsp01
ora.mdsp01.gsd application 0/5 0/0 ONLINE ONLINE mdsp01
ora.mdsp01.ons application 0/3 0/0 ONLINE ONLINE mdsp01
ora.mdsp01.vip application 0/0 0/0 ONLINE ONLINE mdsp01
ora....SM2.asm application 0/5 0/0 ONLINE ONLINE mdsp02
ora....02.lsnr application 0/5 0/0 ONLINE ONLINE mdsp02
ora.mdsp02.gsd application 0/5 0/0 ONLINE ONLINE mdsp02
ora.mdsp02.ons application 0/3 0/0 ONLINE ONLINE mdsp02
ora.mdsp02.vip application 0/0 0/0 ONLINE ONLINE mdsp02
ora.udb.db application 0/0 0/1 ONLINE ONLINE mdsp01
ora....dspr.cs application 0/0 0/1 ONLINE ONLINE mdsp01
ora....db1.srv application 0/0 0/0 ONLINE ONLINE mdsp01
ora....dspw.cs application 0/0 0/1 ONLINE ONLINE mdsp02
ora....db2.srv application 0/0 0/0 ONLINE ONLINE mdsp02
ora....b1.inst application 0/5 0/0 ONLINE ONLINE mdsp01
ora....b2.inst application 0/5 0/0 ONLINE ONLINE mdsp02