Add database to Oracle Restart

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
-d bc11gtst
-o /opt/oracle/11.2.0.3/dbhome_1
-m acme.com
-p /opt/oracle/11.2.0.3/dbhome_1/dbs/spfilebc11gtst.ora
-s OPEN
-t IMMEDIATE
-y AUTOMATIC

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
-d bc11gtst
-f

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). 

[oracle@tester 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.

Enjoy!

twitter: @dbasolved

Blog: http://dbasolved.com

About these ads

2 comments

  1. Hi Curtis,
    Nice post. A few quick notes. crs_stat has been deprecated since 11gR2. Use crsctl status resource instead.
    Also since 12.1 Oracle Restart has been deprecated. While no one knows what exactly that means it is something to keep in mind. See MOS note 1584742.1 -Support Impact of the Deprecation Announcement of Oracle Restart.

  2. […] to help start the database on a server reboot (if you want to read that post, you can find it here).    Since my original post on using Oracle Restart to start a database, I’ve […]

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

Oracle Data Warrior

Changing the world, one data model at a time. How can I help you?

Maaz Anjum's Blog

A life yet to be lived...

PeteWhoDidNotTweet

Stuff that interests me, if not you!

The Oracle Instructor

Explain, Exemplify, Empower

Frits Hoogland Weblog

IT Technology; Oracle, linux, TCP/IP and other stuff I find interesting

Oracle Spin - Flimatech Blog

Sharing Our Database Experience

Oracle Scratchpad

Just another Oracle weblog

Oracle SQL Tuning Tools and Tips

SQL Tuning, eAdam, eDB360, SQLT, SQLHC

DBA Kevlar

Tips, tricks, (and maybe a few rants) so more DBAs become bulletproof!

Follow

Get every new post delivered to your Inbox.

Join 1,439 other followers

%d bloggers like this: