Howto: Stop All RAC Instances in ORACLE_HOME

Say you have 30 databases running in one Oracle Home?  Maybe you have 30 but only 25 are up and you need to do maintenance on the OH.  Use the srvctl stop home command to save the current state of all resources owned by the target OH, then use the stop/start command to only bring those resources back online.
This feature was introduced in 11g.  For 12c the syntax is expanded it seems, you must now spell out -oraclehome and-statefile.  All arguments are mandatory and it’s rac aware.  In my example I can substitute rac2 for rac1 and get the correct output.
srvctl status home -oraclehome /u01/app/oracle/product/12.1.0/db_1 -statefile /tmp/state.txt -node rac1
output: Database ora12c is running on node rac1
this will create the state.txt file in tmp. contents of my file are ‘db-ora12c’
oracle@rac1 ~# srvctl status home -o /u01/app/oracle/product/11.2.0/db_1 -s state.txt -n rac1
Database d112d1 is running on node oradba1

The above command create a file called state.txt.

This state.txt file will be necessary to call the start and stop arguments.

srvctl start home -o ORACLE_HOME -s state_file [-n node_name]
srvctl start home -o /u01/app/oracle/product/11.2.0/db_1 -s ~/state.txt -n rac1
srvctl stop home -o ORACLE_HOME -s state_file [-t stop_options] [-n node_name] [-f]
srvctl stop home -o /u01/app/oracle/product/11.2.0/db_1 -s ~/state.txt -n rac1
srvctl status home -o ORACLE_HOME -s state_file [-n node_name]
srvctl status home -o /u01/app/oracle/product/11.2.0/db_1 -s ~/state.txt -n rac1

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s