In the previous article “How To Install Oracle 11g Database R2 on Solaris 10 Through SSH and VNC“, I have mentioned that I’ll provide the instruction to start the Oracle Database during system boot. So, this post is all about the simple nuts and bolts in how you can achieve starting the Oracle DB during boot time on Solaris 10 through SMF.


  • I will go through this tutorial by using a version of Oracle 11g R2 Database which had already been installed on my Solaris 10 x86-64 system. The DB was installed at the path /u01/app/oracle.
  • I would assume that all the necessary user groups like “dba“, “oper“, “oinstall” and the user “oracle” were already created and you could smoothly start the Oracle DB through the “dbstart” command.
  • I’ll be going through this tutorial independent from any environment variables that you’ve already defined for the “oracle” user.

Start-Stop-Restart Script:

Perform this as “root” user
Before we begin, there are a few important environment variables that you will need to take note at the below:

ORACLE_BASEThe Oracle Base Directory where the instances of Oracle Databases should reside. Usually, the path should be “/u01/app/oracle
ORACLE_HOMEThe Oracle Home Directory, where the specific version of the Oracle Database is installed. For Oracle 11g R2, it should be “/u01/app/oracle/product/11.2.0” (This directory will be the working directory for all of the task).
ORACLE_HOME_LISTENERThe Home Listener Directory. In this case, it should be same as $ORACLE_HOME for now
ORACLE_SIDThe SID value. In my system, I have “orclSID” as the value.
ORACLE_UNQNAMEThe Oracle Unique Name, which refers to the Database Name. For my case, it is “orclDB“, which was defined during installation.

These environment variables should be part of the start-stop-restart (SSR) script in that we’ll be using to below. So, do make sure that you could first define all of the values for the environment variables.

Do write a script and name it “oracle11gR2.server” with the below content, please place the script in the “/etc” directory.

As you can see, I had first defined the environment variables at the top and export them later. So, please change the paths/values accordingly depending on you’re the things that you had specify during your Oracle DB installation. This script will first start the Oracle 11g DB. Then, it will start the Enterprise Manager Console when the DB had started.

Once you have the script ready, you can test it out by issuing a command “sh oracle11gR2.server start” to start the services, “sh oracle11gR2.server restart” to restart the services and “sh oracle11gR2.server stop” to shutdown the services.

XML definition for Service Management Facility

Perform This As “root” User:
After testing the script, the next thing that is needed to do is to have the Oracle 11g Database startup service as part of the SMF for automated boot start. To do this, an XML file that describes the service is needed. You may want to create an XML file call “oracle_smf.xml”, create this file in the any directory that you are comfortable. For me, I’ll just place it in the “/usr/files” directory.

Initiating the SMF

Once you have the XML file ready, do the following as the “root” user:

  1. Change the directory to the path where you saved your XML file.
  2. Load the XML file into the SMF by typing: “svccfg -v import oracle_smf.xml
  3. To check if the service was part of the SMF, just type: “svccfg list | grep oracle11gR2
  4. Once the XML file is loaded, the SMF will automatically start the service. You can see if the service is being started by SMF, just type: “svcs | grep oracle11gR2”, you should be able to see that it is still offline initially because the starting of the database and the Enterprise Management Console will take a long time to start. Just do this a few times and you’ll be able to see it with the status “online”.
  5. You may use the “svcadm” command to enable, disable or restart the service:

    :- To enable the service:

    # svcadm enable oracle11gR2

    :- To disable the service

    # svcadm disable oracle11gR2

    :- To restart the service

    # svcadm restart oracle11gR2
  6. Just make sure that it is enabled for now.
  7. Once done, just restart the system by typing: “init 6
  8. When the system boots, to check whether if the Oracle DB and Enterprise management console had started correctly with the “svcs | grep oracle11gR2” command. Don’t worry if you see it “offline”, it will take some time to start and the status will change to “online” once the SMF had finished starting it.

What If Things Go Wrong?

In case if things went wrong in the oracle_smf.xml config file, you can always delete the Oracle11gR2 service from SMF by:

  1. Shutdown the service by typing “svcadm disable oracle11gR2“.
  2. Remove the service from SMF by typing: “svccfg delete oracle11gR2“.
  3. Change the contents of the SSR script “oracle11gR2.server” or the “oracle_smf.xml” file and re-import it to the SMF again by typing: “svccfg -v import oracle_smf.xml“.


I do very much like that Service Management Facility in Solaris 10 as it is a pretty cool and organized way of managing any boot-time services. I do hope that this short tutorial helps anyone who’s struggling to start the Oracle 11g DB during system boot time. The SSR script should be able to be used in the Linux environment as well with a little tweaking.

So, thank you for reading and good luck in trying this out.

Related Articles

Max Lam
About the Author

Born and currently resides in Malaysia, a seasoned Java developer whom had held positions as Senior Developer, Consultant and Technical Architect in various enterprise software development companies.

Related Posts

(adsbygoogle = window.adsbygoogle || []).push({}); Let’s face it, different Databases have...

Quite too often when developers are to setup a development, test or even the production environment...