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”. 
  • 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. Since “crsctl stop/start cluster” is dependent on OHASD, this command cannot perform any operation on 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.
  • “crsctl start cluster” will start all cluster resources regardless of their previous state when cluster services were stopped last time. For example, if a database resource was stopped previously before taking down the cluster services, “crsctl start cluster” will start this database resource. But in case we use “crsctl start crs”, it won’t start this database resource because it has to restore each restore to its previous state.
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.

[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

As explained above, please note that “crsctl start crs” actually starts the CRS, which may not start all your cluster resources because CRS might restore cluster resources to their last known state (which could be START or STOP). Whereas starting cluster would start all cluster resources (VIP, ASM, Listener etc.)


No comments:

Post a Comment