RAC常用管理命令

Michael_DD發表於2014-11-25
RAC常用管理命令


RAC 的啟停
oracle rac預設會開機自啟動,如需維護時可使用以下命令:
n 關閉:
crsctl stop cluster 停止本節點叢集服務
crsctl stop cluster –all 停止所有節點服務
n 開啟
crsctl start cluster 開啟本節點叢集服務
crsctl stop cluster –all 開啟所有節點服務
注:以上命令需以root使用者執行


RAC 檢查執行狀況
以 grid 使用者執行
[grid@rac1 ~]$ crsctl check cluster
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online

? Database檢查例狀態
[oracle@rac1 ~]$ srvctl status database -d orcl
Instance rac1 is running on node rac1
Instance rac2 is running on node rac2

? 檢查節點應用狀態及配置
[oracle@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
eONS is enabled
eONS daemon is running on node: rac1
eONS daemon is running on node: rac2
[oracle@rac1 ~]$ srvctl config nodeapps -a -g -s -l
-l homeion has been deprecated and will be ignored.
VIP exists.:rac1
VIP exists.: /rac1-vip/10.160.1.106/255.255.255.0/eth0
VIP exists.:rac2
VIP exists.: /rac2-vip/10.160.1.107/255.255.255.0/eth0
GSD exists.
ONS daemon exists. Local port 6100, remote port 6200
Name: LISTENER
Network: 1, Owner: grid
Home:
/oracle/11.2.0/grid on node(s) rac2,rac1
End points: TCP:1521

? 檢視資料庫配置
[oracle@rac1 ~]$ srvctl config database -d orcl -a
Database unique name: orcl
Database name: orcl.lottemart.cn
Oracle home: /oracle/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile: +ORCL_DATA/orcl/spfileorcl.ora
Domain: idevelopment.info
Start homeions: open
Stop homeions: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: orcl
Database instances: rac1,rac2
Disk Groups: DATA,FLASH
Services:
Database is enabled
Database is administrator managed

? 檢查ASM 狀態及配置
[oracle@rac1 ~]$ srvctl status asm
ASM is running on rac1,rac2
[oracle@rac1 ~$ srvctl config asm -a
ASM home: /oracle/11.2.0/grid
ASM listener: LISTENER
ASM is enabled.

? 檢查TNS 的狀態及配置
[oracle@rac1 ~]$ srvctl status listener
Listener LISTENER is enabled
Listener LISTENER is running on node(s): rac1,rac2
[oracle@rac1 ~]$ srvctl config listener -a
Name: LISTENER
Network: 1, Owner: grid
Home: /oracle/11.2.0/grid on node(s) rac2,rac1
End points: TCP:1521

? 檢查SCAN 的狀態及配置
[oracle@rac1 ~]$ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node rac1
[oracle@rac1 ~]$ srvctl config scan
SCAN name: rac-cluster-scan.rac.localdomain, Network:
1/192.168.1.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP:
/rac-cluster-scan.rac.localdomain

? 檢查VIP 的狀態及配置
[oracle@rac1 ~]$ srvctl status vip -n rac1
VIP rac1-vip is enabled
VIP rac1-vip is running on node: rac1
[oracle@rac1 ~]$ srvctl status vip -n rac2
VIP rac2-vip is enabled
VIP rac2-vip is running on node: rac2
[oracle@rac1 ~]$ srvctl config vip -n rac1
VIP exists.:rac1
VIP exists.: /rac1-vip/192.168.11.14/255.255.255.0/eth0
[oracle@rac1 ~]$ srvctl config vip -n rac2
VIP exists.:rac2
VIP exists.: /rac2-vip/192.168.15/255.255.255.0/eth0

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

相關文章