11G RAC檢查各元件狀態

達芬奇的夢發表於2018-04-23

ORACLE 11G RAC常用命令(grid使用者檢視)

1:檢查OHAS狀態和叢集狀態

[root@rac1 ~]# 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


2:檢查所有例項執行狀態

[root@rac1 ~]# srvctl status database -d racdb
Instance racdb1 is running on node rac1
Instance racdb2 is running on node rac2


3:檢查單個例項狀態(例項名分別為racdb1和racdb2,資料庫名為racdb)

[root@rac1 ~]# srvctl status instance -d racdb -i racdb1
Instance racdb1 is running on node rac1

[root@rac1 ~]# srvctl status instance -d racdb -i racdb2
Instance racdb2 is running on node rac2


4:節點應用程式狀態

[root@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


節點應用程式配置(VIP、GSD、ONS、監聽器)

[root@rac1 ~]# srvctl config nodeapps -a -g -s -l
Warning:-l option has been deprecated and will be ignored.
Network exists: 1/192.168.11.0/255.255.255.0/eth0, type static
VIP exists: /rac1-vip/192.168.11.201/192.168.11.0/255.255.255.0/eth0, hosting node rac1
VIP exists: /rac2-vip/192.168.11.211/192.168.11.0/255.255.255.0/eth0, hosting node rac2
GSD exists
ONS exists: Local port 6100, remote port 6200, EM port 2016
Name: LISTENER
Network: 1, Owner: grid
Home:
  /u01/app/11.2.0/grid on node(s) rac2,rac1
End points: TCP:1521


5:列出所有的配置資料庫

[root@rac1 ~]# srvctl config database -d racdb -a
Database unique name: racdb
Database name: racdb
Oracle home: /u01/app/oracle/product/11.2.0/db_1
Oracle user: oracle
Spfile: +DATA/racdb/spfileracdb.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: racdb
Database instances: racdb1,racdb2
Disk Groups: DATA,FRA
Mount point paths:
Services:
Type: RAC
Database is enabled
Database is administrator managed


6:ASM狀態及ASM配置

[root@rac1 ~]# srvctl status asm
ASM is running on rac2,rac1

[root@rac1 ~]# srvctl config asm -a
ASM home: /u01/app/11.2.0/grid
ASM listener: LISTENER
ASM is enabled.
[root@rac1 ~]#


7:TNS監聽器狀態及配置

[root@rac1 ~]# srvctl status listener
Listener LISTENER is enabled
Listener LISTENER is running on node(s): rac2,rac1

[root@rac1 ~]# srvctl config listener -a
Name: LISTENER
Network: 1, Owner: grid
Home:
  /u01/app/11.2.0/grid on node(s) rac2,rac1
End points: TCP:1521
[root@rac1 ~]#


8:SCAN狀態及配置

[root@rac1 ~]# srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node rac1

[root@rac1 ~]# srvctl config scan
SCAN name: rac-scan, Network: 1/192.168.11.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /rac-scan/192.168.11.199


9:VIP各個節點的狀態及配置

[root@rac1 ~]# srvctl status vip -n rac1
VIP rac1-vip is enabled
VIP rac1-vip is running on node: rac1

[root@rac1 ~]# srvctl status vip -n rac2
VIP rac2-vip is enabled
VIP rac2-vip is running on node: rac2

[root@rac1 ~]# srvctl config vip -n rac1
VIP exists: /rac1-vip/192.168.11.201/192.168.11.0/255.255.255.0/eth0, hosting node rac1

[root@rac1 ~]# srvctl config vip -n rac2
VIP exists: /rac2-vip/192.168.11.211/192.168.11.0/255.255.255.0/eth0, hosting node rac2


10:叢集中所有正在執行的例項(SQL)

SQL> select inst_id,instance_number,instance_name,parallel,status,database_status,active_state,host_name from gv$instance;

   INST_ID INSTANCE_NUMBER INSTANCE_NAME    PAR STATUS       DATABASE_STATUS   ACTIVE_ST HOST_NAME
---------- --------------- ---------------- --- ------------ ----------------- --------- --------------
         1               1 racdb1           YES OPEN         ACTIVE            NORMAL    rac1
         2               2 racdb2           YES OPEN         ACTIVE            NORMAL    rac2


用root使用者執行以下所有檢查


1:啟動或關閉資料庫例項

[root@rac1 ~]# srvctl stop instance -d racdb -n rac1
[root@rac1 ~]#
[root@rac1 ~]# srvctl stop instance -d racdb -n rac2
[root@rac1 ~]#
[root@rac1 ~]# srvctl status database -d racdb
Instance racdb1 is not running on node rac1
Instance racdb2 is not running on node rac2

也可以透過如下命令,檢查每一個例項的狀態

[root@rac1 ~]# srvctl status instance -d racdb -i racdb1
Instance racdb1 is not running on node rac1
 
[root@rac1 ~]# srvctl status instance -d racdb -i racdb2
Instance racdb2 is not running on node rac2


2:啟動或關閉asm例項

[root@rac1 ~]# srvctl stop asm -n rac1
PRCR-1014 : Failed to stop resource ora.asm
PRCR-1065 : Failed to stop resource ora.asm
CRS-2529: Unable to act on 'ora.asm' because that would require stopping or relocating 'ora.DATA.dg', but the force option was not specified
[root@rac1 ~]#

可以用 crsctl status resource -t -init 檢查叢集資源的狀態


3:本地伺服器上停止oracle clusterware 使用crsctl stop cluster 命令,這個命令執行之後,如果oracle clusterware管理的資源中有任何一個還在執行,
則整個命令失敗。使用-f選項,表示無條件的停止所有資源,並停止oracle clusterware系統。

另外,可透過指定-all選項在叢集中所有伺服器上停止oracle clusterware系統,如下:

crsctl stop cluster -all -f

也可以使用 crsctl start cluster -n rac1 rac2

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

相關文章