1.首先介绍一下这3个服务
Has:是高可用服务,用在restart环境,可以是单机环境也可以是RAC环境,不管单机环境还是RAC环境,都可以执行crsctl check has,在RAC环境下,可以简单理解成cluster的一部分。
crs:是集群就绪服务,用在RAC环境,单机环境不能执行crsctl check crs,crsctl start crs不单单启动CRSD了,等于启动OHASD、CRSD、CSSD三者了。
cluster:就是集群的意思,用在RAC环境,单机环境不能执行crsctl check cluster。
2.通过命令查看has、crs、cluster管理的内容
[root@nxybj1 ~]# crsctl check has
CRS-4638: Oracle High Availability Services is online
[root@nxybj1 ~]# crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
[root@nxybj1 ~]# crsctl check cluster
CRS-4537: Cluster Ready Services is online
CRS-4529: Cluster Synchronization Services is online
CRS-4533: Event Manager is online
这里可以看到,crs管理的内容是has管理的内容和cluster管理的内容。
3.分别执行3条命令查看结果显示
3.1 停止cluster服务
root@nxybj1 ~]# crsctl stop cluster
CRS-2673: Attempting to stop ‘ora.crsd’ on ’nxybj1′
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on ’nxybj1′
CRS-2673: Attempting to stop ‘ora.LISTENER.lsnr’ on ’nxybj1′
CRS-2673: Attempting to stop ‘ora.LISTENER_SCAN1.lsnr’ on ’nxybj1′
CRS-2673: Attempting to stop ‘ora.CRS.dg’ on ’nxybj1′
CRS-2673: Attempting to stop ‘ora.power.db’ on ’nxybj1′
CRS-2677: Stop of ‘ora.LISTENER.lsnr’ on ’nxybj1′ succeeded
CRS-2673: Attempting to stop ‘ora.nxybj1.vip’ on ’nxybj1′
CRS-2677: Stop of ‘ora.LISTENER_SCAN1.lsnr’ on ’nxybj1′ succeeded
CRS-2673: Attempting to stop ‘ora.scan1.vip’ on ’nxybj1′
CRS-2677: Stop of ‘ora.scan1.vip’ on ’nxybj1′ succeeded
CRS-2672: Attempting to start ‘ora.scan1.vip’ on ’nxybj2′
CRS-2677: Stop of ‘ora.nxybj1.vip’ on ’nxybj1′ succeeded
CRS-2672: Attempting to start ‘ora.nxybj1.vip’ on ’nxybj2′
CRS-2677: Stop of ‘ora.power.db’ on ’nxybj1′ succeeded
CRS-2673: Attempting to stop ‘ora.DATA.dg’ on ’nxybj1′
CRS-2676: Start of ‘ora.nxybj1.vip’ on ’nxybj2′ succeeded
CRS-2676: Start of ‘ora.scan1.vip’ on ’nxybj2′ succeeded
CRS-2672: Attempting to start ‘ora.LISTENER_SCAN1.lsnr’ on ’nxybj2′
CRS-2677: Stop of ‘ora.DATA.dg’ on ’nxybj1′ succeeded
CRS-2676: Start of ‘ora.LISTENER_SCAN1.lsnr’ on ’nxybj2′ succeeded
CRS-2677: Stop of ‘ora.CRS.dg’ on ’nxybj1′ succeeded
CRS-2673: Attempting to stop ‘ora.asm’ on ’nxybj1′
CRS-2677: Stop of ‘ora.asm’ on ’nxybj1′ succeeded
CRS-2673: Attempting to stop ‘ora.ons’ on ’nxybj1′
CRS-2677: Stop of ‘ora.ons’ on ’nxybj1′ succeeded
CRS-2673: Attempting to stop ‘ora.net1.network’ on ’nxybj1′
CRS-2677: Stop of ‘ora.net1.network’ on ’nxybj1′ succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on ’nxybj1′ has completed
CRS-2677: Stop of ‘ora.crsd’ on ’nxybj1′ succeeded
CRS-2673: Attempting to stop ‘ora.ctssd’ on ’nxybj1′
CRS-2673: Attempting to stop ‘ora.evmd’ on ’nxybj1′
CRS-2673: Attempting to stop ‘ora.asm’ on ’nxybj1′
CRS-2677: Stop of ‘ora.evmd’ on ’nxybj1′ succeeded
CRS-2677: Stop of ‘ora.ctssd’ on ’nxybj1′ succeeded
CRS-2677: Stop of ‘ora.asm’ on ’nxybj1′ succeeded
CRS-2673: Attempting to stop ‘ora.cluster_interconnect.haip’ on ’nxybj1′
CRS-2677: Stop of ‘ora.cluster_interconnect.haip’ on ’nxybj1′ succeeded
CRS-2673: Attempting to stop ‘ora.cssd’ on ’nxybj1′
CRS-2677: Stop of ‘ora.cssd’ on ’nxybj1′ succeeded
[root@nxybj1 ~]# crsctl check crs
CRS-4638: Oracle High Availability Services is online
CRS-4535: Cannot communicate with Cluster Ready Services
CRS-4530: Communications failure contacting Cluster Synchronization Services daemon
CRS-4534: Cannot communicate with Event Manager
[root@nxybj1 ~]# crsctl check has
CRS-4638: Oracle High Availability Services is online
[root@nxybj1 ~]# crsctl check cluster
CRS-4535: Cannot communicate with Cluster Ready Services
CRS-4530: Communications failure contacting Cluster Synchronization Services daemon
CRS-4534: Cannot communicate with Event Manager
这里可以看到stop cluster停了Clusterware stack,其实也就是官方文档中指的Cluster Ready Services Stack。
3.2 停止has服务
在官方文档中,停止has就是停止Oracle High Availability Services Stack,但是Oracle High Availability Services Stack属于Cluster Ready Services Stack依赖的底层,所以在停Oracle High Availability Services Stack会自动停Cluster Ready Services Stack,具体信息如下:
[root@nxybj1 ~]# crsctl stop has
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on ’nxybj1′
CRS-2673: Attempting to stop ‘ora.crsd’ on ’nxybj1′
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on ’nxybj1′
CRS-2673: Attempting to stop ‘ora.CRS.dg’ on ’nxybj1′
CRS-2673: Attempting to stop ‘ora.power.db’ on ’nxybj1′
CRS-2673: Attempting to stop ‘ora.LISTENER.lsnr’ on ’nxybj1′
CRS-2677: Stop of ‘ora.LISTENER.lsnr’ on ’nxybj1′ succeeded
CRS-2673: Attempting to stop ‘ora.nxybj1.vip’ on ’nxybj1′
CRS-2677: Stop of ‘ora.nxybj1.vip’ on ’nxybj1′ succeeded
CRS-2672: Attempting to start ‘ora.nxybj1.vip’ on ’nxybj2′
CRS-2677: Stop of ‘ora.power.db’ on ’nxybj1′ succeeded
CRS-2673: Attempting to stop ‘ora.DATA.dg’ on ’nxybj1′
CRS-2676: Start of ‘ora.nxybj1.vip’ on ’nxybj2′ succeeded
CRS-2677: Stop of ‘ora.DATA.dg’ on ’nxybj1′ succeeded
CRS-2677: Stop of ‘ora.CRS.dg’ on ’nxybj1′ succeeded
CRS-2673: Attempting to stop ‘ora.asm’ on ’nxybj1′
CRS-2677: Stop of ‘ora.asm’ on ’nxybj1′ succeeded
CRS-2673: Attempting to stop ‘ora.ons’ on ’nxybj1′
CRS-2677: Stop of ‘ora.ons’ on ’nxybj1′ succeeded
CRS-2673: Attempting to stop ‘ora.net1.network’ on ’nxybj1′
CRS-2677: Stop of ‘ora.net1.network’ on ’nxybj1′ succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on ’nxybj1′ has completed
CRS-2677: Stop of ‘ora.crsd’ on ’nxybj1′ succeeded
CRS-2673: Attempting to stop ‘ora.crf’ on ’nxybj1′
CRS-2673: Attempting to stop ‘ora.ctssd’ on ’nxybj1′
CRS-2673: Attempting to stop ‘ora.evmd’ on ’nxybj1′
CRS-2673: Attempting to stop ‘ora.asm’ on ’nxybj1′
CRS-2673: Attempting to stop ‘ora.mdnsd’ on ’nxybj1′
CRS-2677: Stop of ‘ora.crf’ on ’nxybj1′ succeeded
CRS-2677: Stop of ‘ora.evmd’ on ’nxybj1′ succeeded
CRS-2677: Stop of ‘ora.mdnsd’ on ’nxybj1′ succeeded
CRS-2677: Stop of ‘ora.ctssd’ on ’nxybj1′ succeeded
CRS-2677: Stop of ‘ora.asm’ on ’nxybj1′ succeeded
CRS-2673: Attempting to stop ‘ora.cluster_interconnect.haip’ on ’nxybj1′
CRS-2677: Stop of ‘ora.cluster_interconnect.haip’ on ’nxybj1′ succeeded
CRS-2673: Attempting to stop ‘ora.cssd’ on ’nxybj1′
CRS-2677: Stop of ‘ora.cssd’ on ’nxybj1′ succeeded
CRS-2673: Attempting to stop ‘ora.gipcd’ on ’nxybj1′
CRS-2677: Stop of ‘ora.gipcd’ on ’nxybj1′ succeeded
CRS-2673: Attempting to stop ‘ora.gpnpd’ on ’nxybj1′
CRS-2677: Stop of ‘ora.gpnpd’ on ’nxybj1′ succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on ’nxybj1′ has completed
CRS-4133: Oracle High Availability Services has been stopped.
这里可以看到在停has的时候,自动把上层服务也停了。
3.3 停止crs服务
这里的crs其实指的是整个ORACLE集群,也不是 Cluster Ready Services Stack的简写。
[root@nxybj1 ~]# crsctl stop crs
CRS-2791: Starting shutdown of Oracle High Availability Services-managed resources on ’nxybj1′
CRS-2673: Attempting to stop ‘ora.crsd’ on ’nxybj1′
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on ’nxybj1′
CRS-2673: Attempting to stop ‘ora.CRS.dg’ on ’nxybj1′
CRS-2673: Attempting to stop ‘ora.power.db’ on ’nxybj1′
CRS-2673: Attempting to stop ‘ora.LISTENER.lsnr’ on ’nxybj1′
CRS-2677: Stop of ‘ora.LISTENER.lsnr’ on ’nxybj1′ succeeded
CRS-2673: Attempting to stop ‘ora.nxybj1.vip’ on ’nxybj1′
CRS-2677: Stop of ‘ora.nxybj1.vip’ on ’nxybj1′ succeeded
CRS-2672: Attempting to start ‘ora.nxybj1.vip’ on ’nxybj2′
CRS-2677: Stop of ‘ora.power.db’ on ’nxybj1′ succeeded
CRS-2673: Attempting to stop ‘ora.DATA.dg’ on ’nxybj1′
CRS-2676: Start of ‘ora.nxybj1.vip’ on ’nxybj2′ succeeded
CRS-2677: Stop of ‘ora.DATA.dg’ on ’nxybj1′ succeeded
CRS-2677: Stop of ‘ora.CRS.dg’ on ’nxybj1′ succeeded
CRS-2673: Attempting to stop ‘ora.asm’ on ’nxybj1′
CRS-2677: Stop of ‘ora.asm’ on ’nxybj1′ succeeded
CRS-2673: Attempting to stop ‘ora.ons’ on ’nxybj1′
CRS-2677: Stop of ‘ora.ons’ on ’nxybj1′ succeeded
CRS-2673: Attempting to stop ‘ora.net1.network’ on ’nxybj1′
CRS-2677: Stop of ‘ora.net1.network’ on ’nxybj1′ succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on ’nxybj1′ has completed
CRS-2677: Stop of ‘ora.crsd’ on ’nxybj1′ succeeded
CRS-2673: Attempting to stop ‘ora.crf’ on ’nxybj1′
CRS-2673: Attempting to stop ‘ora.ctssd’ on ’nxybj1′
CRS-2673: Attempting to stop ‘ora.evmd’ on ’nxybj1′
CRS-2673: Attempting to stop ‘ora.asm’ on ’nxybj1′
CRS-2673: Attempting to stop ‘ora.mdnsd’ on ’nxybj1′
CRS-2677: Stop of ‘ora.crf’ on ’nxybj1′ succeeded
CRS-2677: Stop of ‘ora.evmd’ on ’nxybj1′ succeeded
CRS-2677: Stop of ‘ora.mdnsd’ on ’nxybj1′ succeeded
CRS-2677: Stop of ‘ora.ctssd’ on ’nxybj1′ succeeded
CRS-2677: Stop of ‘ora.asm’ on ’nxybj1′ succeeded
CRS-2673: Attempting to stop ‘ora.cluster_interconnect.haip’ on ’nxybj1′
CRS-2677: Stop of ‘ora.cluster_interconnect.haip’ on ’nxybj1′ succeeded
CRS-2673: Attempting to stop ‘ora.cssd’ on ’nxybj1′
CRS-2677: Stop of ‘ora.cssd’ on ’nxybj1′ succeeded
CRS-2673: Attempting to stop ‘ora.gipcd’ on ’nxybj1′
CRS-2677: Stop of ‘ora.gipcd’ on ’nxybj1′ succeeded
CRS-2673: Attempting to stop ‘ora.gpnpd’ on ’nxybj1′
CRS-2677: Stop of ‘ora.gpnpd’ on ’nxybj1′ succeeded
CRS-2793: Shutdown of Oracle High Availability Services-managed resources on ’nxybj1′ has completed
CRS-4133: Oracle High Availability Services has been stopped.
通过上面对3个服务的停止测试,可以得到以下结论:
1.crsctl stop crs=crsctl stop cluster+crsctl stop has,前提是先停cluster后,再停has。
2.crsctl stop crs=crsctl stop has,如果之前没有Oracle手动停cluster,那么crsctl stop crs与crsctl stop has的效果一样
3.另外crsctl stop crs与crsctl stop has都只能管理当前节点,crsctl stop cluster可以一次操作集群中多个节点,前提是has服务正常运行。