Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
cancel
Showing results for 
Search instead for 
Did you mean: 

Autostart Oracle on Reboot

SOLVED
Go to solution

Autostart Oracle on Reboot

Hi HP Gurus,

I've installed Oracle 8i on HP-UX. I would like to make it autostart after reboot.

I've just created a start/stop (oracle) under /sbin/init.d with start & stop parameters.

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
case $1 in
start)
. /home/vismgr/start.sh
;;
stop)
. /home/vismgr/stop.sh
;;
*)
echo "usage: $0 {start|stop}"
;;
esac
<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<

Script works fine from #prompt. To make it work automatic during reboot, what else I need to do? Please advice.
6 REPLIES
Scott Howell
Occasional Advisor

Re: Autostart Oracle on Reboot

Are you using dbshut/dbstart? I know with Oracle 8.1.6 there was an error with the dbstart script. I Just copied 'template' from /sbin/init.d to 'oracle' and filled in the 'start' and 'stop' sections of the 'oracle' script with dbstart and dbshut respectively. Also have you configured oratab correctly?

Re: Autostart Oracle on Reboot

Hi Scott,

The problem is not with the Oracle, since the scripts (start.sh&stop.sh) were written by me and works very well from # prompt. No issues on it. Only thing about the auto-startup the script after reboot.

From some of the questions posted to this site, I found that /sbin/init.d/oracle must link to /sbin/rcn.d....

My Question is, do we need to do any extra steps other than creating a script file under /sbin/init.d dircetory?

Regards,
Steven Sim Kok Leong
Honored Contributor

Re: Autostart Oracle on Reboot

Hi,

One common mistake in writing the startup/shutdown script is that the environmental settings are not set correctly in the script itself. When you test at the command line, the PATH settings and environment variables eg. ORACLE_SID that you specified in your .profile have already been set. However, if you are running the startup/shutdown script, your profile is not loaded, thus it is important that the necessary ENV eg. PATH settings are set correctly.

If you follow the HP-UX conventional way of writing a startup/shutdown script, you should also include the configuration file /etc/rc.config.d/oracle. This file should contain environment settings as well as the script startup flag eg. ORACLE=1. In your /sbin/init.d/oracle, source this file /etc/rc.config.d/oracle and add the condition that if ORACLE=1, then start/stop oracle else don't start/stop oracle during system startup or shutdown.

Hope this helps. Regards.

Steven Sim Kok Leong
Brainbench MVP for Unix Admin
http://www.brainbench.com
Email: steven@beepz.com. Homepage: https://www.beepz.com
Andreas Voss
Honored Contributor
Solution

Re: Autostart Oracle on Reboot

Hi,

for automatic start/stop you have to make symbolic links ie:

Start:
ln -s /sbin/init.d/oracle /sbin/rc3.d/S900oracle

Stop:
ln -s /sbin/init.d/oracle /sbin/rc2.d/K900oracle

Also add two additional case statements in your /sbin/init.d/oracle to have a message on the console at boot time:

start_msg)
echo "Starting ORACLE"
;;
stop_msg)
echo "Stopping ORACLE"
;;


Regards
Andreas D. Skjervold
Honored Contributor

Re: Autostart Oracle on Reboot

Hi
Might add that I use to edit the Oracle-supplied script dbshut so that it does "shutdown immediate" instead of shutdown normal.
Prevents you from having a system shutdown that hangs waiting for Oracle users to log out.

rgds
Andreas
Only by ignoring what everyone think is important, can you be aware of what everyone ignores!

Re: Autostart Oracle on Reboot

Thanks all of you!

And my Special Thanks to Andreas Voss for your info.

Regards,
Hari