您好,登錄后才能下訂單哦!
1. [grid@RAC01 ~]$ crsctl stop database -d RACwh
數據庫關閉ok后此時我們進行關閉crs服務,切忌不要直接關閉ASM實例,在11g中 11.2.0.2 中 ocr 服務的信息存放在asm 磁盤上,是依賴于asm的,所以要關閉crs 而不是直接關閉asm實例,若在此處強行關閉asm實例,很有可能造成的后果是asm磁盤損壞或者丟失,導致整個集群徹底崩潰。我在測試RAC時,曾dismount某個磁盤組后,首先關閉了數據庫,接著直接關閉了asm實例,關閉時一切正常。無報錯,但當啟動時,發現asm無法啟動crs提示CRS-0184: Cannot communicate with the CRS daemon.無論如何也是無法啟動CRS的,意識到可能是表決磁盤或者OCR出現問題,隨即查看asm磁盤情況:oracleasm listdisks,沒有任何磁盤信息,oracleasm scandisks也是同樣的情況,這下估計麻煩了。在登錄到另外一個節點上,同樣命令查看asm磁盤,發現磁盤正常。故此此時我也將該節點的數據庫及asm實例關閉,然后重啟服務器,之后悲劇的一幕想當然的發生了,兩個節點都無法掃描到asm磁盤信息。整個集群破壞的很徹底,丟失數據。也許是我個人原因造成這種異常的數據丟失,但個人還是建議按照常規的順序來關閉啟動RAC。
2. [root@RAC01 bin]# ./crsctl stop crs
如果你足夠細心,你可以通過下面的關閉日志看出在RAC的CRS關閉的過程中是一個怎樣的順序以及關閉crs的時候都會有那些服務會同時關閉。此外你可能還會發現我們的這個命令是在RAC01這個節點執行的,所以這時候應該RAC02這個節點還是可以正常使用的。強烈建議大家對下面的日志進行研究。
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'rac01'
CRS-2673: Attempting to stop 'ora.crsd' on 'rac01'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'rac01'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN3.lsnr' on 'rac01'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'rac01'
CRS-2673: Attempting to stop 'ora.FLASH.dg' on 'rac01'
CRS-2673: Attempting to stop 'ora.OCRVD.dg' on 'rac01'
CRS-2673: Attempting to stop 'ora.registry.acfs' on 'rac01'
CRS-2673: Attempting to stop 'ora.DATA.dg' on 'rac01'
CRS-2673: Attempting to stop 'ora.oc4j' on 'rac01'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN2.lsnr' on 'rac01'
CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'rac01'
CRS-2677: Stop of 'ora.LISTENER_SCAN3.lsnr' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.scan3.vip' on 'rac01'
CRS-2677: Stop of 'ora.scan3.vip' on 'rac01' succeeded
CRS-2672: Attempting to start 'ora.scan3.vip' on 'rac02'
CRS-2677: Stop of 'ora.LISTENER_SCAN2.lsnr' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.scan2.vip' on 'rac01'
CRS-2677: Stop of 'ora.scan2.vip' on 'rac01' succeeded
CRS-2672: Attempting to start 'ora.scan2.vip' on 'rac02'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.rac01.vip' on 'rac01'
CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.scan1.vip' on 'rac01'
CRS-2677: Stop of 'ora.rac01.vip' on 'rac01' succeeded
CRS-2672: Attempting to start 'ora.rac01.vip' on 'rac02'
CRS-2677: Stop of 'ora.scan1.vip' on 'rac01' succeeded
CRS-2672: Attempting to start 'ora.scan1.vip' on 'rac02'
CRS-2677: Stop of 'ora.registry.acfs' on 'rac01' succeeded
CRS-2677: Stop of 'ora.FLASH.dg' on 'rac01' succeeded
CRS-2676: Start of 'ora.scan3.vip' on 'rac02' succeeded
CRS-2672: Attempting to start 'ora.LISTENER_SCAN3.lsnr' on 'rac02'
CRS-2676: Start of 'ora.scan2.vip' on 'rac02' succeeded
CRS-2672: Attempting to start 'ora.LISTENER_SCAN2.lsnr' on 'rac02'
CRS-2676: Start of 'ora.rac01.vip' on 'rac02' succeeded
CRS-2676: Start of 'ora.scan1.vip' on 'rac02' succeeded
CRS-2672: Attempting to start 'ora.LISTENER_SCAN1.lsnr' on 'rac02'
CRS-2676: Start of 'ora.LISTENER_SCAN3.lsnr' on 'rac02' succeeded
CRS-2676: Start of 'ora.LISTENER_SCAN2.lsnr' on 'rac02' succeeded
CRS-2676: Start of 'ora.LISTENER_SCAN1.lsnr' on 'rac02' succeeded
CRS-2677: Stop of 'ora.OCRVD.dg' on 'rac01' succeeded
CRS-2677: Stop of 'ora.DATA.dg' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'rac01'
CRS-2677: Stop of 'ora.asm' on 'rac01' succeeded
CRS-2677: Stop of 'ora.oc4j' on 'rac01' succeeded
CRS-2672: Attempting to start 'ora.oc4j' on 'rac02'
CRS-2676: Start of 'ora.oc4j' on 'rac02' succeeded
CRS-2673: Attempting to stop 'ora.eons' on 'rac01'
CRS-2673: Attempting to stop 'ora.ons' on 'rac01'
CRS-2677: Stop of 'ora.ons' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'rac01'
CRS-2677: Stop of 'ora.net1.network' on 'rac01' succeeded
CRS-2677: Stop of 'ora.eons' on 'rac01' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'rac01' has completed
CRS-2677: Stop of 'ora.crsd' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.cssdmonitor' on 'rac01'
CRS-2673: Attempting to stop 'ora.ctssd' on 'rac01'
CRS-2673: Attempting to stop 'ora.evmd' on 'rac01'
CRS-2673: Attempting to stop 'ora.asm' on 'rac01'
CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'rac01'
CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac01'
CRS-2677: Stop of 'ora.cssdmonitor' on 'rac01' succeeded
CRS-2677: Stop of 'ora.evmd' on 'rac01' succeeded
CRS-2677: Stop of 'ora.ctssd' on 'rac01' succeeded
CRS-2677: Stop of 'ora.mdnsd' on 'rac01' succeeded
CRS-2677: Stop of 'ora.drivers.acfs' on 'rac01' succeeded
CRS-2677: Stop of 'ora.asm' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'rac01'
CRS-2677: Stop of 'ora.cssd' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.gpnpd' on 'rac01'
CRS-2673: Attempting to stop 'ora.diskmon' on 'rac01'
CRS-2677: Stop of 'ora.gpnpd' on 'rac01' succeeded
CRS-2673: Attempting to stop 'ora.gipcd' on 'rac01'
CRS-2677: Stop of 'ora.gipcd' on 'rac01' succeeded
CRS-2677: Stop of 'ora.diskmon' on 'rac01' succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'rac01' has completed
CRS-4133: Oracle High Availability Services has been stopped.
[root@RAC01 bin]#
3. 驗證關閉情況:
[root@RAC01 bin]# ./crs_stat -t -v
CRS-0184: Cannot communicate with the CRS daemon.
[root@RAC01 bin]#
4. 啟動crs服務:
[root@RAC01 bin]# ./crsctl start crs-------------此處可能需要等待一段時間。
CRS-4123: Oracle High Availability Services has been started.
[root@RAC01 bin]#
5. 查看啟動情況:
[grid@RAC02 ~]$ crs_stat -t -v
Name Type R/RA F/FT Target State Host
----------------------------------------------------------------------
ora.DATA.dg ora....up.type 0/5 0/ ONLINE ONLINE rac02
ora.FLASH.dg ora....up.type 0/5 0/ ONLINE ONLINE rac02
ora....ER.lsnr ora....er.type 0/5 0/ ONLINE ONLINE rac01
ora....N1.lsnr ora....er.type 0/5 0/0 ONLINE ONLINE rac01
ora....N2.lsnr ora....er.type 0/5 0/0 ONLINE ONLINE rac02
ora....N3.lsnr ora....er.type 0/5 0/0 ONLINE ONLINE rac02
ora....N4.lsnr ora....er.type 0/5 0/0 ONLINE ONLINE rac02
ora.OCRVD.dg ora....up.type 0/5 0/ ONLINE ONLINE rac01
ora.asm ora.asm.type 0/5 0/ ONLINE ONLINE rac01
ora.eons ora.eons.type 0/3 0/ ONLINE ONLINE rac01
ora.gsd ora.gsd.type 0/5 0/ OFFLINE OFFLINE
ora....network ora....rk.type 0/5 0/ ONLINE ONLINE rac01
ora.oc4j ora.oc4j.type 0/5 0/0 ONLINE ONLINE rac02
ora.ons ora.ons.type 0/3 0/ ONLINE ONLINE rac01
ora....SM1.asm application 0/5 0/0 ONLINE ONLINE rac01
ora....01.lsnr application 0/5 0/0 ONLINE ONLINE rac01
ora.rac01.gsd application 0/5 0/0 OFFLINE OFFLINE
ora.rac01.ons application 0/3 0/0 ONLINE ONLINE rac01
ora.rac01.vip ora....t1.type 0/0 0/0 ONLINE ONLINE rac01
ora....SM2.asm application 0/5 0/0 ONLINE ONLINE rac02
ora....02.lsnr application 0/5 0/0 ONLINE ONLINE rac02
ora.rac02.gsd application 0/5 0/0 OFFLINE OFFLINE
ora.rac02.ons application 0/3 0/0 ONLINE ONLINE rac02
ora.rac02.vip ora....t1.type 0/0 0/0 ONLINE ONLINE rac02
ora.racwh.db ora....se.type 0/2 0/1 OFFLINE OFFLINE
ora....f01.svc ora....ce.type 0/0 1/0 OFFLINE OFFLINE-----------我個人添加的STAF服務。
ora....f02.svc ora....ce.type 0/0 0/0 OFFLINE OFFLINE-----------我個人添加的STAF服務。
ora....ry.acfs ora....fs.type 0/5 0/ ONLINE ONLINE rac01
ora.scan1.vip ora....ip.type 0/0 1/0 ONLINE ONLINE rac01
ora.scan2.vip ora....ip.type 0/0 1/0 ONLINE ONLINE rac02
ora.scan3.vip ora....ip.type 0/0 0/0 ONLINE ONLINE rac02
ora.scan4.vip ora....ip.type 0/0 0/0 ONLINE ONLINE rac02
[grid@RAC02 ~]$
6. 啟動數據庫:
[grid@RAC02 ~]$ srvctl start database -d RACwh
PRCR-1079 : Failed to start resource ora.racwh.db
ORA-16038: log 3 sequence# 41 cannot be archived
ORA-19504: failed to create file ""
ORA-00312: online log 3 thread 2: '+DATA/racwh/redo03.log'
CRS-2674: Start of 'ora.racwh.db' on 'rac01' failed
CRS-2632: There are no more servers to try to place resource 'ora.racwh.db' on that would satisfy its placement policy
[grid@RAC02 ~]$
針對上述的報錯,經查看原來是歸檔日志所在的asm未能mount所致,執行該磁盤的mount后重新執行數據庫啟動即可。
此外給大家推薦幾個日常的啟動關閉命令:
其他管理維護指南
一.通過srvctl管理
1.關閉RAC數據庫服務順序
[oracle@dbp ~] $ srvctl stop database -d RACwh
[oracle@dbp ~] $ srvctl stop asm -n RAC01
[oracle@dbp ~] $ srvctl stop asm -n RAC02
[oracle@dbp ~] $ srvctl stop nodeapps -n RAC01
[oracle@dbp ~] $ srvctl stop nodeapps -n RAC02
2.啟動RAC數據庫服務順序
[oracle@RAC01 ~] $ srvctl start nodeapps -n RAC01
[oracle@RAC01 ~] $ srvctl start nodeapps -n RAC02
[oracle@RAC01 ~] $ srvctl start asm -n RAC01
[oracle@RAC01 ~] $ srvctl start asm -n RAC02
[oracle@RAC01 ~] $ srvctl start database -d RACwh
3.其他命令
實例管理
[oracle@RAC01 ~] $ srvctl status instance -d RACwh -i RACwh2
[oracle@RAC01 ~] $ srvctl stop instance -d RACwh -i RACwh2
[oracle@RAC01 ~] $ srvctl start instance -d RACwh -i RACwh2
監聽管理
[oracle@RAC01 ~] $ srvctl status listener -n RAC01
[oracle@RAC01 ~] $ srvctl stop listener -n RAC01
[oracle@RAC01 ~] $ srvctl start listener -n RAC01
二.通過crsctl工具管理
[oracle@RAC01 ~] $ crs_stat -t
[oracle@RAC01 ~] $ crs_stat
[oracle@RAC01 ~] $ crs_start -all
[oracle@RAC01 ~] $ crs_stop -all
[oracle@RAC01 ~] $ crs_stop "ora. RACwh.db"
Crs_stat命令在oracle11g后逐漸趨于廢棄,如下即可明白:
[grid@RAC02 ~]$ crs_stat -h
This command is deprecated and has been replaced by 'crsctl status resource'
This command remains for backward compatibility only
Usage: crs_stat [resource_name [...]] [-v] [-l] [-q] [-c cluster_member]
crs_stat [resource_name [...]] -t [-v] [-q] [-c cluster_member]
crs_stat -p [resource_name [...]] [-q]
crs_stat [-a] application -g
crs_stat [-a] application -r [-c cluster_member]
crs_stat -f [resource_name [...]] [-q] [-c cluster_member]
crs_stat -ls [resource_name [...]] [-q]
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。