crsctl工具

yangtingkun發表於2010-09-12

OracleRAC環境工具crsctl用來管理cluster的啟動和關閉。

 

 

RAC環境啟動當前節點的CLUSTER以及資料庫,預設情況下是呼叫/etc/init.d/init.crs start命令,除了手工執行這個指令碼外,還可以利用crsctl命令來啟動活關閉CLUSTER,而且這個命令的功能還不僅限於此。

利用crsctl check命令可以檢查各個元件的執行狀況:

bash-2.03$ crsctl check crs
CSS appears healthy
CRS appears healthy
EVM appears healthy

利用crsctl query可以查詢VOTE盤路徑以及CLUSTER的版本資訊:

bash-2.03$ crsctl query css votedisk
 0.     0    /dev/rac/vot

located 1 votedisk(s).
bash-2.03$ crsctl query crs softwareversion
CRS software version on node [racnode2] is [10.2.0.4.0]
bash-2.03$ crsctl query crs activeversion
CRS active version on the cluster is [10.2.0.4.0]

利用crsctl lksmodules可以檢查自模組資訊:

bash-2.03$ crsctl lsmodules crs
The following are the CRS modules ::
    CRSUI
    CRSCOMM
    CRSRTI
    CRSMAIN
    CRSPLACE
    CRSAPP
    CRSRES
    CRSCOMM
    CRSOCR
    CRSTIMER
    CRSEVT
    CRSD
    CLUCLS
    CLSVER
    CSSCLNT
    COMMCRS
    COMMNS
bash-2.03$ crsctl lsmodules css
The following are the CSS modules ::
    CSSD
    COMMCRS
    COMMNS
bash-2.03$ crsctl lsmodules evm
The following are the EVM modules ::
   EVMD
   EVMDMAIN
   EVMCOMM
   EVMEVT
   EVMAPP
   EVMAGENT
   CRSOCR
   CLUCLS
   CSSCLNT
   COMMCRS
   COMMNS

利用crsctl start啟動節點,利用crsctl stop關閉節點:

bash-2.03$ su -  
Password:
Sun Microsystems Inc.   SunOS 5.8       Generic Patch   October 2001
You have new mail.
# /data/oracle/product/10.2/crs/bin/crsctl stop crs
Stopping resources. This could take several minutes.
Successfully stopped CRS resources.
Stopping CSSD.
Shutting down CSS daemon.
Shutdown request successfully issued.
# ps -ef|grep ora
    root 16247 15215  0 19:40:14 pts/1    0:00 grep ora
  oracle   461   459  0 15:16:28 pts/1    0:00 -sh
  oracle  1508   461  0 15:18:07 pts/1    0:00 bash
# /data/oracle/product/10.2/crs/bin/crsctl start crs
Attempting to start CRS stack
The CRS stack will be started shortly
# ps -ef|grep ora
  oracle 16905 16482  0 19:40:54 ?        0:00 /data/oracle/product/10.2/crs/bin/evmlogger.bin -o /data/oracle/product/10.2/cr
    root 16687 16556  0 19:40:40 ?        0:00 /data/oracle/product/10.2/crs/bin/oprocd.bin run -t 1000 -m 500 -f
  oracle 17091     1  0 19:41:04 ?        0:00 ora_lms1_testrac2
  oracle 17069     1  0 19:41:04 ?        0:00 ora_pmon_testrac2
  oracle 16714 16578  0 19:40:40 ?        0:00 sh -c /bin/sh -c 'cd /data/oracle/product/10.2/crs/log/racnode2/cssd/oclsomon;
  oracle 16788 16601  0 19:40:42 ?        0:01 /data/oracle/product/10.2/crs/bin/ocssd.bin
  oracle 16481 15575  0 19:40:38 ?        0:00 sh -c sh -c 'ulimit -c unlimited; cd /data/oracle/product/10.2/crs/log/racnode2
  oracle 16716 16715  0 19:40:40 ?        0:00 /data/oracle/product/10.2/crs/bin/oclsomon.bin
  oracle 17296     1  0 19:41:24 ?        0:00 oracletestrac2 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
  oracle 16482 16481  0 19:40:38 ?        0:01 /data/oracle/product/10.2/crs/bin/evmd.bin
  oracle   461   459  0 15:16:28 pts/1    0:00 -sh
    root 16516 15650  0 19:40:38 ?        0:03 /data/oracle/product/10.2/crs/bin/crsd.bin reboot
  oracle 17103     1  0 19:41:05 ?        0:00 ora_smon_testrac2
  oracle 17273     1  0 19:41:22 ?        0:00 /data/oracle/product/10.2/crs/opmn/bin/ons -d
  oracle 17075     1  0 19:41:04 ?        0:00 ora_lmon_testrac2
  oracle 17095     1  0 19:41:04 ?        0:01 ora_mman_testrac2
  oracle 17077     1  0 19:41:04 ?        0:00 ora_lmd0_testrac2
  oracle 17346     1  0 19:41:26 ?        0:00 ora_q000_testrac2
  oracle 17097     1  0 19:41:05 ?        0:00 ora_dbw0_testrac2
  oracle 17099     1  0 19:41:05 ?        0:00 ora_lgwr_testrac2
  oracle 17079     1  0 19:41:04 ?        0:00 ora_lms0_testrac2
  oracle 17101     1  0 19:41:05 ?        0:00 ora_ckpt_testrac2
  oracle 17109     1  0 19:41:05 ?        0:01 ora_mmon_testrac2
  oracle 17107     1  0 19:41:05 ?        0:06 ora_cjq0_testrac2
  oracle 17121     1  0 19:41:05 ?        0:00 ora_d000_testrac2
  oracle 16959     1  0 19:40:56 ?        0:01 /data/oracle/product/10.2/database/bin/racgimon startd testrac
  oracle 17105     1  0 19:41:05 ?        0:00 ora_reco_testrac2
  oracle 17114     1  0 19:41:05 ?        0:00 ora_mmnl_testrac2
  oracle 17123     1  0 19:41:05 ?        0:00 ora_s000_testrac2
  oracle 17125     1  0 19:41:06 ?        0:01 ora_lck0_testrac2
  oracle 17177     1  0 19:41:12 ?        0:00 ora_p000_testrac2
  oracle 17179     1  0 19:41:12 ?        0:00 ora_p001_testrac2
  oracle 17205     1  0 19:41:15 ?        0:00 ora_qmnc_testrac2
    root 18941 15215  0 19:44:00 pts/1    0:00 grep ora
  oracle 17275 17273  0 19:41:22 ?        0:00 /data/oracle/product/10.2/crs/opmn/bin/ons -d
  oracle 17354     1  0 19:41:26 ?        0:00 ora_q001_testrac2
  oracle 17073     1  0 19:41:04 ?        0:00 ora_psp0_testrac2
  oracle 17396     1  0 19:41:29 ?        0:00 oracletestrac2 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
  oracle 17398     1  0 19:41:29 ?        0:00 oracletestrac2 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
  oracle 17071     1  0 19:41:04 ?        0:00 ora_diag_testrac2
  oracle 17045     1  0 19:41:01 ?        0:00 /data/oracle/product/10.2/database/bin/tnslsnr LISTENER_RACNODE2 -inherit
  oracle 17994     1  0 19:42:30 ?        0:00 oracletestrac2 (DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
  oracle  1508   461  0 15:18:07 pts/1    0:00 bash
  oracle 16715 16714  0 19:40:40 ?        0:00 /bin/sh -c cd /data/oracle/product/10.2/crs/log/racnode2/cssd/oclsomon; ulimit

利用crsctl enabledisable來設定CLUSTER是否在伺服器啟動後自動啟動:

# more /var/opt/oracle/scls_scr/racnode2/root/crsstart
disable
# /data/oracle/product/10.2/crs/bin/crsctl enable crs
# more /var/opt/oracle/scls_scr/racnode2/root/crsstart
enable
# /data/oracle/product/10.2/crs/bin/crsctl disable crs
# more /var/opt/oracle/scls_scr/racnode2/root/crsstart
disable

 

 

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

相關文章