ORACLE RAC停止和启动
节点1:10.114.xxx.86(主)
节点2:10.114.xxx.87
1 停机前的准备工作
读取内存中参数,生成spfile或者pfile
节点1
create pfile=’/Oracle/20171031/pfile.txt’ from spfile;
create pfile = ‘/Oracle/20171031/memory.ora’ from memory;
节点2
create pfile=’/Oracle/20171031/pfile.txt’ from spfile;
create pfile = ‘/Oracle/20171031/memory.ora’ from memory;
ORACLE ARC停止
先看一下有多少用户在线 ,多的话就kill掉,这样停机就能快些。
[oracle@wuhlpmtdb02 ~]$ ps -ef|grep LOCAL=NO
1,关闭数据库:
以oracl用户执行srvctl命令:
然后查看状态:
[oracle@wuhlpmtdb03 20171031]$ srvctl status database -d primarydb
Instance primaryd1 is running on node wuhlpmtdb02
Instance primaryd2 is running on node wuhlpmtdb03
[oracle@wuhlpmtdb03 ~]$ srvctl stop database -d primarydb —停止所有节点上的实例
2,停止HAS(High Availability Services),必须以root用户
[root@wuhlpmtdb03 bin]# cd /Oracle/app/11.2.0/grid/bin
[root@wuhlpmtdb03 bin]# ./crsctl stop has -f
对于crsctl stop has 只有一个可选的参数就是-f,该命令只能停执行该命令服务器上的HAS而不能停所有节点上的。所以要把RAC全部停掉,需要在所有节点执行该命令。
3,停止节点集群服务,必须以root用户:
[root@rac1 oracle]# cd /Oracle/app/11.2.0/grid/bin
[root@rac1 bin]# ./crsctl stop cluster —-停止本节点集群服务
[root@rac1 bin]# ./crsctl stop cluster -all —-停止所有节点服务
也可以如下控制所停节点:
[root@rac1 bin]# ./crsctl stop cluster -n primaryd1 primaryd2
ORACLErac 启动
检查cluster状态
[root@wuhlpmtdb03 bin]# ./crsctl stat res -t
CRS-4535: Cannot communicate with Cluster Ready Services
CRS-4000: Command Status failed, or completed with errors.
[root@wuhlpmtdb03 bin]# ./crsctl check cluster -all
CRS-4639: Could not contact Oracle High Availability Services
CRS-4000: Command Check failed, or completed with errors.
启动crs服务1节点
[root@rac1 bin]# ./crsctl start crs
[root@rac1 bin]# ./crsctl check cluster -all
[root@rac1 bin]# ./crsctl stat res -t
启动crs服务2节点
[root@rac1 bin]# ./crsctl start crs
[root@rac1 bin]# ./crsctl check cluster -all
[root@rac1 bin]# ./crsctl stat res -t
进去asm确认asm磁盘组状态用grid用户
sqlplus / as sysasm
SQL> select group_number,name,state,voting_files from v$asm_diskgroup;
因为oracle数据库还未启动所以DATA和LOG磁盘为dismonted状态。
启动oracle数据
srvctl start instance -d oracle -n primaryd1
srvctl start instance -d oracle -n primaryd2
确认数据库状态
[oracle@rac1 ~]$ srvctl status database -d primarydb
进去asm确认asm磁盘组状态
select group_number,name,state,voting_files from v$asm_diskgroup;