Oracle Restart with Oracle Database 12c (12.1.0.1)

Back in October, I wrote a blog post on adding an Oracle 11g Database to Oracle Restart 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 talked with a few friends in the Oracle space looking for a similar solution to use with Oracle 12c Database.  At the time of these discussions, nobody knew of a simple way to restart Oracle 12c databases on reboot, especially with Oracle Restart.

Note: Oracle has deprecation of the Oracle Restart feature in 12c.  Check out this blog post for specifics on using 12c GI to implement a workaround (here).  Also more information can be found in MOS Note: 1584742.1

This brings me to my testing today.  To be honest, I actually stumbled across this because I was bored and just “wanted to see” if it could be done.  Outlined below is what I did to get Oracle 12c Database to work with Oracle Restart. 

Environment:

Oracle Enterprise Linux 6.4
Oracle Restart 11g (latest release)
Oracle Database 12c (12.1.0.1)

As I outlined in my previous post of adding a database to Oracle Restart (here), you need to provide the details of what you want Oracle Restart to do when you shutdown and start your sever.  Here is the command I used to add the Oracle 12c Database to Oracle Restart:

srvctl add database
-d bc12c
-o /oracle/app/product/12.1.0.1/dbhome_1
-m acme.com
-p /oracle/app/product/12.1.0.1/dbhome_1/dbs/spfilebc12c.ora
-s OPEN
-t IMMEDIATE
-y AUTOMATIC

One thing to note here, is the SRVCTL command to add the database to Oracle Restart is actually in the Oracle 12c Database home (/oracle/app/product/12.1.0.1/dbhome_1/bin).  If you try to add the database using the SRVCTL command from the CRS(GRID) home, it will error and tell you to use the correct version of SRVCTL.

Error:

PRCD-1025 : Failed to create database bc12c
PRCT-1402 : Attempt to retrieve version of SRVCTL from Oracle Home /oracle/app/product/12.1.0.1/dbhome_1/bin failed. Detailed error:
PRKC-1137 : Unable to find Version object with string value 12.1.0.1.0

After changing to the Oracle home for Oracle Database 12c,  I then was able to add the database to Oracle Restart using SRVCTL.  After successfully running the add command,  I could see that the Oracle 12c Container Database was added to the CRS stack in an offline status.

[oracle@oel bin]$ crsctl status res -t
——————————————————————————-
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
——————————————————————————-
Local Resources
——————————————————————————-
ora.LISTENER.lsnr
               ONLINE  ONLINE       oel
ora.LISTENER_TEMP.lsnr
               ONLINE  ONLINE       oel
ora.ons
               OFFLINE OFFLINE      oel
——————————————————————————-
Cluster Resources
——————————————————————————-
ora.bc11g.db
      1        ONLINE  ONLINE       oel                      Open
ora.bc12c.db
      1        OFFLINE OFFLINE

ora.cssd
      1        ONLINE  ONLINE       oel
ora.diskmon
      1        OFFLINE OFFLINE
ora.evmd
      1        ONLINE  ONLINE       oel

 

Note: Start the database using SRVCTL from the Oracle Database 12c home.

Now, that I have added the database to the Oracle Restart (CRS) stack, the question was will Oracle Restart stop and and then restart the Oracle 12c Database?  The short answer is yes!  Once I issued a reboot command on my server, I could see the 12c database being stopped and then on boot up I verified that the database had been started from the CRS stack.

[oracle@oel bin]$ crsctl status res -t
——————————————————————————-
NAME           TARGET  STATE        SERVER                   STATE_DETAILS
——————————————————————————-
Local Resources
——————————————————————————-
ora.LISTENER.lsnr
               ONLINE  ONLINE       oel
ora.LISTENER_TEMP.lsnr
               ONLINE  ONLINE       oel
ora.ons
               OFFLINE OFFLINE      oel
——————————————————————————-
Cluster Resources
——————————————————————————-
ora.bc11g.db
      1        ONLINE  ONLINE       oel                      Open
ora.bc12c.db
      1        ONLINE  ONLINE       oel                      Open

ora.cssd
      1        ONLINE  ONLINE       oel
ora.diskmon
      1        OFFLINE OFFLINE
ora.evmd
      1        ONLINE  ONLINE       oel

 

Note: I did not add the 12c listener to the restart process.  Since this worked with the database, you could add the listener as well.

Now my question was, “did the pluggable databases (PDBs) start”?  From looking through SQL*Plus, the PDBs were mounted but not opened.  Leaving me to believe that the CDB was successfully started using Oracle Restart.  You will need to manually start the PDBs!

SQL> select name, open_mode from v$pdbs;

NAME                           OPEN_MODE
—————————— ———-
PDB$SEED                       READ ONLY
BCPDB1                         MOUNTED
BCPDB2                         MOUNTED

Summary

In short, you can use Oracle Restart with Oracle Database 12c (12.1.0.1).  However, I’m pretty sure that this is not a supported configuration and Oracle Support may frown upon actually doing this.  I would actually recommend against  doing this unless you get buy-in and support from Oracle on the configuration.

Enjoy!

twitter: @dbasolved

blog: http://dbasolved.com

About these ads

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

Martins Blog

Trying to explain complex things in simple terms

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

Carlos Sierra's Tools and Tips

Tools and Tips for Oracle Performance and SQL Tuning

Follow

Get every new post delivered to your Inbox.

Join 1,457 other followers

%d bloggers like this: