With Oracle Real Application Clusters the Oracle database can be configured to restart as each node in the cluster is restarted. For single instance databases that are on a standalone server, often times the database is not configured to restart on a server bounce. In the past, Oracle recommended to set the database for restart in the /etc/oratab file and create as script in the /etc/init.d directory to force the restart. This approach often times did not work (in my experience). How do we enable a restart of a single instance database successfully?
Oracle Restart! Oracle Restart is a component of the Oracle Grid Infrastructure (GI) package which is used to configure a restart of items on the server, ie Oracle Database (single instance). The added benefit of using Oracle Restart (Grid Infrastructure) is the usage of Automatic Storage Management (ASM) is included. Databases that are created after Oracle Restart is installed will use ASM; all previous databases (file system based) will not be configured in the Cluster Ready Service (CRS) stack. How do we add a database to the CRS stack after Oracle Restart is installed?
To add a database to the CRS stack, we need to use the Server Control (SRVCTL) command. The below command will add a database named “bc11gtst” to the stack and enable it to be restarted when the server is restarted. Each of the options used can be looked up with the help option ($GRID_HOME/bin/srvctl –h).
srvctl add database
After configuring the database in the CRS, if the need to remove it from the CRS arises; the following command can be used.
srvctl remove database
As with the CRS ona full RAC, we can get the list of targets and check on the status of them using the same command (crs_stat –t –v).
[[email protected] Desktop]$ crs_stat -t -v
Name Type R/RA F/FT Target State Host
ora.DATA.dg ora….up.type 0/5 0/ ONLINE ONLINE tester
ora….ER.lsnr ora….er.type 0/5 0/ ONLINE ONLINE tester
ora.asm ora.asm.type 0/5 0/ ONLINE ONLINE tester
ora….gtst.db ora….se.type 0/2 0/1 ONLINE ONLINE tester
ora.cssd ora.cssd.type 0/5 0/5 ONLINE ONLINE tester
ora.diskmon ora….on.type 0/10 0/5 OFFLINE OFFLINE
ora.evmd ora.evm.type 0/10 0/5 ONLINE ONLINE tester
ora.ons ora.ons.type 0/3 0/ OFFLINE OFFLINE
In closing, using Oracle Restart is a great approach to enabling single instance databases for successful restarts. Also, the ability to use Automatic Storage Management (ASM) and Cluster Ready Services (CRS) enables a DBA to learn more about these options before moving to a full Real Application Cluster (RAC). More information can be found here.