RAC

How to Automatically Startup RAC Database after System Reboots

After installing grid infrastructure, you will have Oracle Clusterware, also called Cluster Ready Service, CRS controls all Oracle cluster components as resources, and manages the dependencies among resources, so it can coordinate their start and stop priority.

Restarting a database server will bring CRS up (ohasd), once CRS is up, CRS will arrange the resources to start according to the planned configuration.

One resource called ora.dbname.db is related to database, it can be planned the target state to ONLINE or OFFLINE by setting an attribute of AUTO_START. There are three options of AUTO_START:

  1. always: starts the resource ONLINE automatically after the node server restart.
  2. restore: remains the resource state as same as when the node server was shutdown, which means, if it was ONLINE/OFFLINE, then restarts the resource as ONLINE/OFFLINE.
  3. never: does not restart the resource after node server restart.

Now, let’s check the current configuration of ora.dbname.db:

[grid@primary01 ~]$ crsctl status resource ora.dbname.db -p | grep AUTO_START
AUTO_START=restore

If you want to start database automatically every time the server restart, you can set AUTO_START to “always”:

[grid@primary01 ~]$ crsctl modify resource ora.dbname.db -attr AUTO_START=always
[grid@primary01 ~]$ crsctl status resource ora.dbname.db -p | grep AUTO_START
AUTO_START=always

For 12.1.0.2, you might see CRS-4995 like this:

[grid@primary01 ~]$ crsctl modify resource ora.dbname.db -attr AUTO_START=always
CRS-4995:  The command 'Modify  resource' is invalid in crsctl. Use srvctl for this command.

If something’s wrong with the above statement, you can use the following commands:

[grid@primary01 ~]$ su -
Password:
[root@primary01 ~]# . /home/grid/.bash_profile
[root@primary01 ~]# crsctl modify resource ora.dbname.db -attr AUTO_START=always -unsupported

Just add an option -unsupported to proceed.

In my opinion, the option “restore” of AUTO_START is more reasonable for DBA to consider, here are my reasons:

  1. Sometimes server restart is for maintenance works or unplanned operations, these works need DBA’s interventions to select a proper state to startup. In such case, you don’t want to start database to start option.
  2. If the server restart is a planned restart, then keeping the state of the database will be more efficient.

Leave a Reply

Your email address will not be published. Required fields are marked *