叢集層
這一層的管理命令包括crsctl、ocrcheck、ocrdump、ocrconfig,其中後3個命令是針對OCR磁碟的。
CRSCTL:
crsctl是一個命令列工具,用於管理Oracle Clusterware daemons(何謂daemon,又名守護進程、後台進程,名稱以字母d結尾)。這些daemon包括Cluster Synchronization Services (CSS), Cluster-Ready Services (CRS), and Event Manager (EVM)。
查看crsctl的help:
[oracle@node1 bin]$ ./crsctlUsage: crsctl check crs - checks the viability of the CRS stack crsctl check cssd - checks the viability of CSS crsctl check crsd - checks the viability of CRS crsctl check evmd - checks the viability of EVM crsctl set css <parameter> <value> - sets a parameter override crsctl get css <parameter> - gets the value of a CSS parameter crsctl unset css <parameter> - sets CSS parameter to its default crsctl query css votedisk - lists the voting disks used by CSS crsctl add css votedisk <path> - adds a new voting disk crsctl delete css votedisk <path> - removes a voting disk crsctl enable crs - enables startup for all CRS daemons crsctl disable crs - disables startup for all CRS daemons crsctl start crs - starts all CRS daemons. crsctl stop crs - stops all CRS daemons. Stops CRS resources in case of cluster. crsctl start resources - starts CRS resources. crsctl stop resources - stops CRS resources. crsctl debug statedump evm - dumps state info for evm objects crsctl debug statedump crs - dumps state info for crs objects crsctl debug statedump css - dumps state info for css objects crsctl debug log css [module:level]{,module:level} ... - Turns on debugging for CSS crsctl debug trace css - dumps CSS in-memory tracing cache crsctl debug log crs [module:level]{,module:level} ... - Turns on debugging for CRS crsctl debug trace crs - dumps CRS in-memory tracing cache crsctl debug log evm [module:level]{,module:level} ... - Turns on debugging for EVM crsctl debug trace evm - dumps EVM in-memory tracing cache crsctl debug log res <resname:level> turns on debugging for resources crsctl query crs softwareversion [<nodename>] - lists the version of CRS software installed crsctl query crs activeversion - lists the CRS software operating version crsctl lsmodules css - lists the CSS modules that can be used for debugging crsctl lsmodules crs - lists the CRS modules that can be used for debugging crsctl lsmodules evm - lists the EVM modules that can be used for debugging If necesary any of these commands can be run with additional tracing by adding a "trace" argument at the very front. Example: crsctl trace check css
使用樣本:
檢查crs狀態[oracle@node1 bin]$ ./crsctl check crsCSS appears healthyCRS appears healthyEVM appears healthy檢查單個狀態 [oracle@node1 bin]$ ./crsctl check cssdCSS appears healthy[oracle@node1 bin]$ ./crsctl check crsdCRS appears healthy[oracle@node1 bin]$ ./crsctl check evmdEVM appears healthy啟動crs棧,必須使用root使用者# ./crsctl start crsAttempting to start CRS stack The CRS stack will be started shortly 停止crs棧,必須使用root使用者:# ./crsctl stop crs Stopping resources. Successfully stopped CRS resources Stopping CSSD. Shutting down CSS daemon. Shutdown request successfully issued.配置crs進程棧是否隨著作業系統的啟動而自啟動,有時出於維護目的需要關閉這個特性,可以用root使用者執行下面命令。 # ./crsctl disable crs # ./crsctl enable crs 這個命令實際是修改了/etc/oracle/scls_scr/node1/root/crsstart這個檔案裡的內容。查看votedisk磁碟位置:[oracle@node1 bin]$ ./crsctl query css votedisk 0. 0 /dev/raw/raw2located 1 votedisk(s).[oracle@node1 bin]$
以下兩個測試具有一定的破壞力,沒有測試 (*^__^*)
--增加votedisk:--# ./crsctl add css votedisk /dev/raw/raw3 -force--Now formatting voting disk: /dev/raw/raw3--successful addition of votedisk /dev/raw/raw3. --刪除votedisk:--# ./crsctl delete css votedisk /dev/raw/raw4 -force--successful deletion of votedisk /dev/raw/raw4.
查看crs參數[oracle@node1 bin]$ ./crsctl get css misscount60[oracle@node1 bin]$ 修改crs參數,必須為root使用者# ./crsctl set css miscount 60
CRS由CRS,CSS,EVM三個服務組成,每個服務又是由一系列module組成,crsctl允許對每個module進行跟蹤,並把跟蹤內容記錄到日誌中。
查看3個服務各自的模組列表分別如下:
[oracle@node1 bin]$ crsctl lsmodules cssThe following are the CSS modules :: CSSD COMMCRS COMMNS[oracle@node1 bin]$ crsctl lsmodules evmThe following are the EVM modules :: EVMD EVMDMAIN EVMCOMM EVMEVT EVMAPP EVMAGENT CRSOCR CLUCLS CSSCLNT COMMCRS COMMNS[oracle@node1 bin]$ crsctl lsmodules crsThe following are the CRS modules :: CRSUI CRSCOMM CRSRTI CRSMAIN CRSPLACE CRSAPP CRSRES CRSCOMM CRSOCR CRSTIMER CRSEVT CRSD CLUCLS CSSCLNT COMMCRS COMMNS[oracle@node1 bin]$
跟蹤CSSD模組,需要root使用者執行:
# ./crsctl debug log css "CSSD:1"Configuration parameter trace is now set to 1.Set CRSD Debug Module: CSSD Level: 1
查看追蹤記錄檔:
查看追蹤記錄檔 # pwd /opt/ora10g/product/10.2.0/crs_1/log/node1/cssd[oracle@node1 cssd]$ tail -200 ocssd.log|more[ CSSD]2013-06-14 22:00:32.520 [86608784] >TRACE: clssgmClientConnectMsg: Connect from con(0x92eb648) proc(0x92ebb80) pid() proto(10:2:1:1)[ CSSD]2013-06-14 22:00:43.422 [86608784] >TRACE: clssgmClientConnectMsg: Connect from con(0x92eecb8) proc(0x92f0960) pid() proto(10:2:1:1)[ CSSD]2013-06-14 22:00:48.849 [86608784] >TRACE: clssgmClientConnectMsg: Connect from con(0x92f15d0) proc(0x92f3278) pid() proto(10:2:1:1)[ CSSD]2013-06-14 22:00:51.508 [86608784] >TRACE: clssgmClientConnectMsg: Connect from con(0x92c6af8) proc(0x92ea288) pid() proto(10:2:1:1)[ CSSD]2013-06-14 22:01:05.039 [86608784] >TRACE: clssgmClientConnectMsg: Connect from con(0x92c6a70) proc(0x92eb1f8) pid() proto(10:2:1:1)
-- 整理自《大話 oracle rac》