检查集群状态
crsctl check status
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
查看各资源状态(nodeapps节点应用程序、ASM实例、数据库)
crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.....CRM.cs application ONLINE ONLINE rac1
ora....db1.srv application ONLINE ONLINE rac2
ora.devdb.db application ONLINE ONLINE rac1
ora....b1.inst application ONLINE ONLINE rac1
ora....b2.inst application ONLINE ONLINE rac2
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
查看rac数据库状态(所有实例)
srvctl status database -d racdb(数据库名)
Instance racdb1 is running on node rac01
Instance racdb2 is running on node rac02
查看单个实例状态
srvctl status database -d racdb(数据库名) -i racdb1(实例名)
Instance racdb1 is running on node rac01
查看节点应用程序状态
srvctl status nodeapps
VIP rac01-vip is enabled
VIP rac01-vip is running on node: rac01
VIP rac02-vip is enabled
VIP rac02-vip is running on node: rac02
Network is enabled
Network is running on node: rac01
Network is running on node: rac02
GSD is disabled
GSD is not running on node: rac01
GSD is not running on node: rac02
ONS is enabled
ONS daemon is running on node: rac01
ONS daemon is running on node: rac02
eONS is enabled
eONS daemon is running on node: rac01
eONS daemon is running on node: rac02
查看所有的配置数据库
srvctl config database
racdb
查看数据库配置
srvctl config database -d racdb(数据库名) -a
Database unique name: racdb
Database name: racdb
Oracle home: /u01/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile: +RACDB_DATA/racdb/spfileracdb.ora
Domain: xzxj.edu.cn
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: racdb
Database instances: racdb1,racdb2
Disk Groups: RACDB_DATA,FRA
Services:
Database is enabled
Database is administrator managed
查看ASM状态及ASM配置
srvctl status ASM
ASM is running on rac01,rac02
srvctl config ASM -a
ASM home: /u01/app/11.2.0/grid
ASM listener: LISTENER
ASM is enabled.
查看TNS监听器状态
srvctl status listener
Listener LISTENER is enabled
Listener LISTENER is running on node(s): rac01,rac02
查看TNS监听器的配置
srvctl config listener -a
Name: LISTENER
Network: 1, Owner: grid
Home: <CRS home>
/u01/app/11.2.0/grid on node(s) rac02,rac01
End points: TCP:1521
查看scan状态及配置
srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node rac02
查看scan配置
srvctl config scan -a
SCAN name: rac-scan.xzxj.edu.cn, Network: 1/192.168.1.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /rac-scan.xzxj.edu.cn/192.168.1.55
查看vip各节点的状态
srvctl status vip -n rac01(节点名)
VIP rac01-vip is enabled
VIP rac01-vip is running on node: rac01
查看vip节点配置
srvctl config vip -n rac01(节点名)
VIP exists.:rac01
VIP exists.: /rac01-vip/192.168.1.53/255.255.255.0/eth0
查看节点应用程序配置
srvctl config nodeapps -a -g -s -l
-l option has been deprecated and will be ignored.
VIP exists.:rac01
VIP exists.: /rac01-vip/192.168.1.53/255.255.255.0/eth0
VIP exists.:rac02
VIP exists.: /rac02-vip/192.168.1.54/255.255.255.0/eth0
GSD exists.
ONS daemon exists. Local port 6100, remote port 6200
Name: LISTENER
Network: 1, Owner: grid
Home: <CRS home>
/u01/app/11.2.0/grid on node(s) rac02,rac01
End points: TCP:1521
验证所有集群节点间的时钟同步
cluvfy comp clocksync -verbose
Verifying Clock Synchronization across the cluster nodes
Checking if Clusterware is installed on all nodes...
Check of Clusterware install passed
Checking if CTSS Resource is running on all nodes...
Check: CTSS Resource running on all nodes
Node Name Status
------------------------------------ ------------------------
rac02 passed
Result: CTSS resource check passed
Querying CTSS for time offset on all nodes...
Result: Query of CTSS for time offset passed
Check CTSS state started...
Check: CTSS state
Node Name State
------------------------------------ ------------------------
rac02 Active
CTSS is in Active state. Proceeding with check of clock time offsets on all nodes...
Reference Time Offset Limit: 1000.0 msecs
Check: Reference Time Offset
Node Name Time Offset Status
------------ ------------------------ ------------------------
rac02 0.0 passed
Time offset is within the specified limits on the following set of nodes:
"[rac02]"
Result: Check of clock time offsets passed
Oracle Cluster Time Synchronization Services check passed
关闭集群
srvctl stop cluster
备注:
在运行“crsctl stop cluster”命令之后,如果 Oracle Clusterware 管理的
资源中有任何一个还在运行,则整个命令失败。使用 -f 选项无条件地停止所有资源并
停止 Oracle Clusterware 系统。
关闭所有节点上的集群
srvctl stop cluster -all
启动集群
srvctl start cluster
启动所有节点上的集群
srvctl start cluster -all
启动数据库(所有实例)
srvctl start database -d racdb(数据库名)
关闭数据库(所有实例)
crsctl check status
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
查看各资源状态(nodeapps节点应用程序、ASM实例、数据库)
crs_stat -t
Name Type Target State Host
------------------------------------------------------------
ora.....CRM.cs application ONLINE ONLINE rac1
ora....db1.srv application ONLINE ONLINE rac2
ora.devdb.db application ONLINE ONLINE rac1
ora....b1.inst application ONLINE ONLINE rac1
ora....b2.inst application ONLINE ONLINE rac2
ora....SM1.asm application ONLINE ONLINE rac1
ora....C1.lsnr application ONLINE ONLINE rac1
ora.rac1.gsd application ONLINE ONLINE rac1
ora.rac1.ons application ONLINE ONLINE rac1
ora.rac1.vip application ONLINE ONLINE rac1
ora....SM2.asm application ONLINE ONLINE rac2
ora....C2.lsnr application ONLINE ONLINE rac2
ora.rac2.gsd application ONLINE ONLINE rac2
ora.rac2.ons application ONLINE ONLINE rac2
ora.rac2.vip application ONLINE ONLINE rac2
查看rac数据库状态(所有实例)
srvctl status database -d racdb(数据库名)
Instance racdb1 is running on node rac01
Instance racdb2 is running on node rac02
查看单个实例状态
srvctl status database -d racdb(数据库名) -i racdb1(实例名)
Instance racdb1 is running on node rac01
查看节点应用程序状态
srvctl status nodeapps
VIP rac01-vip is enabled
VIP rac01-vip is running on node: rac01
VIP rac02-vip is enabled
VIP rac02-vip is running on node: rac02
Network is enabled
Network is running on node: rac01
Network is running on node: rac02
GSD is disabled
GSD is not running on node: rac01
GSD is not running on node: rac02
ONS is enabled
ONS daemon is running on node: rac01
ONS daemon is running on node: rac02
eONS is enabled
eONS daemon is running on node: rac01
eONS daemon is running on node: rac02
查看所有的配置数据库
srvctl config database
racdb
查看数据库配置
srvctl config database -d racdb(数据库名) -a
Database unique name: racdb
Database name: racdb
Oracle home: /u01/app/oracle/product/11.2.0/dbhome_1
Oracle user: oracle
Spfile: +RACDB_DATA/racdb/spfileracdb.ora
Domain: xzxj.edu.cn
Start options: open
Stop options: immediate
Database role: PRIMARY
Management policy: AUTOMATIC
Server pools: racdb
Database instances: racdb1,racdb2
Disk Groups: RACDB_DATA,FRA
Services:
Database is enabled
Database is administrator managed
查看ASM状态及ASM配置
srvctl status ASM
ASM is running on rac01,rac02
srvctl config ASM -a
ASM home: /u01/app/11.2.0/grid
ASM listener: LISTENER
ASM is enabled.
查看TNS监听器状态
srvctl status listener
Listener LISTENER is enabled
Listener LISTENER is running on node(s): rac01,rac02
查看TNS监听器的配置
srvctl config listener -a
Name: LISTENER
Network: 1, Owner: grid
Home: <CRS home>
/u01/app/11.2.0/grid on node(s) rac02,rac01
End points: TCP:1521
查看scan状态及配置
srvctl status scan
SCAN VIP scan1 is enabled
SCAN VIP scan1 is running on node rac02
查看scan配置
srvctl config scan -a
SCAN name: rac-scan.xzxj.edu.cn, Network: 1/192.168.1.0/255.255.255.0/eth0
SCAN VIP name: scan1, IP: /rac-scan.xzxj.edu.cn/192.168.1.55
查看vip各节点的状态
srvctl status vip -n rac01(节点名)
VIP rac01-vip is enabled
VIP rac01-vip is running on node: rac01
查看vip节点配置
srvctl config vip -n rac01(节点名)
VIP exists.:rac01
VIP exists.: /rac01-vip/192.168.1.53/255.255.255.0/eth0
查看节点应用程序配置
srvctl config nodeapps -a -g -s -l
-l option has been deprecated and will be ignored.
VIP exists.:rac01
VIP exists.: /rac01-vip/192.168.1.53/255.255.255.0/eth0
VIP exists.:rac02
VIP exists.: /rac02-vip/192.168.1.54/255.255.255.0/eth0
GSD exists.
ONS daemon exists. Local port 6100, remote port 6200
Name: LISTENER
Network: 1, Owner: grid
Home: <CRS home>
/u01/app/11.2.0/grid on node(s) rac02,rac01
End points: TCP:1521
验证所有集群节点间的时钟同步
cluvfy comp clocksync -verbose
Verifying Clock Synchronization across the cluster nodes
Checking if Clusterware is installed on all nodes...
Check of Clusterware install passed
Checking if CTSS Resource is running on all nodes...
Check: CTSS Resource running on all nodes
Node Name Status
------------------------------------ ------------------------
rac02 passed
Result: CTSS resource check passed
Querying CTSS for time offset on all nodes...
Result: Query of CTSS for time offset passed
Check CTSS state started...
Check: CTSS state
Node Name State
------------------------------------ ------------------------
rac02 Active
CTSS is in Active state. Proceeding with check of clock time offsets on all nodes...
Reference Time Offset Limit: 1000.0 msecs
Check: Reference Time Offset
Node Name Time Offset Status
------------ ------------------------ ------------------------
rac02 0.0 passed
Time offset is within the specified limits on the following set of nodes:
"[rac02]"
Result: Check of clock time offsets passed
Oracle Cluster Time Synchronization Services check passed
Verification of Clock Synchronization across the cluster nodes was successful
查看所有数据库文件及所在的ASM磁盘组
select name from v$datafile union
select number from v$logfile union
select name from v$controlfile union
select name from v$tempfile;
查看ASM磁盘
select path from v$asm_disk;
关闭集群
srvctl stop cluster
备注:
在运行“crsctl stop cluster”命令之后,如果 Oracle Clusterware 管理的
资源中有任何一个还在运行,则整个命令失败。使用 -f 选项无条件地停止所有资源并
停止 Oracle Clusterware 系统。
关闭所有节点上的集群
srvctl stop cluster -all
启动集群
srvctl start cluster
启动所有节点上的集群
srvctl start cluster -all
启动数据库(所有实例)
srvctl start database -d racdb(数据库名)
关闭数据库(所有实例)
srvctl stop database -d racdb(数据库名)
向OCR中添加数据库
srvctl add database -d racdb(数据库名)
srvctl add database -d racdb(数据库名) -i rac01(实例名)
从OCR中删除数据库
srvctl remove database -d racdb(数据库名)
从OCR中删除实例
srvctl remove database -d racdb(数据库名) -i rac01(实例名)
查看数据库环境变量
srvctl getenv database -d racdb(数据库名)
查看实例环境变量
srvctl getenv instance -d racdb(数据库名) -i rac01(实例名)