使用crsctl工具控制Oracle RAC集群的启停

在安装Oracle RAC集群环境后,与集群有关的进程会自动启动。这样就带来了一个问题,似乎这里有不可控的因素在里面。在默认情况下,主机重新启动后集群进程会随操作系统而启动,因主机在启动的过程中会消耗比较大的资源,加之集群进程所消耗的资源,对于性能比较差的环境有可能导致集群环境启动非常缓慢的情况(在低效率的虚拟机环境下该问题尤为突出)。另外,在计划停机的场景下,我们依然需要对集群进程做细粒度的控制。crsctl命令可以比较便捷的达到我们的维护目的。注意:以上命令必须以root用户的身份来执行。本文只是基于Oracle 11 gRAC环境。

1.
禁止Oracle集群随操作系统重启而自动启动使用“crsctl disable crs”命令可以实现禁止Oracle集群在操作系统重新启动时被自动启动。注:此命令不会停止正在运行的Oracle集群环境,仅对后续的操作有影响。


[root@rac1 ~]# /u01/app/11.2.0/bin/crsctl disable crs
CRS-4621: Oracle High Availability Services autostart is disabled

注:Grid Infrastructure的操作系统用户grid$ORACLE_HOME设置如下:
ORACLE_HOME=/u01/app/11.2.0/grid
从此往后,集群启停将进入到手动管理模式,我们因此实现了更多的控制。

2.
启用Oracle集群随操作系统重启而自动启动这也是系统的默认行为。可以使用“crsctl enable crs”命令来实现。

[root@rac1 ~]# /u01/app/11.2.0/grid/bin/crsctl enable crs
CRS-4622: Oracle High Availability Services autostart is enabled.

3.
停止Oracle集群堆栈使用“crsctl stop crs”命令可以停止Oracle集群堆栈。可以针对每一个具体RAC节点操作。
[root@rac1 ~]# /u01/app/11.2.0/grid/bin/crsctl stop crs
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on 'rac1'

CRS-2673: Attempting to stop 'ora.crsd' on 'rac1'

CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'rac1'

CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'rac1'

CRS-2673: Attempting to stop 'ora.LISTENER_SCAN1.lsnr' on 'rac1'

CRS-2673: Attempting to stop 'ora.CRS.dg' on 'rac1'

CRS-2673: Attempting to stop 'ora.racdb.db' on 'rac1'

CRS-2673: Attempting to stop 'ora.registry.acfs' on 'rac1'

CRS-2677: Stop of 'ora.LISTENER_SCAN1.lsnr' on 'rac1' succeeded

CRS-2673: Attempting to stop 'ora.scan1.vip' on 'rac1'

CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'rac1' succeeded

CRS-2673: Attempting to stop 'ora.rac1.vip' on 'rac1'

CRS-2677: Stop of 'ora.scan1.vip' on 'rac1' succeeded

CRS-2672: Attempting to start 'ora.scan1.vip' on 'rac2'

CRS-2677: Stop of 'ora.rac1.vip' on 'rac1' succeeded

CRS-2672: Attempting to start 'ora.rac1.vip' on 'rac2'

CRS-2677: Stop of 'ora.registry.acfs' on 'rac1' succeeded

CRS-2676: Start of 'ora.rac1.vip' on 'rac2' succeeded

CRS-2676: Start of 'ora.scan1.vip' on 'rac2' succeeded

CRS-2672: Attempting to start 'ora.LISTENER_SCAN1.lsnr' on 'rac2'

CRS-2676: Start of 'ora.LISTENER_SCAN1.lsnr' on 'rac2' succeeded

CRS-2677: Stop of 'ora.CRS.dg' on 'rac1' succeeded

CRS-2677: Stop of 'ora.racdb.db' on 'rac1' succeeded

CRS-2673: Attempting to stop 'ora.FRA.dg' on 'rac1'

CRS-2673: Attempting to stop 'ora.RACDB_DATA.dg' on 'rac1'

CRS-2677: Stop of 'ora.FRA.dg' on 'rac1' succeeded

CRS-2677: Stop of 'ora.RACDB_DATA.dg' on 'rac1' succeeded

CRS-2673: Attempting to stop 'ora.asm' on 'rac1'

CRS-2677: Stop of 'ora.asm' on 'rac1' succeeded

CRS-2673: Attempting to stop 'ora.ons' on 'rac1'

CRS-2673: Attempting to stop 'ora.eons' on 'rac1'

CRS-2677: Stop of 'ora.ons' on 'rac1' succeeded

CRS-2673: Attempting to stop 'ora.net1.network' on 'rac1'

CRS-2677: Stop of 'ora.net1.network' on 'rac1' succeeded

CRS-2677: Stop of 'ora.eons' on 'rac1' succeeded

CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'rac1' has completed

CRS-2677: Stop of 'ora.crsd' on 'rac1' succeeded

CRS-2673: Attempting to stop 'ora.mdnsd' on 'rac1'

CRS-2673: Attempting to stop 'ora.gpnpd' on 'rac1'

CRS-2673: Attempting to stop 'ora.cssdmonitor' on 'rac1'

CRS-2673: Attempting to stop 'ora.ctssd' on 'rac1'

CRS-2673: Attempting to stop 'ora.evmd' on 'rac1'

CRS-2673: Attempting to stop 'ora.asm' on 'rac1'

CRS-2673: Attempting to stop 'ora.drivers.acfs' on 'rac1'

CRS-2677: Stop of 'ora.cssdmonitor' on 'rac1' succeeded

CRS-2677: Stop of 'ora.mdnsd' on 'rac1' succeeded

CRS-2677: Stop of 'ora.evmd' on 'rac1' succeeded

CRS-2677: Stop of 'ora.gpnpd' on 'rac1' succeeded

CRS-2677: Stop of 'ora.ctssd' on 'rac1' succeeded

CRS-2677: Stop of 'ora.drivers.acfs' on 'rac1' succeeded

CRS-2677: Stop of 'ora.asm' on 'rac1' succeeded

CRS-2673: Attempting to stop 'ora.cssd' on 'rac1'

CRS-2677: Stop of 'ora.cssd' on 'rac1' succeeded

CRS-2673: Attempting to stop 'ora.diskmon' on 'rac1'

CRS-2673: Attempting to stop 'ora.gipcd' on 'rac1'

CRS-2677: Stop of 'ora.gipcd' on 'rac1' succeeded

CRS-2677: Stop of 'ora.diskmon' on 'rac1' succeeded

CRS-2793: Shutdown of Oracle High Availability Services-managed resources on 'rac1' has completed

CRS-4133: Oracle High Availability Services has been stopped.

[root@rac1 ~]#

4.
启动Oracle集群堆栈使用“crsctl start crs”命令可以启动Oracle集群堆栈。可以针对每一个具体RAC节点操作。
[root@rac1 ~]# /oracle/app/crs/bin/crsctl start crs
CRS-4123: Oracle High Availability Services has been started.

5.
小结建议将Oracle集群堆栈设置为手工启停模式,这样可以避免一些不必要的问题。
参考文献:http://blog.sina.com.cn/s/blog_465a4a1e0100qttv.html

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/25837813/viewspace-1052000/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/25837813/viewspace-1052000/

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值