11g r2 RAC的啟停命令概述1

秋去天無邊發表於2016-05-26

目標:

熟悉主要程式的啟停順序 瞭解獨佔模式 -excl crsctl start crs與crsctl start cluster 區別

1.熟悉主要程式的啟停順序

1.1 啟動節點rac1:

01.1 [root@rac1 bin]# ./crsctl start crs -excl
02.2 CRS-4123: Oracle High Availability Services has been started.  --啟動OHASD程式
03.3 CRS-2672: Attempting to start 'ora.gipcd' on 'rac1'
04.4 CRS-2672: Attempting to start 'ora.mdnsd' on 'rac1'
05.5 CRS-2676: Start of 'ora.gipcd' on 'rac1' succeeded             --啟動ora.gipcd
06.6 CRS-2676: Start of 'ora.mdnsd' on 'rac1' succeeded             --啟動ora.mdnsd
07.7 CRS-2672: Attempting to start 'ora.gpnpd' on 'rac1'
08.8 CRS-2676: Start of 'ora.gpnpd' on 'rac1' succeeded             --啟動ora.gpnpd
09.9 CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac1'
10.10 CRS-2676: Start of 'ora.cssdmonitor' on 'rac1' succeeded       --啟動ora.cssdmonitor
11.11 CRS-2672: Attempting to start 'ora.cssd' on 'rac1'
12.12 CRS-2679: Attempting to clean 'ora.diskmon' on 'rac1'
13.13 CRS-2681: Clean of 'ora.diskmon' on 'rac1' succeeded           --清除ora.diskmon
14.14 CRS-2672: Attempting to start 'ora.diskmon' on 'rac1'
15.15 CRS-2676: Start of 'ora.diskmon' on 'rac1' succeeded           --啟動ora.diskmon
16.16 CRS-2676: Start of 'ora.cssd' on 'rac1' succeeded              --啟動ora.cssd
17.17 CRS-2672: Attempting to start 'ora.ctssd' on 'rac1'
18.18 CRS-2672: Attempting to start 'ora.drivers.acfs' on 'rac1'
19.19 CRS-2676: Start of 'ora.ctssd' on 'rac1' succeeded             --啟動ora.ctssd
20.20 CRS-2676: Start of 'ora.drivers.acfs' on 'rac1' succeeded      --啟動ora.drivers.acfs
21.21 CRS-2672: Attempting to start 'ora.asm' on 'rac1'            
22.22 CRS-2676: Start of 'ora.asm' on 'rac1' succeeded               --啟動ora.asm
23.23 CRS-2672: Attempting to start 'ora.crsd' on 'rac1'            
24.24 CRS-2676: Start of 'ora.crsd' on 'rac1' succeeded              --啟動ora.crsd
25.25
26.26 觀察節點rac2:                                                 --節點未啟動,說明 crsctl start crs -excl 只啟動單節點程式
27.27 [root@rac2 bin]# ps -ef|grep grid         
28.28 root      5823  4165  0 23:26 pts/1    00:00:00 grep grid
29.29 [root@rac2 bin]#

1.2 關閉節點rac1

01.1 [root@rac1 bin]# ./crsctl stop crs -f
02.2 CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on'rac1'
03.3 CRS-2673: Attempting to stop 'ora.crsd' on'rac1'                                           
04.4 CRS-2677: Stop of 'ora.crsd' on 'rac1' succeeded                               --關閉ora.crsd
05.5 CRS-2673: Attempting to stop 'ora.cssdmonitor' on'rac1'                                     
06.6 CRS-2673: Attempting to stop 'ora.ctssd' on 'rac1'
07.7 CRS-2673: Attempting to stop 'ora.asm' on 'rac1'
08.8 CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'rac1'
09.9 CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac1'
10.10 CRS-2677: Stop of 'ora.cssdmonitor' on 'rac1' succeeded                        --關閉ora.cssdmonitor        
11.11 CRS-2677: Stop of 'ora.mdnsd' on 'rac1' succeeded                              --關閉ora.mdnsd
12.12 CRS-2677: Stop of 'ora.ctssd' on 'rac1' succeeded                              --關閉ora.ctssd
13.13 CRS-2677: Stop of 'ora.drivers.acfs' on 'rac1' succeeded                       --關閉ora.drivers.acfs
14.14 CRS-2677: Stop of 'ora.asm' on 'rac1' succeeded                                --關閉ora.asm  
15.15 CRS-2673: Attempting to stop 'ora.cssd' on 'rac1'
16.16 CRS-2677: Stop of 'ora.cssd' on 'rac1' succeeded                               --關閉ora.cssd
17.17 CRS-2673: Attempting to stop 'ora.gpnpd' on 'rac1'
18.18 CRS-2673: Attempting to stop 'ora.diskmon' on 'rac1'
19.19 CRS-2677: Stop of 'ora.gpnpd' on 'rac1' succeeded                              --關閉ora.gpnpd
20.20 CRS-2673: Attempting to stop 'ora.gipcd' on 'rac1'
21.21 CRS-2677: Stop of 'ora.diskmon' on 'rac1' succeeded                            --關閉ora.diskmon
22.22 CRS-2677: Stop of 'ora.gipcd' on 'rac1' succeeded                              --關閉ora.gipcd
23.23 CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'rac1' has completed --關閉OHASD程式
24.24 CRS-4133: Oracle High Availability Services has been stopped.
25.25 [root@rac1 bin]#

  總結:重要程式的啟動順序為:OHASD -> ora.gpnpd -> ora.cssd -> ora.asm -> ora.crsd

2. 瞭解獨佔模式 -excl

  既然是以獨佔模式啟動,那麼有些資源一定是不能被其他節點共享的。出現搶佔資源會出現什麼情況

2.1 啟動節點rac1:

01.1 [root@rac1 bin]# ./crsctl start crs -excl                   -- -excl表示以獨佔模式啟動
02.2 CRS-4123: Oracle High Availability Services has been started.
03.3 CRS-2672: Attempting to start 'ora.gipcd' on 'rac1'
04.4 CRS-2672: Attempting to start 'ora.mdnsd' on 'rac1'
05.5 CRS-2676: Start of 'ora.gipcd' on 'rac1' succeeded
06.6 CRS-2676: Start of 'ora.mdnsd' on 'rac1' succeeded
07.7 CRS-2672: Attempting to start 'ora.gpnpd' on 'rac1'
08.8 CRS-2676: Start of 'ora.gpnpd' on 'rac1' succeeded
09.9 CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac1'
10.10 CRS-2676: Start of 'ora.cssdmonitor' on 'rac1' succeeded
11.11 CRS-2672: Attempting to start 'ora.cssd' on 'rac1'
12.12 CRS-2679: Attempting to clean 'ora.diskmon' on 'rac1'
13.13 CRS-2681: Clean of 'ora.diskmon' on 'rac1' succeeded
14.14 CRS-2672: Attempting to start 'ora.diskmon' on 'rac1'
15.15 CRS-2676: Start of 'ora.diskmon' on 'rac1' succeeded
16.16 CRS-2676: Start of 'ora.cssd' on 'rac1' succeeded
17.17 CRS-2672: Attempting to start 'ora.ctssd' on 'rac1'
18.18 CRS-2672: Attempting to start 'ora.drivers.acfs' on 'rac1'
19.19 CRS-2676: Start of 'ora.ctssd' on 'rac1' succeeded
20.20 CRS-2676: Start of 'ora.drivers.acfs' on 'rac1' succeeded
21.21 CRS-2672: Attempting to start 'ora.asm' on 'rac1'
22.22 CRS-2676: Start of 'ora.asm' on 'rac1' succeeded
23.23 CRS-2672: Attempting to start 'ora.crsd' on 'rac1'
24.24 CRS-2676: Start of 'ora.crsd' on 'rac1' succeeded
25.25 [root@rac1 bin]#

2.2 RAC1在獨佔模式下時,看看節點RAC2搶佔資源時會發生什麼:

01.1 [root@rac2 bin]# ./crsctl start crs -excl
02.2 CRS-4123: Oracle High Availability Services has been started.
03.3 CRS-2672: Attempting to start 'ora.gipcd' on 'rac2'
04.4 CRS-2672: Attempting to start 'ora.mdnsd' on 'rac2'
05.5 CRS-2676: Start of 'ora.gipcd' on 'rac2' succeeded
06.6 CRS-2676: Start of 'ora.mdnsd' on 'rac2' succeeded
07.7 CRS-2672: Attempting to start 'ora.gpnpd' on 'rac2'
08.8 CRS-2676: Start of 'ora.gpnpd' on 'rac2' succeeded
09.9 CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac2'
10.10 CRS-2676: Start of 'ora.cssdmonitor' on 'rac2' succeeded
11.11 CRS-2672: Attempting to start 'ora.cssd' on 'rac2'
12.12 CRS-2679: Attempting to clean 'ora.diskmon' on 'rac2'
13.13 CRS-2681: Clean of 'ora.diskmon' on 'rac2' succeeded
14.14 CRS-2672: Attempting to start 'ora.diskmon' on 'rac2'
15.15 CRS-2676: Start of 'ora.diskmon' on 'rac2' succeeded
16.16 CRS-4402: The CSS daemon was started in exclusive mode but found an active CSS daemon on node rac1, number 1, and is terminating
17.17 CRS-2674: Start of 'ora.cssd' on 'rac2' failed
18.18 CRS-2679: Attempting to clean 'ora.cssd' on 'rac2'
19.19 CRS-2681: Clean of 'ora.cssd' on 'rac2' succeeded
20.20 CRS-2673: Attempting to stop 'ora.diskmon' on 'rac2'
21.21 CRS-2677: Stop of 'ora.diskmon' on 'rac2' succeeded
22.22 CRS-2673: Attempting to stop 'ora.cssdmonitor' on 'rac2'
23.23 CRS-2677: Stop of 'ora.cssdmonitor' on 'rac2' succeeded
24.24 CRS-2673: Attempting to stop 'ora.gpnpd' on 'rac2'
25.25 CRS-2677: Stop of 'ora.gpnpd' on 'rac2' succeeded
26.26 CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac2'
27.27 CRS-2677: Stop of 'ora.mdnsd' on 'rac2' succeeded
28.28 CRS-2673: Attempting to stop 'ora.gipcd' on 'rac2'
29.29 CRS-2677: Stop of 'ora.gipcd' on 'rac2' succeeded
30.30 CRS-4000: Command Start failed, or completed with errors.
31.31 [root@rac2 bin]#

  出現狀況了(CRS-4402,CRS-2674),現在看看兩個節點的的程式狀況.

2.3 檢視兩個節點此時的程式狀況

01.1 節點RAC1的程式狀態:
02.2 [root@rac1 bin]# ps -ef|grep grid
03.3 root     16810     1  0 00:56 ?        00:00:01 /u01/grid/bin/ohasd.bin exclusive
04.4 grid     16944     1  0 00:56 ?        00:00:00 /u01/grid/bin/oraagent.bin
05.5 grid     16959     1  0 00:56 ?        00:00:00 /u01/grid/bin/gipcd.bin
06.6 grid     16964     1  0 00:56 ?        00:00:00 /u01/grid/bin/mdnsd.bin
07.7 grid     16983     1  0 00:56 ?        00:00:00 /u01/grid/bin/gpnpd.bin
08.8 root     17020     1  0 00:56 ?        00:00:00 /u01/grid/bin/orarootagent.bin
09.9 grid     17640     1  0 01:02 ?        00:00:00 /u01/grid/bin/diskmon.bin -d -f
10.10 root     17708 14498  0 01:06 pts/1    00:00:00 grep grid
11.11 [root@rac1 bin]#
12.12
13.13 節點RAC2的程式狀態:
14.14 [root@rac2 bin]# ps -ef|grep grid
15.15 root      8557     1  0 01:01 ?        00:00:01 /u01/grid/bin/ohasd.bin exclusive
16.16 root      8929  7581  0 01:08 pts/1    00:00:00 grep grid
17.17 [root@rac2 bin]#

  哈哈,在爭奪資源時RAC1,RAC2兩敗俱傷!獨佔模式一般用於資料庫恢復,升級時。

      以非獨佔模式啟動則是去掉 -excl:crsctl start crs

3. crsctl start crs與crsctl start cluster 區別

01.1 啟動命令:crsctl start  cluster
02.2 --[root@rac1 bin]# ./crsctl start  cluster
03.3 CRS-2672: Attempting to start 'ora.cssdmonitor' on 'rac1'
04.4 CRS-2676: Start of 'ora.cssdmonitor' on 'rac1' succeeded
05.5 CRS-2672: Attempting to start 'ora.cssd' on 'rac1'
06.6 CRS-2672: Attempting to start 'ora.diskmon' on 'rac1'
07.7 CRS-2676: Start of 'ora.diskmon' on 'rac1' succeeded
08.8 CRS-2676: Start of 'ora.cssd' on 'rac1' succeeded
09.9 CRS-2672: Attempting to start 'ora.ctssd' on 'rac1'
10.10 CRS-2676: Start of 'ora.ctssd' on 'rac1' succeeded
11.11 CRS-2672: Attempting to start 'ora.asm' on 'rac1'
12.12 CRS-2672: Attempting to start 'ora.evmd' on 'rac1'
13.13 CRS-2676: Start of 'ora.evmd' on 'rac1' succeeded
14.14 CRS-2676: Start of 'ora.asm' on 'rac1' succeeded
15.15 CRS-2672: Attempting to start 'ora.crsd' on 'rac1'
16.16 CRS-2676: Start of 'ora.crsd' on 'rac1' succeeded
17.17 [root@rac1 bin]#

  crsctl start/stop cluster 命令只是控制Start CRS stack(ora.cssdmonitor,ora.cssd,ora.diskmon,ora.ctssd,ora.asm,ora.crsd)。

      使用命令 crsctl start/stop cluster 的前提是OHASD程式已經被啟動

結論:crsctl start/stop crs  管理 CRS 包含程式 OHASD ;

   crsctl start/stop cluster 不包含OHASD程式,必須要先啟動 OHASD 程式才可以使用



轉載地址:

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/27767315/viewspace-2107132/,如需轉載,請註明出處,否則將追究法律責任。

相關文章