Oracle RAC常用命令


Oracle Clusterware的命令集可以分為以下4種,其中用的最多的是crsctl和srvctl:
節點層:osnodes
  olsnodes -n -i -s
  olsnodes -l -p


網絡層:oifcfg
  oifcfg iflist
  oifcfg iflist -p -n
  oifcfg getif


集群層:crsctl, ocrcheck,ocrdump,ocrconfig
  crs_stat -t
  crsctl stat res -t

crsctl對集群組件進行操作
  crsctl check crs,css, ctss,evm,has
  crsctl check cluster -all
  ps -ef | grep crsd,cssd,ctssd,evm,ohas
停止和啟動集群的命令(root下單節點,需要添加環境變量):
  crsctl stop has/crsctl stop crs
  crsctl start has/crsctl start crs
  crsctl config has
  crsctl disable has
  crsctl enable has
控制多個節點
  crsctl stop cluster -all

應用層:srvctl,onsctl,crs_stat
  srvctl對集群資源進行操作
  srvctl status -h

檢查所有Oracle實例狀態

  srvctl status database -d spdb
  srvctl config database -d spdb -a -v

檢查單個實例狀態
  srvctl status instance -d spdb -i spdb1
  srvctl status instance -d spdb -i spdb2

節點應用程序狀態
  srvctl status nodeapps

監聽器狀態以及配置
  srvctl status listener
  srvctl status listener -l listener1
  srvctl status scan_listener

ASM狀態
  srvctl status asm
  srvctl status asm -a
  srvctl status asm -v

VIP狀態
  srvctl status vip -n rac1
  srvctl status vip -n rac2

 

srvctl查看配置
  srvctl config -h

列出所有的配置數據庫

  srvctl config database   #列出安裝的數據庫

  srvctl config database -d spdb -a   #檢查數據庫相關的信息

監聽配置
  srvctl config listener
  srvctl config listener -a
ASM配置
  srvctl config asm
  srvctl config asm -a
SCAN配置
  srvctl config scan
  srvctl config scan_listener
VIP配置
  srvctl config vip -n rac1
  srvctl config vip -n rac2
節點應用程序配置
  srvctl config nodeapps

驗證所有集群節點間的時鍾
  cluvfy comp clocksync -n rac1,rac2 -verbose

  select instance_name,status from gv$instance;
  srvctl start database -d spdb    # 啟動數據庫,所有節點的實例
  srvctl stop database -d spdb    # 關閉數據庫,所有節點的實例
  srvctl start instance -d fxdb -i spdb1   # 啟動指定的實例
  srvctl stop instance -d spdb -i spdb1   # 關閉指定實例

  srvctl start instance -d fxdb -i spdb1 -o mount
  srvctl stop instance -d fxdb -i spdb1 -o immediate
  srvctl stop instance -d fxdb -i spdb1 -o abort

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM