溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

ORACLE 11G RAC常用命令有哪些

發(fā)布時間:2021-11-10 14:29:44 來源:億速云 閱讀:230 作者:小新 欄目:關(guān)系型數(shù)據(jù)庫

這篇文章給大家分享的是有關(guān)ORACLE 11G RAC常用命令有哪些的內(nèi)容。小編覺得挺實用的,因此分享給大家做個參考,一起跟隨小編過來看看吧。

ORACLE 11G RAC常用命令(grid用戶查看)

1:檢查OHAS狀態(tài)和集群狀態(tài)

[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:檢查所有實例運行狀態(tài)

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


3:檢查單個實例狀態(tài)(實例名分別為racdb1和racdb2,數(shù)據(jù)庫名為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:節(jié)點應(yīng)用程序狀態(tài)

[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


節(jié)點應(yīng)用程序配置(VIP、GSD、ONS、監(jiān)聽器)

[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:列出所有的配置數(shù)據(jù)庫

[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狀態(tài)及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監(jiān)聽器狀態(tài)及配置

[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狀態(tài)及配置

[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各個節(jié)點的狀態(tài)及配置

[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用戶執(zhí)行以下所有檢查


1:啟動或關(guān)閉數(shù)據(jù)庫實例

[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

也可以通過如下命令,檢查每一個實例的狀態(tài)

[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:啟動或關(guān)閉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 檢查集群資源的狀態(tài)


3:本地服務(wù)器上停止oracle clusterware 使用crsctl stop cluster 命令,這個命令執(zhí)行之后,如果oracle clusterware管理的資源中有任何一個還在運行,
則整個命令失敗。使用-f選項,表示無條件的停止所有資源,并停止oracle clusterware系統(tǒng)。

另外,可通過指定-all選項在集群中所有服務(wù)器上停止oracle clusterware系統(tǒng),如下:

crsctl stop cluster -all -f

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

感謝各位的閱讀!關(guān)于“ORACLE 11G RAC常用命令有哪些”這篇文章就分享到這里了,希望以上內(nèi)容可以對大家有一定的幫助,讓大家可以學(xué)到更多知識,如果覺得文章不錯,可以把它分享出去讓更多的人看到吧!

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI