RAC常用管理命令--查詢RAC叢集各種資訊命令-更新中

還不算暈發表於2013-10-27

1.查詢RAC叢集各種資訊命令

資料庫名:bysrac

例項名:bysrac1  bysrac1
查叢集狀態:
[grid@bysrac1 crsd]$ crsctl check cluster
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
[grid@bysrac1 ~]$ crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online

查所有節點例項是否啟動:
[grid@bysrac1 crsd]$ srvctl status database -d bysrac
Instance bysrac1 is running on node bysrac1

Instance bysrac2 is running on node bysrac2

叢集中所有正在執行的例項 — (SQL語句):
SELECT inst_id , instance_number inst_no , instance_name inst_name , parallel , status ,database_status db_status , active_state state , host_name host FROM gv$instance ORDER BY inst_id;

查單個節點例項是否啟動:
[grid@bysrac1 crsd]$ srvctl status instance -d bysrac -i bysrac1
Instance bysrac1 is running on node bysrac1
查節點應用程式狀態:
[grid@bysrac1 crsd]$ srvctl status nodeapps
VIP bysrac1-vip is enabled
VIP bysrac1-vip is running on node: bysrac1
VIP bysrac2-vip is enabled
VIP bysrac2-vip is running on node: bysrac2
Network is enabled
Network is running on node: bysrac1
Network is running on node: bysrac2
GSD is disabled
GSD is not running on node: bysrac1
GSD is not running on node: bysrac2
ONS is enabled
ONS daemon is running on node: bysrac1
ONS daemon is running on node: bysrac2
eONS is enabled
eONS daemon is running on node: bysrac1
eONS daemon is running on node: bysrac2
列出所配置的資料庫名:
[grid@bysrac1 ~]$ srvctl config database
bysrac
列出所配置的資料庫的詳細資訊:
[grid@bysrac1 ~]$ srvctl config database -d bysrac -a
Database unique name: bysrac
Database name: bysrac
Oracle home: /u01/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile: +BYSASMDATA/bysrac/spfilebysrac.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: bysrac
Database instances: bysrac1,bysrac2
Disk Groups: BYSASMDATA,BYSASMDG
Services:
Database is enabled
Database is administrator managed


檢視ASM磁碟
[grid@bysrac1 crsd]$ srvctl status asm
ASM is running on bysrac1,bysrac2
[grid@bysrac1 crsd]$ srvctl config asm -a
ASM home: /g01/app/11.2.0/grid
ASM listener: LISTENER
ASM is enabled.
檢視listener
[grid@bysrac1 crsd]$ srvctl status listener
Listener LISTENER is enabled
Listener LISTENER is running on node(s): bysrac1,bysrac2
[grid@bysrac1 crsd]$ srvctl config listener -a
Name: LISTENER
Network: 1, Owner: grid
Home: <CRS home>
  /g01/app/11.2.0/grid on node(s) bysrac2,bysrac1


檢視各資源狀態(nodeapps節點應用程式,ASM例項,資料庫等)

狀態檢查可以用以下三個命令:

crsctl stat resource –t
或者
crsctl stat resource

[grid@bysrac1 ~]$ crs_stat -t
Name           Type           Target    State     Host        
------------------------------------------------------------
ora....MBAK.dg ora....up.type ONLINE    ONLINE    bysrac1     
ora....DATA.dg ora....up.type ONLINE    ONLINE    bysrac1     
ora....SMDG.dg ora....up.type ONLINE    ONLINE    bysrac1     
ora....ER.lsnr ora....er.type ONLINE    ONLINE    bysrac1     
ora....N1.lsnr ora....er.type ONLINE    ONLINE    bysrac1     
ora.asm        ora.asm.type   ONLINE    ONLINE    bysrac1     
ora.bysrac.db  ora....se.type ONLINE    ONLINE    bysrac1     
ora....SM1.asm application    ONLINE    ONLINE    bysrac1     
ora....C1.lsnr application    ONLINE    ONLINE    bysrac1     
ora....ac1.gsd application    OFFLINE   OFFLINE               
ora....ac1.ons application    ONLINE    ONLINE    bysrac1     
ora....ac1.vip ora....t1.type ONLINE    ONLINE    bysrac1     
ora....SM2.asm application    ONLINE    ONLINE    bysrac2     
ora....C2.lsnr application    ONLINE    ONLINE    bysrac2     
ora....ac2.gsd application    OFFLINE   OFFLINE               
ora....ac2.ons application    ONLINE    ONLINE    bysrac2     
ora....ac2.vip ora....t1.type ONLINE    ONLINE    bysrac2     
ora.eons       ora.eons.type  ONLINE    ONLINE    bysrac1     
ora.gsd        ora.gsd.type   OFFLINE   OFFLINE               
ora....network ora....rk.type ONLINE    ONLINE    bysrac1     
ora.oc4j       ora.oc4j.type  OFFLINE   OFFLINE               
ora.ons        ora.ons.type   ONLINE    ONLINE    bysrac1     
ora.scan1.vip  ora....ip.type ONLINE    ONLINE    bysrac1  

在11g R2中,預設 oc4j和gsd資源是 disable的;oc4j 是用於WLM 的一個資源, WLM在 11.2.0.2 才可用;

gsd是 CRS 用於跟 9i RAC 進行通訊的一個模組,是為了向後相容才保留的,不影響效能;建議不要刪除, 也不要嘗試開啟他們, 忽略即可。


時鐘同步   驗證所有叢集節點間的時鐘同步:

 [grid@rac02 ~]$ cluvfy comp clocksync -verbose

相關文章