Tuesday, January 22, 2013

2 Oracle RAC management 2: Start/Stop RAC database

 

Stop the RAC database

Step 1: Check the RAC database status

srvctl status database -d DATBASE_UNIQUE_NAME
ps -ef |grep -i smon

Each node has one database instance and one ASM instance.Therefore, the ps –ef |grep –i  smon would see 2 smon processes. One for ASM and another one for database.

image

Step 2: Shutdown database instance via srvctl

srvctl stop databsae -d DATABASE_UNIQUE_NAME
ps -ef |grep -i smon
srvctl status databsae -d DATABASE_UNIQUE_NAME
crsctl status resource RESOURCE_NAME -t

The srvctl stop database would shutdown the database instance on both nodes.

image

Step3: shutdown the clusterware

To shutdown the clusterware, we can not just use oracle or grid account. It would give us the “CRS-4563: Insufficient user privileges” error.

image

su to root , Source the environment for grid and Check the cluster resource status

crsctl status resource -t 

image

crsctl stop cluster

From screenshot below, we can see once we shutdown the cluster resource from RAC1 node, the clusterware would failover to the other node.

image

To verify the clusterware is complete shutdown on the node1 (RAC1), we can use crsctl status resource to check. We would get the “CRS-4535: Cannot communicate with Cluster Ready Services

image

Therefore, in order to complete shutdown the clusterware on all node, we have to run the crsctl stop cluster on all nodes.

On the node2, if we run check the cluster resource ( crsctl status resource –t), we would see the resource is in the failover state.

image

image

Start the RAC database

Step1: Check clusterware is not running

crsctl status resource -t

image

Step2: Use root to start the clusterware

root user needs to source the grid environment.  This needs to be perform on all RAC nodes.

crsctl start cluster

image

image

Step3: Check the cluster resource and ASM instance

crsctl status resource -t
ps -ef |grep -i smon

image

image

Step4: Start the Oracle database instance

This would start the database instance on all the RAC nodes.

srvctl start database -d RAC1

There is no output from above command, just use the crsctl status resource to check the database resource. We can also check the smon processes.

image

We should see 2 smon processes on the host.

image

Step5: Start the OEM

OEM is not part of cluster resource. If you have shutdown earlier, we need to bring it up.

emctl start dbconsole

2 comments:

  1. Very good article, use this procedure to successfully restart my RAC.

    ReplyDelete

 

SQL Panda Copyright © 2011 - |- Template created by O Pregador - |- Powered by Blogger Templates