ORACLE RAC 数据库服务器上 srvctl 常用的一些操作命令, 检查节点状态,检查VIP状态及配置等.作为笔记,以备不时之需.srvctl 是ORACLE RAC集群配置管理的工具,通过srvctl这个强大的工具来管理RAC,以下为对srvctl命令使用总结.
检查节点应用程序状态
[grid@db1 ~]$ srvctl status nodeapps
VIP db1vip is enabled
VIP db1vip is running on node: db1
VIP db2vip is enabled
VIP db2vip is running on node: db2
Network is enabled
Network is running on node: db1
Network is running on node: db2
GSD is disabled
GSD is not running on node: db1
GSD is not running on node: db2
ONS is enabled
ONS daemon is running on node: db1
ONS daemon is running on node: db2
检查节点vip状态及配置
[grid@db1 ~]$ srvctl status vip -n db1
VIP db1vip is enabled
VIP db1vip is running on node: db1
[grid@db1 ~]$ srvctl status vip -n db2
VIP db2vip is enabled
VIP db2vip is running on node: db2
[grid@db1 ~]$ srvctl config vip -n db1
VIP exists: /db1vip/10.200.0.105/10.200.0.0/255.255.255.0/eth0, hosting node db1
[grid@db1 ~]$ srvctl config vip -n db2
VIP exists: /db2vip/10.200.0.107/10.200.0.0/255.255.255.0/eth0, hosting node db2
检查节点监听与监听配置
[grid@db1 ~]$ srvctl status listener
Listener LISTENER is enabled
Listener LISTENER is running on nodes): db1,db2
grid@db1 ~]$ srvctl config listener -a
Name: LISTENER
Network: 1, Owner: grid
Home: /u01/app/11.2.0/grid on nodes) db2,db1
End points: TCP:1521
检查数据库实例状态
[grid@db1 ~]$ srvctl status database -d dmzdb
Instance dmzdb1 is running on node db1
Instance dmzdb2 is running on node db2
[grid@db1 ~]$ srvctl status instance -d dmzdb -i dmzdb1,dmzdb2
Instance dmzdb1 is running on node db1
Instance dmzdb2 is running on node db2
数据库配置
[grid@db1 ~]$ srvctl config database -d dmzdb -a
Database unique name: dmzdb
Database name: dmzdb
Oracle home: /u01/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile: +DATA/dmzdb/spfiledmzdb.ora
Domain:
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: dmzdb
Database instances: dmzdb1,dmzdb2
Disk Groups: DATA
Mount point paths:
Services:
Type: RAC
Database is enabled
Database is administrator managed
asm状态及配置
[grid@db1 ~]$ srvctl status asm
ASM is running on db1,db2
[grid@db1 ~]$ srvctl config asm -a
ASM home: /u01/app/11.2.0/grid
ASM listener: LISTENER
ASM is enabled.
scan状态及配置
[grid@db1 ~]$ srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node db1
grid@db1 ~]$ srvctl config scan
SCAN name: dbscan, Network: 1/10.200.0.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /dbscan/10.200.0.109
停止db1监听
[grid@db1 ~]$ srvctl stop listener -n db1
[grid@db1 ~]$ srvctl status listener -n db1
Listener LISTENER is enabled on nodes): db1
Listener LISTENER is not running on nodes): db1
停实例db1
[grid@db1 ~]$ srvctl stop instance -d dmzdb -n db1
[grid@db1 ~]$ srvctl status instance -d dmzdb -n db1
Instance dmzdb1 is not running on node db1
Instance dmzdb1 is not running on node db1
启动db1实例
[grid@db1 ~]$ srvctl start instance -d dmzdb -n db1
[grid@db1 ~]$ srvctl status instance -d dmzdb -n db1
Instance dmzdb1 is running on node db1
启动db1监听
[grid@db1 ~]$ srvctl start listener -n db1
[grid@db1 ~]$ srvctl status listener -n db1
Listener LISTENER is enabled on nodes): db1
Listener LISTENER is running on nodes): db1