12C RAC 常用檢查命令,持續總結中

kisslfcr發表於2016-07-08
grid:

olsnodes -s列出叢集中節點
crsctl check cluster -all檢查幾圈狀態
crsctl check cluster
crsctl check crs 檢查當前節點
srvctl status scan_listener檢視scan監聽器的狀態
crsctl stat res -t
crs_stat -t檢查叢集中資源的狀態
asmcmd showclustermode檢視asm是否為flex
asmcmd showclusterstate檢視asm安裝型別

1.2.1 檢查叢集狀態
[grid@rac1 ~]$ crsctl check cluster
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Servicesis online
CRS-4533: Event Manager is online
 
1.2.2 所有Oracle例項(資料庫狀態)
[grid@rac1 ~]$ srvctl status database -dsdd
Instance sdd1 is running on node rac1
Instance sdd2 is running on node rac2
 
1.2.3 檢查單個例項狀態
[grid@rac1 ~]$ srvctl status instance -dsdd -i sdd1
Instance sdd1 is running on node rac1
[grid@rac1 ~]$
 
1.2.4節點應用程式狀態
[grid@rac1 ~]$ srvctl status nodeapps
VIP rac1-vip is enabled
VIP rac1-vip is running on node: rac1
VIP rac2-vip is enabled
VIP rac2-vip is running on node: rac2
Network is enabled
Network is running on node: rac1
Network is running on node: rac2
GSD is disabled
GSD is not running on node: rac1
GSD is not running on node: rac2
ONS is enabled
ONS daemon is running on node: rac1
ONS daemon is running on node: rac2
 
 
1.2.5 列出所有的配置資料庫
[grid@rac1 ~]$ srvctl config database
sdd
 
1.2.6 資料庫配置
[grid@rac1 ~]$ srvctl config database -dsdd -a
Database unique name: sdd
Database name: sdd
Oracle home: /u01/app/oracle/11.2.0/db_1
Oracle user: oracle
Spfile: +DATA/sdd/spfilesdd.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: sdd
Database instances: sdd1,sdd2
Disk Groups: DATA,FRA
Mount point paths:
Services:
Type: RAC
Database is enabled
Database is administrator managed
 
1.2.7 ASM狀態以及ASM配置
[grid@rac1 ~]$ srvctl status asm
ASM is running on rac2,rac1
 
[grid@rac1 ~]$ srvctl status asm -a
ASM is running on rac2,rac1
ASM is enabled.
 
1.2.8 TNS監聽器狀態以及配置
[grid@rac1 ~]$ srvctl status listener
Listener LISTENER is enabled
Listener LISTENER is running on node(s):rac2,rac1
 
[grid@rac1 ~]$ srvctl config listener -a
Name: LISTENER
Network: 1, Owner: grid
Home:
/u01/app/grid/11.2.0 on node(s) rac2,rac1
End points: TCP:1521
 
 
1.2.8 SCAN狀態以及配置
[grid@rac1 ~]$ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node rac1
 
[grid@rac1 ~]$ srvctl config scan
SCAN name: rac-scan, Network:1/192.168.16.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP:/rac-scan/192.168.16.207
 
1.2.9 VIP各個節點的狀態以及配置
[grid@rac1 ~]$ srvctl status vip -n rac1
VIP rac1-vip is enabled
VIP rac1-vip is running on node: rac1
 
[grid@rac1 ~]$ srvctl status vip -n rac2
VIP rac2-vip is enabled
VIP rac2-vip is running on node: rac2
 
[grid@rac1 ~]$ srvctl config vip -n rac1
VIP exists: /rac1-vip/192.168.16.201/192.168.16.0/255.255.255.0/eth0,hosting node rac1
 
[grid@rac1 ~]$ srvctl config vip -n rac2
VIP exists:/rac2-vip/192.168.16.203/192.168.16.0/255.255.255.0/eth0, hosting node rac2
[grid@rac1 ~]$
 
1.2.10 節點應用程式配置(VIP、GSD、ONS、監聽器)
[grid@rac1 ~]$ srvctl config nodeapps -a -g-s -l
Warning:-l option has been deprecated andwill be ignored.
Network exists:1/192.168.16.0/255.255.255.0/eth0, type static
VIP exists:/rac1-vip/192.168.16.201/192.168.16.0/255.255.255.0/eth0, hosting node rac1
VIP exists:/rac2-vip/192.168.16.203/192.168.16.0/255.255.255.0/eth0, hosting node rac2
GSD exists
ONS exists: Local port 6100, remote port6200, EM port 2016
Name: LISTENER
Network: 1, Owner: grid
Home:
/u01/app/grid/11.2.0 on node(s) rac2,rac1
End points: TCP:1521
 
1.3 語法簡匯
1.3.1 資料庫與例項
srvctl config database # 列出安裝的資料庫
srvctl config database -d rac -a # 檢查資料庫相關的資訊
srvctlstatus database -d RAC # 檢查資料庫的狀態
srvctl status instance -d RAC -i rac1 # 檢查指定例項的狀態


srvctl config asm -a # ASM配置
srvctl status asm # ASM的狀態


srvctl start database -d rac # 啟動資料庫
srvctl stop database -d rac # 關閉資料庫


srvctl start instance -d rac -i rac1 # 啟動指定的例項
srvctl stop instance -d rac -i rac2 # 關閉指定例項
 
1.3.2 網路相關的命令
 
srvctl status listener # 檢查TNS listener的狀態
srvctl config scan # SCAN的配置
srvctl status scan # SCAN listener狀態, 包含當前執行節點的資訊


# 檢查VIP的配置及狀態
srvctl status vip -n rac1
srvctl config vip -n rac1
 
1.3.3 檢視各資源狀態(nodeapps節點應用程式,ASM例項,資料庫等)
 
[root@db02 u01]# crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.DATA.dg ora....up.type ONLINE ONLINE db02
ora.FRA.dg ora....up.type ONLINE ONLINE db02
ora....ER.lsnr ora....er.type ONLINE ONLINE db02
ora....N1.lsnr ora....er.type ONLINE ONLINE db02
ora....N2.lsnr ora....er.type ONLINE ONLINE db02
ora....N3.lsnr ora....er.type ONLINE ONLINE db02
ora.OCR.dg ora....up.type ONLINE ONLINE db02
ora.asm ora.asm.type ONLINE ONLINE db02
ora....-01.vip ora....t1.type ONLINE ONLINE db02
ora....SM2.asm application ONLINE ONLINE db02
ora....02.lsnr application ONLINE ONLINE db02
ora....-02.gsd application OFFLINE OFFLINE
ora....-02.ons application ONLINE ONLINE db02
ora....-02.vip ora....t1.type ONLINE ONLINE db02
ora.cvu ora.cvu.type ONLINE ONLINE db02
ora.gsd ora.gsd.type OFFLINE OFFLINE
ora....network ora....rk.type ONLINE ONLINE db02
ora.oc4j ora.oc4j.type ONLINE ONLINE db02
ora.ons ora.ons.type ONLINE ONLINE db02
ora.orcl.db ora....se.type ONLINE ONLINE db02
ora....taf.svc ora....ce.type ONLINE ONLINE db02
ora.scan1.vip ora....ip.type ONLINE ONLINE db02
ora.scan2.vip ora....ip.type ONLINE ONLINE db02
ora.scan3.vip ora....ip.type ONLINE ONLINE db02
 
在11g R2中,預設 oc4j和gsd資源是 disable的;oc4j 是用於WLM 的一個資源, WLM在 11.2.0.2 才可用;gsd是 CRS 用於跟 9i RAC 進行通訊的一個模組,是為了向後相容才保留的,不影響效能;建議不要刪除, 也不要嘗試開啟他們, 忽略即可。
 
ora.gsd is OFFLINE by default ifthere is no 9i database in the cluster.
ora.oc4j is OFFLINE in 11.2.0.1 as DatabaseWorkload Management(DBWLM) is unavailable. these can be ignored in11gR2 RAC.
 
狀態檢查也可以使用如下命令:
crsctl stat resource –t
或者
crsctl stat resource
 
更多內容參考:
Oracle 11gR2RAC 程式說明
http://blog.csdn.net/tianlesoftware/article/details/6009962
 
1.3.4 綜合
1、透過SRVCTL命令來start/stop/check所有的例項:
srvctl start|stop|status database -d
 
2、start/stop指定的例項:
srvctl start|stop|statusinstance -d -i
 
3、列出當前RAC下所有的
srvctl config database -d
 
4、start/stop/check 所有的nodeapps,比如:VIP, GSD, listener, ONS:
srvctl start|stop|status nodeapps -n
 
5、如果你使用ASM,srvctl也可以start/stop ASM例項:
srvctl start|stop asm -n [-i ] [-o]
 
6、可以獲取所有的環境資訊:
srvctl getenv database -d [-i]
 
7、設定全域性環境和變數:
srvctl setenv database -d -t LANG=en
 
8、從OCR中刪除已有的資料庫:
srvctl remove database -d
 
9、向OCR中新增一個資料庫的例項:
srvctl add instance -d -i -n
srvctl add instance -d -i -n

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

相關文章