Oracle 11gR2 RAC 常用維護操作 說明(轉)
一.啟動和停止叢集
在Oracle 11gR2 下的RAC,架構發生了變化。CRS的資訊也是放在ASM 例項裡的,所以要關asm,必須關閉crs, 如果還使用了acfs的話,一關crs那麼acfs裡的資訊也不能訪問了,所以一般不重啟機器,不輕易關crs, 其他的service可以根據自己的需要去stop/start。
注意:
11g RAC 開啟資源相對比較慢(即使命令後面顯示的資源都start succeeded,透過crs_stat -t檢視都不一定online), 需要耐心並檢視log。
1.1 使用crsctl stop has/crsctl stopcrs
用root使用者,在Oracle11gR2中停止和啟動叢集的命令如下:
#crsctl stop has [-f]
#crsctl start has
注意:
對於crsctl stop has 只有一個可選的引數就是-f,該命令只能停執行該命令伺服器上的HAS.而不能停所有節點上的。所以要把RAC 全部停掉,需要在所有節點執行該命令。
下面的2個命令:使用crs 和 使用has 效果是完全一樣的:
#crsctl stop crs [-f]
#crsctl start crs
示例:
--停止HAS
[root@rac1 bin]# ./crsctl stophas
CRS-2791:Starting shutdown of Oracle High Availability Services-managed resources on'rac1'
CRS-2673:Attempting to stop 'ora.crsd' on 'rac1'
CRS-2790:Starting shutdown of Cluster Ready Services-managed resources on 'rac1'
CRS-2673:Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'rac1'
CRS-2673:Attempting to stop 'ora.OCRVOTING.dg' on 'rac1'
CRS-2673:Attempting to stop 'ora.sdd.db' on 'rac1'
CRS-2673:Attempting to stop 'ora.LISTENER.lsnr' on 'rac1'
CRS-2673:Attempting to stop 'ora.oc4j' on 'rac1'
CRS-2673:Attempting to stop 'ora.cvu' on 'rac1'
CRS-2677: Stopof 'ora.LISTENER_SCAN1.lsnr' on 'rac1' succeeded
CRS-2673:Attempting to stop 'ora.scan1.vip' on 'rac1'
CRS-2677: Stopof 'ora.LISTENER.lsnr' on 'rac1' succeeded
CRS-2673:Attempting to stop 'ora.rac1.vip' on 'rac1'
CRS-2677: Stopof 'ora.rac1.vip' on 'rac1' succeeded
CRS-2672:Attempting to start 'ora.rac1.vip' on 'rac2'
CRS-2677: Stopof 'ora.scan1.vip' on 'rac1' succeeded
CRS-2672:Attempting to start 'ora.scan1.vip' on 'rac2'
CRS-2676:Start of 'ora.scan1.vip' on 'rac2' succeeded
CRS-2676:Start of 'ora.rac1.vip' on 'rac2' succeeded
CRS-2672:Attempting to start 'ora.LISTENER_SCAN1.lsnr' on 'rac2'
CRS-2677: Stopof 'ora.sdd.db' on 'rac1' succeeded
CRS-2673:Attempting to stop 'ora.DATA.dg' on 'rac1'
CRS-2673:Attempting to stop 'ora.FRA.dg' on 'rac1'
CRS-2676:Start of 'ora.LISTENER_SCAN1.lsnr' on 'rac2' succeeded
CRS-2677: Stopof 'ora.FRA.dg' on 'rac1' succeeded
CRS-2677: Stopof 'ora.DATA.dg' on 'rac1' succeeded
CRS-2677: Stopof 'ora.oc4j' on 'rac1' succeeded
CRS-2672:Attempting to start 'ora.oc4j' on 'rac2'
CRS-2677: Stopof 'ora.cvu' on 'rac1' succeeded
CRS-2672:Attempting to start 'ora.cvu' on 'rac2'
CRS-2676:Start of 'ora.cvu' on 'rac2' succeeded
CRS-2677: Stopof 'ora.OCRVOTING.dg' on 'rac1' succeeded
CRS-2673:Attempting to stop 'ora.asm' on 'rac1'
CRS-2677: Stopof 'ora.asm' on 'rac1' succeeded
CRS-2676:Start of 'ora.oc4j' on 'rac2' succeeded
CRS-2673:Attempting to stop 'ora.ons' on 'rac1'
CRS-2677: Stopof 'ora.ons' on 'rac1' succeeded
CRS-2673:Attempting to stop 'ora.net1.network' on 'rac1'
CRS-2677: Stopof 'ora.net1.network' on 'rac1' succeeded
CRS-2792:Shutdown of Cluster Ready Services-managed resources on 'rac1' has completed
CRS-2677: Stopof 'ora.crsd' on 'rac1' succeeded
CRS-2673:Attempting to stop 'ora.mdnsd' on 'rac1'
CRS-2673:Attempting to stop 'ora.ctssd' on 'rac1'
CRS-2673:Attempting to stop 'ora.evmd' on 'rac1'
CRS-2673:Attempting to stop 'ora.asm' on 'rac1'
CRS-2677: Stopof 'ora.evmd' on 'rac1' succeeded
CRS-2677: Stopof 'ora.mdnsd' on 'rac1' succeeded
CRS-2677: Stopof 'ora.ctssd' on 'rac1' succeeded
CRS-2677: Stopof 'ora.asm' on 'rac1' succeeded
CRS-2673:Attempting to stop 'ora.cluster_interconnect.haip' on 'rac1'
CRS-2677: Stopof 'ora.cluster_interconnect.haip' on 'rac1' succeeded
CRS-2673:Attempting to stop 'ora.cssd' on 'rac1'
CRS-2677: Stopof 'ora.cssd' on 'rac1' succeeded
CRS-2673:Attempting to stop 'ora.crf' on 'rac1'
CRS-2677: Stopof 'ora.crf' on 'rac1' succeeded
CRS-2673:Attempting to stop 'ora.gipcd' on 'rac1'
CRS-2677: Stopof 'ora.gipcd' on 'rac1' succeeded
CRS-2673:Attempting to stop 'ora.gpnpd' on 'rac1'
CRS-2677: Stopof 'ora.gpnpd' on 'rac1' succeeded
CRS-2793:Shutdown of Oracle High Availability Services-managed resources on 'rac1' hascompleted
CRS-4133:Oracle High Availability Services has been stopped.
[root@rac1bin]#
注意:
我這裡測試的是Oracle11gR2的環境,我們在節點1上執行該命令,只把節點1上的程式停了,而把相關的資源轉移到我們的節點2上了,因此也證實了我們上面的說的,該命令只爭對當前伺服器有效。
--啟動HAS:
[root@rac1bin]# ./crsctl start has
CRS-4123:Oracle High Availability Services has been started.
[root@rac1bin]#
從上面看只是啟動了HAS。實際上後面會把Oracle Restart 管理的資源都會啟動。這個可以使用crs_stat命令來程式驗證,不過Oracle 11g的程式啟動過程比較慢,需要耐心等待。
[root@rac1u01]# sh crs_stat.sh
Name Target State Host
---------------------------------------- --------- -------
ora.DATA.dg ONLINE ONLINE rac1
ora.FRA.dg ONLINE ONLINE rac1
ora.LISTENER.lsnr ONLINE ONLINE rac1
ora.LISTENER_SCAN1.lsnr ONLINE ONLINE rac2
ora.OCRVOTING.dg ONLINE ONLINE rac1
ora.asm ONLINE ONLINE rac1
ora.cvu ONLINE ONLINE rac2
ora.gsd OFFLINE OFFLINE
ora.net1.network ONLINE ONLINE rac1
ora.oc4j ONLINE ONLINE rac2
ora.ons ONLINE ONLINE rac1
ora.rac1.ASM1.asm ONLINE ONLINE rac1
ora.rac1.LISTENER_RAC1.lsnr ONLINE ONLINE rac1
ora.rac1.gsd OFFLINE OFFLINE
ora.rac1.ons ONLINE ONLINE rac1
ora.rac1.vip ONLINE ONLINE rac1
ora.rac2.ASM2.asm ONLINE ONLINE rac2
ora.rac2.LISTENER_RAC2.lsnr ONLINE ONLINE rac2
ora.rac2.gsd OFFLINE OFFLINE
ora.rac2.ons ONLINE ONLINE rac2
ora.rac2.vip ONLINE ONLINE rac2
ora.scan1.vip ONLINE ONLINE rac2
ora.sdd.db &n, bsp; ONLINE ONLINE rac2
1.2 使用crsctl stop cluster [-all]…
該命令的語法如下:
crsctl stop cluster [[-all]|[-n[...]]] [-f]
crsctl start cluster [[-all]|[-n[...]]]
與1.1 節最大的不同,該引數支援的選項更多,可以同時操控所有的節點。如果不指定引數,那麼只對當前節點有效。
如:
[root@rac1 ~]# ./crsctl start cluster -n rac1 rac2
--停止當前節點叢集:
[root@rac1 bin]# ./crsctl stop cluster
CRS-2673: Attempting to stop 'ora.crsd' on'rac1'
CRS-2790: Starting shutdown of ClusterReady Services-managed resources on 'rac1'
CRS-2673: Attempting to stop'ora.LISTENER.lsnr' on 'rac1'
CRS-2673: Attempting to stop'ora.OCRVOTING.dg' on 'rac1'
CRS-2673: Attempting to stop 'ora.sdd.db'on 'rac1'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on'rac1' succeeded
CRS-2673: Attempting to stop 'ora.rac1.vip'on 'rac1'
CRS-2677: Stop of 'ora.rac1.vip' on 'rac1'succeeded
CRS-2672: Attempting to start'ora.rac1.vip' on 'rac2'
CRS-2677: Stop of 'ora.sdd.db' on 'rac1'succeeded
CRS-2673: Attempting to stop 'ora.DATA.dg'on 'rac1'
CRS-2673: Attempting to stop 'ora.FRA.dg'on 'rac1'
CRS-2676: Start of 'ora.rac1.vip' on 'rac2'succeeded
CRS-2677: Stop of 'ora.FRA.dg' on 'rac1'succeeded
CRS-2677: Stop of 'ora.DATA.dg' on 'rac1'succeeded
CRS-2677: Stop of 'ora.OCRVOTING.dg' on'rac1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on'rac1'
CRS-2677: Stop of 'ora.asm' on 'rac1'succeeded
CRS-2673: Attempting to stop 'ora.ons' on'rac1'
CRS-2677: Stop of 'ora.ons' on 'rac1'succeeded
CRS-2673: Attempting to stop'ora.net1.network' on 'rac1'
CRS-2677: Stop of 'ora.net1.network' on'rac1' succeeded
CRS-2792: Shutdown of Cluster ReadyServices-managed resources on 'rac1' has completed
CRS-2677: Stop of 'ora.crsd' on 'rac1'succeeded
CRS-2673: Attempting to stop 'ora.ctssd' on'rac1'
CRS-2673: Attempting to stop 'ora.evmd' on'rac1'
CRS-2673: Attempting to stop 'ora.asm' on'rac1'
CRS-2677: Stop of 'ora.evmd' on 'rac1'succeeded
CRS-2677: Stop of 'ora.ctssd' on 'rac1'succeeded
CRS-2677: Stop of 'ora.asm' on 'rac1'succeeded
CRS-2673: Attempting to stop'ora.cluster_interconnect.haip' on 'rac1'
CRS-2677: Stop of'ora.cluster_interconnect.haip' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on'rac1'
CRS-2677: Stop of 'ora.cssd' on 'rac1'succeeded
[root@rac1 bin]#
這裡只停了節點1,相關程式全飄到節點2了,如下:
[root@rac2 u01]# sh crs_stat.sh
Name Target State Host
------------------------------ ------------------- -------
ora.DATA.dg ONLINE ONLINE rac2
ora.FRA.dg ONLINE ONLINE rac2
ora.LISTENER.lsnr ONLINE ONLINE rac2
ora.LISTENER_SCAN1.lsnr ONLINE ONLINE rac2
ora.OCRVOTING.dg ONLINE ONLINE rac2
ora.asm ONLINE ONLINE rac2
ora.cvu ONLINE ONLINE rac2
ora.gsd OFFLINE OFFLINE
ora.net1.network ONLINE ONLINE rac2
ora.oc4j ONLINE ONLINE rac2
ora.ons ONLINE ONLINE rac2
ora.rac1.ASM1.asm ONLINE OFFLINE
ora.rac1.LISTENER_RAC1.lsnr ONLINE OFFLINE
ora.rac1.gsd OFFLINE OFFLINE
ora.rac1.ons ONLINE OFFLINE
ora.rac1.vip ONLINE ONLINE rac2
ora.rac2.ASM2.asm ONLINE ONLINE rac2
ora.rac2.LISTENER_RAC2.lsnr ONLINE ONLINE rac2
ora.rac2.gsd OFFLINE OFFLINE
ora.rac2.ons ONLINE ONLINE rac2
ora.rac2.vip ONLINE ONLINE rac2
ora.scan1.vip ONLINE ONLINE rac2
ora.sdd.db ONLINE ONLINE rac2
--啟用當前節點:
[root@rac1 bin]#./crsctl start cluster
CRS-2672: Attempting to start'ora.cssdmonitor' on 'rac1'
CRS-2676: Start of 'ora.cssdmonitor' on'rac1' succeeded
CRS-2672: Attempting to start 'ora.cssd' on'rac1'
CRS-2672: Attempting to start 'ora.diskmon'on 'rac1'
CRS-2676: Start of 'ora.diskmon' on 'rac1'succeeded
CRS-2676: Start of 'ora.cssd' on 'rac1'succeeded
CRS-2672: Attempting to start 'ora.ctssd'on 'rac1'
CRS-2672: Attempting to start'ora.cluster_interconnect.haip' on 'rac1'
CRS-2676: Start of 'ora.ctssd' on 'rac1'succeeded
CRS-2672: Attempting to start 'ora.evmd' on'rac1'
CRS-2676: Start of 'ora.evmd' on 'rac1'succeeded
CRS-2676: Start of'ora.cluster_interconnect.haip' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.asm' on'rac1'
CRS-2676: Start of 'ora.asm' on 'rac1'succeeded
CRS-2672: Attempting to start 'ora.crsd' on'rac1'
CRS-2676: Start of 'ora.crsd' on 'rac1'succeeded
[root@rac1 bin]#
1.3 檢查叢集的狀態
--簡單的輸出:
[root@rac1 bin]# ./crsctl check cluster
[root@rac1 bin]# ./crsctl check crs
--詳細的資訊:
# crs_stat -t
使用crsctl check crs命令,如下:
[root@rac1 bin]# ./crsctl check crs
CRS-4638: Oracle High Availability Servicesis online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Servicesis online
CRS-4533: Event Manager is online
[root@rac1 bin]# ./crsctl check cluster
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Servicesis online
CRS-4533: Event Manager is online
二.停止和啟動Resource
在第一節中,看到直接停止叢集,相關的Resource 也會被停止。 但一些實際情況下,我們操作更多的是對某些資源的操作。具體就是使用SRVCTL 命令
1.1. 官網說明
SRVCTL Command Reference for Oracle Restart
檢視命令幫助:
Srvclt –h
這個命令顯示的結果太長,不好檢視,可以進一步的檢視幫助:
--使用-h:
[grid@rac1 ~]$ srvctl start -h
The SRVCTL start command starts, OracleClusterware enabled, non-running objects.
Usage: srvctl start database -d [-o ] [-n ]
Usage: srvctl start instance -d{-n [-i ] | -i } [-o]
Usage: srvctl start service -d [-s "" [-n | -i ] ] [-o ]
Usage: srvctl start nodeapps [-n][-g] [-v]
Usage: srvctl start vip { -n | -i } [-v]
Usage: srvctl start asm [-n] [-o ]
Usage: srvctl start listener [-l] [-n ]
Usage: srvctl start scan [-i] [-n ]
Usage: srvctl start scan_listener [-n] [-i ]
Usage: srvctl start oc4j [-v]
Usage: srvctl start home -o -s -n
Usage: srvctl start filesystem -d [-n ]
Usage: srvctl start diskgroup -g [-n ""]
Usage: srvctl start gns [-l] [-n ] [-v]
Usage: srvctl start cvu [-n]
For detailed help on each command andobject and its options use:
srvctl
在Oracle 11gR2 下的RAC,架構發生了變化。CRS的資訊也是放在ASM 例項裡的,所以要關asm,必須關閉crs, 如果還使用了acfs的話,一關crs那麼acfs裡的資訊也不能訪問了,所以一般不重啟機器,不輕易關crs, 其他的service可以根據自己的需要去stop/start。
注意:
11g RAC 開啟資源相對比較慢(即使命令後面顯示的資源都start succeeded,透過crs_stat -t檢視都不一定online), 需要耐心並檢視log。
1.1 使用crsctl stop has/crsctl stopcrs
用root使用者,在Oracle11gR2中停止和啟動叢集的命令如下:
#crsctl stop has [-f]
#crsctl start has
注意:
對於crsctl stop has 只有一個可選的引數就是-f,該命令只能停執行該命令伺服器上的HAS.而不能停所有節點上的。所以要把RAC 全部停掉,需要在所有節點執行該命令。
下面的2個命令:使用crs 和 使用has 效果是完全一樣的:
#crsctl stop crs [-f]
#crsctl start crs
示例:
--停止HAS
[root@rac1 bin]# ./crsctl stophas
CRS-2791:Starting shutdown of Oracle High Availability Services-managed resources on'rac1'
CRS-2673:Attempting to stop 'ora.crsd' on 'rac1'
CRS-2790:Starting shutdown of Cluster Ready Services-managed resources on 'rac1'
CRS-2673:Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'rac1'
CRS-2673:Attempting to stop 'ora.OCRVOTING.dg' on 'rac1'
CRS-2673:Attempting to stop 'ora.sdd.db' on 'rac1'
CRS-2673:Attempting to stop 'ora.LISTENER.lsnr' on 'rac1'
CRS-2673:Attempting to stop 'ora.oc4j' on 'rac1'
CRS-2673:Attempting to stop 'ora.cvu' on 'rac1'
CRS-2677: Stopof 'ora.LISTENER_SCAN1.lsnr' on 'rac1' succeeded
CRS-2673:Attempting to stop 'ora.scan1.vip' on 'rac1'
CRS-2677: Stopof 'ora.LISTENER.lsnr' on 'rac1' succeeded
CRS-2673:Attempting to stop 'ora.rac1.vip' on 'rac1'
CRS-2677: Stopof 'ora.rac1.vip' on 'rac1' succeeded
CRS-2672:Attempting to start 'ora.rac1.vip' on 'rac2'
CRS-2677: Stopof 'ora.scan1.vip' on 'rac1' succeeded
CRS-2672:Attempting to start 'ora.scan1.vip' on 'rac2'
CRS-2676:Start of 'ora.scan1.vip' on 'rac2' succeeded
CRS-2676:Start of 'ora.rac1.vip' on 'rac2' succeeded
CRS-2672:Attempting to start 'ora.LISTENER_SCAN1.lsnr' on 'rac2'
CRS-2677: Stopof 'ora.sdd.db' on 'rac1' succeeded
CRS-2673:Attempting to stop 'ora.DATA.dg' on 'rac1'
CRS-2673:Attempting to stop 'ora.FRA.dg' on 'rac1'
CRS-2676:Start of 'ora.LISTENER_SCAN1.lsnr' on 'rac2' succeeded
CRS-2677: Stopof 'ora.FRA.dg' on 'rac1' succeeded
CRS-2677: Stopof 'ora.DATA.dg' on 'rac1' succeeded
CRS-2677: Stopof 'ora.oc4j' on 'rac1' succeeded
CRS-2672:Attempting to start 'ora.oc4j' on 'rac2'
CRS-2677: Stopof 'ora.cvu' on 'rac1' succeeded
CRS-2672:Attempting to start 'ora.cvu' on 'rac2'
CRS-2676:Start of 'ora.cvu' on 'rac2' succeeded
CRS-2677: Stopof 'ora.OCRVOTING.dg' on 'rac1' succeeded
CRS-2673:Attempting to stop 'ora.asm' on 'rac1'
CRS-2677: Stopof 'ora.asm' on 'rac1' succeeded
CRS-2676:Start of 'ora.oc4j' on 'rac2' succeeded
CRS-2673:Attempting to stop 'ora.ons' on 'rac1'
CRS-2677: Stopof 'ora.ons' on 'rac1' succeeded
CRS-2673:Attempting to stop 'ora.net1.network' on 'rac1'
CRS-2677: Stopof 'ora.net1.network' on 'rac1' succeeded
CRS-2792:Shutdown of Cluster Ready Services-managed resources on 'rac1' has completed
CRS-2677: Stopof 'ora.crsd' on 'rac1' succeeded
CRS-2673:Attempting to stop 'ora.mdnsd' on 'rac1'
CRS-2673:Attempting to stop 'ora.ctssd' on 'rac1'
CRS-2673:Attempting to stop 'ora.evmd' on 'rac1'
CRS-2673:Attempting to stop 'ora.asm' on 'rac1'
CRS-2677: Stopof 'ora.evmd' on 'rac1' succeeded
CRS-2677: Stopof 'ora.mdnsd' on 'rac1' succeeded
CRS-2677: Stopof 'ora.ctssd' on 'rac1' succeeded
CRS-2677: Stopof 'ora.asm' on 'rac1' succeeded
CRS-2673:Attempting to stop 'ora.cluster_interconnect.haip' on 'rac1'
CRS-2677: Stopof 'ora.cluster_interconnect.haip' on 'rac1' succeeded
CRS-2673:Attempting to stop 'ora.cssd' on 'rac1'
CRS-2677: Stopof 'ora.cssd' on 'rac1' succeeded
CRS-2673:Attempting to stop 'ora.crf' on 'rac1'
CRS-2677: Stopof 'ora.crf' on 'rac1' succeeded
CRS-2673:Attempting to stop 'ora.gipcd' on 'rac1'
CRS-2677: Stopof 'ora.gipcd' on 'rac1' succeeded
CRS-2673:Attempting to stop 'ora.gpnpd' on 'rac1'
CRS-2677: Stopof 'ora.gpnpd' on 'rac1' succeeded
CRS-2793:Shutdown of Oracle High Availability Services-managed resources on 'rac1' hascompleted
CRS-4133:Oracle High Availability Services has been stopped.
[root@rac1bin]#
注意:
我這裡測試的是Oracle11gR2的環境,我們在節點1上執行該命令,只把節點1上的程式停了,而把相關的資源轉移到我們的節點2上了,因此也證實了我們上面的說的,該命令只爭對當前伺服器有效。
--啟動HAS:
[root@rac1bin]# ./crsctl start has
CRS-4123:Oracle High Availability Services has been started.
[root@rac1bin]#
從上面看只是啟動了HAS。實際上後面會把Oracle Restart 管理的資源都會啟動。這個可以使用crs_stat命令來程式驗證,不過Oracle 11g的程式啟動過程比較慢,需要耐心等待。
[root@rac1u01]# sh crs_stat.sh
Name Target State Host
---------------------------------------- --------- -------
ora.DATA.dg ONLINE ONLINE rac1
ora.FRA.dg ONLINE ONLINE rac1
ora.LISTENER.lsnr ONLINE ONLINE rac1
ora.LISTENER_SCAN1.lsnr ONLINE ONLINE rac2
ora.OCRVOTING.dg ONLINE ONLINE rac1
ora.asm ONLINE ONLINE rac1
ora.cvu ONLINE ONLINE rac2
ora.gsd OFFLINE OFFLINE
ora.net1.network ONLINE ONLINE rac1
ora.oc4j ONLINE ONLINE rac2
ora.ons ONLINE ONLINE rac1
ora.rac1.ASM1.asm ONLINE ONLINE rac1
ora.rac1.LISTENER_RAC1.lsnr ONLINE ONLINE rac1
ora.rac1.gsd OFFLINE OFFLINE
ora.rac1.ons ONLINE ONLINE rac1
ora.rac1.vip ONLINE ONLINE rac1
ora.rac2.ASM2.asm ONLINE ONLINE rac2
ora.rac2.LISTENER_RAC2.lsnr ONLINE ONLINE rac2
ora.rac2.gsd OFFLINE OFFLINE
ora.rac2.ons ONLINE ONLINE rac2
ora.rac2.vip ONLINE ONLINE rac2
ora.scan1.vip ONLINE ONLINE rac2
ora.sdd.db &n, bsp; ONLINE ONLINE rac2
1.2 使用crsctl stop cluster [-all]…
該命令的語法如下:
crsctl stop cluster [[-all]|[-n
crsctl start cluster [[-all]|[-n
與1.1 節最大的不同,該引數支援的選項更多,可以同時操控所有的節點。如果不指定引數,那麼只對當前節點有效。
如:
[root@rac1 ~]# ./crsctl start cluster -n rac1 rac2
--停止當前節點叢集:
[root@rac1 bin]# ./crsctl stop cluster
CRS-2673: Attempting to stop 'ora.crsd' on'rac1'
CRS-2790: Starting shutdown of ClusterReady Services-managed resources on 'rac1'
CRS-2673: Attempting to stop'ora.LISTENER.lsnr' on 'rac1'
CRS-2673: Attempting to stop'ora.OCRVOTING.dg' on 'rac1'
CRS-2673: Attempting to stop 'ora.sdd.db'on 'rac1'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on'rac1' succeeded
CRS-2673: Attempting to stop 'ora.rac1.vip'on 'rac1'
CRS-2677: Stop of 'ora.rac1.vip' on 'rac1'succeeded
CRS-2672: Attempting to start'ora.rac1.vip' on 'rac2'
CRS-2677: Stop of 'ora.sdd.db' on 'rac1'succeeded
CRS-2673: Attempting to stop 'ora.DATA.dg'on 'rac1'
CRS-2673: Attempting to stop 'ora.FRA.dg'on 'rac1'
CRS-2676: Start of 'ora.rac1.vip' on 'rac2'succeeded
CRS-2677: Stop of 'ora.FRA.dg' on 'rac1'succeeded
CRS-2677: Stop of 'ora.DATA.dg' on 'rac1'succeeded
CRS-2677: Stop of 'ora.OCRVOTING.dg' on'rac1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on'rac1'
CRS-2677: Stop of 'ora.asm' on 'rac1'succeeded
CRS-2673: Attempting to stop 'ora.ons' on'rac1'
CRS-2677: Stop of 'ora.ons' on 'rac1'succeeded
CRS-2673: Attempting to stop'ora.net1.network' on 'rac1'
CRS-2677: Stop of 'ora.net1.network' on'rac1' succeeded
CRS-2792: Shutdown of Cluster ReadyServices-managed resources on 'rac1' has completed
CRS-2677: Stop of 'ora.crsd' on 'rac1'succeeded
CRS-2673: Attempting to stop 'ora.ctssd' on'rac1'
CRS-2673: Attempting to stop 'ora.evmd' on'rac1'
CRS-2673: Attempting to stop 'ora.asm' on'rac1'
CRS-2677: Stop of 'ora.evmd' on 'rac1'succeeded
CRS-2677: Stop of 'ora.ctssd' on 'rac1'succeeded
CRS-2677: Stop of 'ora.asm' on 'rac1'succeeded
CRS-2673: Attempting to stop'ora.cluster_interconnect.haip' on 'rac1'
CRS-2677: Stop of'ora.cluster_interconnect.haip' on 'rac1' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on'rac1'
CRS-2677: Stop of 'ora.cssd' on 'rac1'succeeded
[root@rac1 bin]#
這裡只停了節點1,相關程式全飄到節點2了,如下:
[root@rac2 u01]# sh crs_stat.sh
Name Target State Host
------------------------------ ------------------- -------
ora.DATA.dg ONLINE ONLINE rac2
ora.FRA.dg ONLINE ONLINE rac2
ora.LISTENER.lsnr ONLINE ONLINE rac2
ora.LISTENER_SCAN1.lsnr ONLINE ONLINE rac2
ora.OCRVOTING.dg ONLINE ONLINE rac2
ora.asm ONLINE ONLINE rac2
ora.cvu ONLINE ONLINE rac2
ora.gsd OFFLINE OFFLINE
ora.net1.network ONLINE ONLINE rac2
ora.oc4j ONLINE ONLINE rac2
ora.ons ONLINE ONLINE rac2
ora.rac1.ASM1.asm ONLINE OFFLINE
ora.rac1.LISTENER_RAC1.lsnr ONLINE OFFLINE
ora.rac1.gsd OFFLINE OFFLINE
ora.rac1.ons ONLINE OFFLINE
ora.rac1.vip ONLINE ONLINE rac2
ora.rac2.ASM2.asm ONLINE ONLINE rac2
ora.rac2.LISTENER_RAC2.lsnr ONLINE ONLINE rac2
ora.rac2.gsd OFFLINE OFFLINE
ora.rac2.ons ONLINE ONLINE rac2
ora.rac2.vip ONLINE ONLINE rac2
ora.scan1.vip ONLINE ONLINE rac2
ora.sdd.db ONLINE ONLINE rac2
--啟用當前節點:
[root@rac1 bin]#./crsctl start cluster
CRS-2672: Attempting to start'ora.cssdmonitor' on 'rac1'
CRS-2676: Start of 'ora.cssdmonitor' on'rac1' succeeded
CRS-2672: Attempting to start 'ora.cssd' on'rac1'
CRS-2672: Attempting to start 'ora.diskmon'on 'rac1'
CRS-2676: Start of 'ora.diskmon' on 'rac1'succeeded
CRS-2676: Start of 'ora.cssd' on 'rac1'succeeded
CRS-2672: Attempting to start 'ora.ctssd'on 'rac1'
CRS-2672: Attempting to start'ora.cluster_interconnect.haip' on 'rac1'
CRS-2676: Start of 'ora.ctssd' on 'rac1'succeeded
CRS-2672: Attempting to start 'ora.evmd' on'rac1'
CRS-2676: Start of 'ora.evmd' on 'rac1'succeeded
CRS-2676: Start of'ora.cluster_interconnect.haip' on 'rac1' succeeded
CRS-2672: Attempting to start 'ora.asm' on'rac1'
CRS-2676: Start of 'ora.asm' on 'rac1'succeeded
CRS-2672: Attempting to start 'ora.crsd' on'rac1'
CRS-2676: Start of 'ora.crsd' on 'rac1'succeeded
[root@rac1 bin]#
1.3 檢查叢集的狀態
--簡單的輸出:
[root@rac1 bin]# ./crsctl check cluster
[root@rac1 bin]# ./crsctl check crs
--詳細的資訊:
# crs_stat -t
使用crsctl check crs命令,如下:
[root@rac1 bin]# ./crsctl check crs
CRS-4638: Oracle High Availability Servicesis online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Servicesis online
CRS-4533: Event Manager is online
[root@rac1 bin]# ./crsctl check cluster
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Servicesis online
CRS-4533: Event Manager is online
二.停止和啟動Resource
在第一節中,看到直接停止叢集,相關的Resource 也會被停止。 但一些實際情況下,我們操作更多的是對某些資源的操作。具體就是使用SRVCTL 命令
1.1. 官網說明
SRVCTL Command Reference for Oracle Restart
檢視命令幫助:
Srvclt –h
這個命令顯示的結果太長,不好檢視,可以進一步的檢視幫助:
--使用-h:
[grid@rac1 ~]$ srvctl start -h
The SRVCTL start command starts, OracleClusterware enabled, non-running objects.
Usage: srvctl start database -d
Usage: srvctl start instance -d
Usage: srvctl start service -d
Usage: srvctl start nodeapps [-n
Usage: srvctl start vip { -n
Usage: srvctl start asm [-n
Usage: srvctl start listener [-l
Usage: srvctl start scan [-i
Usage: srvctl start scan_listener [-n
Usage: srvctl start oc4j [-v]
Usage: srvctl start home -o
Usage: srvctl start filesystem -d
Usage: srvctl start diskgroup -g
Usage: srvctl start gns [-l
Usage: srvctl start cvu [-n
For detailed help on each command andobject and its options use:
srvctl
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/500314/viewspace-1063641/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Oracle 11gR2 RAC 常用維護操作 說明Oracle
- Oracle 10g RAC 常用維護操作 說明Oracle 10g
- Oracle 11gR2 RAC 常用維護操作Oracle
- Oracle11g RAC常用操作 (維護及管理)Oracle
- 【轉載】Oracle RAC 常用維護工具和命令Oracle
- Oracle data guard常用維護操作命令(轉)Oracle
- Oracle RAC 常用維護工具和命令Oracle
- Oracle RAC系列之:ASM基本操作維護OracleASM
- 【轉】Oracle RAC日常基本維護命令Oracle
- oracle dg 維護常用操作和調優Oracle
- AIX常用維護操作AI
- Oracle RAC 日常維護Oracle
- Oracle RAC維護命令Oracle
- rac常用維護工具和命令
- Oracle RAC系列之:ASM基本操作維護(經典)OracleASM
- Oracle RAC中Srvctl命令詳細說明(轉)Oracle
- 轉貼:Oracle維護常用SQL語句OracleSQL
- oracle 維護常用SQLOracleSQL
- Oracle RAC Past Image(PI) 說明OracleAST
- oracle rac管理維護筆記_轉自網友Oracle筆記
- Standby資料庫常用操作說明資料庫
- oracle常用維護查詢Oracle
- Oracle RAC維護命令集Oracle
- Oracle RAC日常基本維護命令Oracle
- ORACLE DG 日常維護常用SQLOracleSQL
- Oracle維護常用SQL語句OracleSQL
- Emacs簡易操作說明(轉)Mac
- 【NETWORK】Oracle RAC 心跳地址配置說明Oracle
- oracle 常用檢視 簡短說明Oracle
- (轉)Oracle Logminer 說明Oracle
- 【ORACLE】Oracle常用SQL及重點功能說明OracleSQL
- 資料庫維護常用操作命令1-表操作資料庫
- RAC維護命令
- RAC維護工具
- 【PDB】Oracle pdb維護常用sql命令OracleSQL
- Oracle常用維護語句總結Oracle
- 轉:維護常用SQL語句收集!SQL
- 常用埠說明