关闭顺序:
1、关闭数据库,oracle用户执行srvctl命令:
[oracle@node1 ~]$srvctl stop database -d ORCL---停止所有节点上的实例
[oracle@node1 ~]$srvctl status database -d devdb
或者每个节点登录数据库后执行SQL>shutdown immediate
2,停止集群服务,必须以root用户(2步可能都已完成3步):
[root@node1 oracle]# cd /u01/app/11.2.0/grid/bin
[root@node1 bin]# ./crsctl stop cluster -all ----停止所有节点服务
或[root@node1 bin]# ./crsctl stop cluster ----停止本节点集群服务,每个节点分别执行
也可以如下控制所停节点:
[root@node1 bin]# ./crsctl stop cluster -n rac1 rac2
查看节点状态
[grid@node1 ~]$ crs_stat -t -v 或者 crsctl status resource -t
[grid@node1 ~]$ srvctl status nodeapps
3,停止HAS(High Availability Services),必须以root用户
[root@node1 oracle]#cd /u01/app/11.2.0/grid/bin
[root@node1 bin]# ./crsctl stop has –f
以上has启动命令需要在每个节点分别执行
启动顺序:
11g R2的RAC默认开机会自启动,当然如果需要手工启动。手工启动按照HAS, cluster, database的顺序启动即可,具体命令如下:
1、启动HAS(High Availability Services),必须以root用户
[root@node1 bin]# ./crsctl start has
以上has启动命令需要在每个节点分别执行
查看节点状态
[grid@node1 ~]$ crs_stat -t -v 或者 crsctl status resource -t
2、启动集群(cluster)
[root@node1 ~]# ./crsctl start cluster -all --所有节点同时启动
或者只启动指定节点的
[root@node1 ~]# ./crsctl start cluster -n rac1 rac2 --两个节点同时启动
3、启动数据库,oracl用户执行srvctl命令(假设数据库名为ORCL):
[oracle@node1 ~]$ srvctl start database -d ORCL---启动所有节点上的实例
或者每个节点登录数据库后执行SQL>startup
使用crs_stat命令来进程验证。
检查节点状态
[grid@node1 ~]$ crs_stat -t -v 或者 crsctl status resource -t
[grid@node1 ~]$ srvctl status nodeapps
检查数据库状态
[grid@node1 ~]$ srvctl status database -d devdb
检查ASM状态
[grid@node1 ~]$srvctl status asm
root用户下
禁止CRS系统重启而自动启动
[root@node1 bin]# ./crsctl disable crs
CRS-4621: Oracle High Availability Services autostart is disabled.
检查crs配置为是否自动启动
[root@node1 bin]#./crsctl config crs
CRS-4621: Oracle High Availability Services autostart is disabled.
启用CRS系统重启而自动启动(每个节点分别执行)
[root@node1 bin]#./crsctl enable crs
CRS-4622: Oracle High Availability Services autostart is enabled.
[root@node1 bin]#./crsctl config crs
CRS-4622: Oracle High Availability Services autostart is enabled.
ocr和votedisk检查(grid用户)
需要在grid用户下执行这些命令,crsctl query css votedisk 和ocrcheck
[grid@node1 ~]$ crsctl query css votedisk
## STATE File Universal Id File Name Disk group
-- ----- ----------------- --------- ---------
1. ONLINE 6312056f545c4fc7bf9f0a9b56a5aba0 (ORCL:VOL1) [OCR]
Located 1 voting disk(s).
[grid@node1 ~]$ ocrcheck
Status of Oracle Cluster Registry is as follows :
Version : 3
Total space (kbytes) : 262120
Used space (kbytes) : 2964
Available space (kbytes) : 259156
ID : 1801821488
Device/File Name : +OCR
Device/File integrity check succeeded
Device/File not configured
Device/File not configured
Device/File not configured
Device/File not configured
Cluster registry integrity check succeeded
Logical corruption check bypassed due to non-privileged user