Thursday, February 18, 2016

Starting and Stopping Oracle Cluster (RAC)

In this article I will explain how to start and stop a cluster (RAC).
We can either use “crsctl stop/start cluster” command or “cractl start/stop crs” command to accomplish this task. The difference between both method is as follows

  • OHASD (Oracle High Availability Service Daemon”) needs to be running while using “crsctl start/stop cluster” command. So if OHASD is not running, we will not be able to “crsctl stop/start cluster”. This also means that if we stop “crs” on a node using “crsctl stop crs” command, the OHASD will stop here and we will not be able to execute commands remotely from any other node to this node, and we would need to log into this node to execute any “crsctl” command
  • If we use “crsctl stop crs” to stop cluster, last service to be stopped will be OHASD, and if we use “crsctl start crs” to start the cluster, first service to start will be OHASD. 
  • “crsctl stop/start cluster” can be used to stop/start cluster (services) on other nodes whereas “crsctl stop/start crs” works only on local node.

In the following, I would be using “crsctl stop/start cluster” to perform the stop and start of cluster
Stop database service first. Either you can stop all instances one by one using “-i” option, or you can stop whole database(s) at once by omitting “–i” option from the following command.
[oracle]$ srvctl stop instance –i mydb1 –d mydb

If you don’t stop database manually before stopping whole cluster, the “cractl stop cluster” would do a SHUTDOWN ABORT to the database, so it is recommended to stop database gracefully before proceeding to the following step to stop the cluster.
Stop cluster while logged in as root. I am using “-n” option to specify the node name where I want to stop all cluster services. Alternatively we can use –all option instead of –n option to stop cluster on all nodes.

Using crsctl stop cluster

[root@myracnode1 ~]# /u01/app/11.2.0.4/grid/bin/crsctl stop cluster -n myracnode1
CRS-2673: Attempting to stop 'ora.crsd' on 'myracnode1'
CRS-2790: Starting shutdown of Cluster Ready Services-managed resources on 'myracnode1'
CRS-2673: Attempting to stop 'ora.LISTENER.lsnr' on 'myracnode1'
CRS-2673: Attempting to stop 'ora.DBFS_DG.dg' on 'myracnode1'
CRS-2673: Attempting to stop 'ora.registry.acfs' on 'myracnode1'
CRS-2673: Attempting to stop 'ora.DATAC1.dg' on 'myracnode1'
CRS-2673: Attempting to stop 'ora.RECOC1.dg' on 'myracnode1'
CRS-2677: Stop of 'ora.LISTENER.lsnr' on 'myracnode1' succeeded
CRS-2673: Attempting to stop 'ora.myracnode1.vip' on 'myracnode1'
CRS-2677: Stop of 'ora.DATAC1.dg' on 'myracnode1' succeeded
CRS-2677: Stop of 'ora.RECOC1.dg' on 'myracnode1' succeeded
CRS-2677: Stop of 'ora.registry.acfs' on 'myracnode1' succeeded
CRS-2677: Stop of 'ora.myracnode1.vip' on 'myracnode1' succeeded
CRS-2672: Attempting to start 'ora.myracnode1.vip' on 'myracnode1'
CRS-2676: Start of 'ora.myracnode1.vip' on 'myracnode1' succeeded
CRS-2677: Stop of 'ora.DBFS_DG.dg' on 'myracnode1' succeeded
CRS-2673: Attempting to stop 'ora.asm' on 'myracnode1'
CRS-2677: Stop of 'ora.asm' on 'myracnode1' succeeded
CRS-2673: Attempting to stop 'ora.ons' on 'myracnode1'
CRS-2677: Stop of 'ora.ons' on 'myracnode1' succeeded
CRS-2673: Attempting to stop 'ora.net1.network' on 'myracnode1'
CRS-2677: Stop of 'ora.net1.network' on 'myracnode1' succeeded
CRS-2792: Shutdown of Cluster Ready Services-managed resources on 'myracnode1' has completed
CRS-2677: Stop of 'ora.crsd' on 'myracnode1' succeeded
CRS-2673: Attempting to stop 'ora.ctssd' on 'myracnode1'
CRS-2673: Attempting to stop 'ora.evmd' on 'myracnode1'
CRS-2673: Attempting to stop 'ora.asm' on 'myracnode1'
CRS-2677: Stop of 'ora.ctssd' on 'myracnode1' succeeded
CRS-2677: Stop of 'ora.evmd' on 'myracnode1' succeeded
CRS-2677: Stop of 'ora.asm' on 'myracnode1' succeeded
CRS-2673: Attempting to stop 'ora.cluster_interconnect.haip' on 'myracnode1'
CRS-2677: Stop of 'ora.cluster_interconnect.haip' on 'myracnode1' succeeded
CRS-2673: Attempting to stop 'ora.cssd' on 'myracnode1'
CRS-2677: Stop of 'ora.cssd' on 'myracnode1' succeeded
CRS-2673: Attempting to stop 'ora.diskmon' on 'myracnode1'
CRS-2677: Stop of 'ora.diskmon' on 'myracnode1' succeeded


To start cluster, log in as root. Use –all option instead of –n to start cluster services on all nodes
[root@myracnode1 ~]# /u01/app/11.2.0.4/grid/bin/crsctl start cluster -n myracnode1
CRS-2672: Attempting to start 'ora.cssdmonitor' on 'myracnode1'
CRS-2676: Start of 'ora.cssdmonitor' on 'myracnode1' succeeded
CRS-2672: Attempting to start 'ora.cssd' on 'myracnode1'
CRS-2672: Attempting to start 'ora.diskmon' on 'myracnode1'
CRS-2676: Start of 'ora.diskmon' on 'myracnode1' succeeded
CRS-2676: Start of 'ora.cssd' on 'myracnode1' succeeded
CRS-2672: Attempting to start 'ora.ctssd' on 'myracnode1'
CRS-2672: Attempting to start 'ora.cluster_interconnect.haip' on 'myracnode1'
CRS-2676: Start of 'ora.ctssd' on 'myracnode1' succeeded
CRS-2672: Attempting to start 'ora.evmd' on 'myracnode1'
CRS-2676: Start of 'ora.evmd' on 'myracnode1' succeeded
CRS-2676: Start of 'ora.cluster_interconnect.haip' on 'myracnode1' succeeded
CRS-2672: Attempting to start 'ora.asm' on 'myracnode1'
CRS-2676: Start of 'ora.asm' on 'myracnode1' succeeded
CRS-2672: Attempting to start 'ora.crsd' on 'myracnode1'
CRS-2676: Start of 'ora.crsd' on 'myracnode1' succeeded

Start database(s). Either start each instance one by one, or omit “-i” option to so start all instances at once
[oracle]$ srvctl start instance –i mydb1 –d mydb

Using crsctl stop crs

You can also use "crsctl stop crs" command to stop all the cluster services, and it will also stop the OHASD, but it may also relocate certain RAC resources to other available nodes. So the preferred way is to always use "crsctl stop cluster" command to sop the cluster resources. 
If somehow you need to stop OHASD using "crsctl stop crs", then first stop all resources using "crsctl stop cluster", and once all resources have stopped, use "crsctl stop crs" command to stop the OHASD. 

No comments:

Popular Posts - All Times