Databases
cancel
Showing results for 
Search instead for 
Did you mean: 

Oracle (Start and Stop) automatically when server does reboot

Tomas R. Martinez
Occasional Visitor

Oracle (Start and Stop) automatically when server does reboot

Hello,

I need to start and stop Oracle automatically in my server HPRP5470,OS HP-UX 11.0 when shutdown or boot is done.

Thanks in advance
3 REPLIES

Re: Oracle (Start and Stop) automatically when server does reboot

go read /usr/share/doc/start_up.txt

It is all explained in there
My house is the bank's, my money the wife's, But my opinions belong to me, not HP!
Tom Geudens
Honored Contributor

Re: Oracle (Start and Stop) automatically when server does reboot

Hi,
I added (in attachment) the necessary (example) /sbin/init.d and /etc/rc.config.d scripts.
Furthermore, from /sbin/rc2.d
root/sv00220#ll *oracle*
lrwxr-xr-x 1 root sys 32 Feb 20 10:18 K946oracle_datagatherer -> /sbin/init.d/oracle_datagatherer
lrwxr-xr-x 1 root sys 24 Feb 20 10:18 K947oracle_snmp -> /sbin/init.d/oracle_snmp
lrwxr-xr-x 1 root sys 28 Feb 20 10:17 K949oracle_listener -> /sbin/init.d/oracle_listener
lrwxr-xr-x 1 root sys 19 Feb 20 10:16 K950oracle -> /sbin/init.d/oracle

and in /sbin/rc3.d
root/sv00220#ll *oracle*
lrwxr-xr-x 1 root sys 19 Feb 20 10:20 S050oracle -> /sbin/init.d/oracle
lrwxr-xr-x 1 root sys 28 Feb 20 10:20 S051oracle_listener -> /sbin/init.d/oracle_listener
lrwxr-xr-x 1 root sys 24 Feb 20 10:20 S053oracle_snmp -> /sbin/init.d/oracle_snmp
lrwxr-xr-x 1 root sys 32 Feb 20 10:20 S054oracle_datagatherer -> /sbin/init.d/oracle_datagatherer

This should get you started,
Tom
A life ? Cool ! Where can I download one of those from ?
Andreas D. Skjervold
Honored Contributor

Re: Oracle (Start and Stop) automatically when server does reboot

Hi

Update /etc/oratab with SID:ORACLE_HOME:Y line for your database.

Put inplace init.d script dbora:
/sbin/init.d/dbora:
---
#!/sbin/sh
# Start/stop of Oracle database
#
ORA_HOME=/oracle/product/8.1.7
ORA_OWNER=oracle
if [ ! -f $ORA_HOME/bin/dbstart -o ! -d $ORA_HOME ]
then
echo "Oracle startup: cannot start"
exit
fi
case "$1" in
start_msg)
echo "Start ORACLE databases"
;;

stop_msg)
echo "Stop ORACLE databases"
;;
'start')
# Start the oracle databases
/usr/bin/su - $ORA_OWNER -c $ORA_HOME/bin/dbstart
;;
'stop')
# Stop the oracle databases
/usr/bin/su - $ORA_OWNER -c $ORA_HOME/bin/dbshut
;;
esac
---

Create link to runlevel directories:
ln -s /sbin/init.d/dbora /sbin/rc0.d/K10dbora
ln -s /sbin/init.d/dbora /sbin/rc2.d/S99dbora


You might also want to edit the $ORACLE_HOME/bin/dbshut script to read "shutdown immediate" instead of "shutdown"


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