![]() |
| Automatic Oracle 10g Startup and Shutdown at Ubuntu Linux system boot |
dbname:/u01/app/oracle/product/10.2.0/db_1:Nto something like
dbname:/u01/app/oracle/product/10.2.0/db_1:YCopy&paste the boot script code that follows into /etc/init.d/dbora (the file dbora doesn’t exists, so create it) and modify the bold values to reflect your installation:
#!/bin/sh
# description: Oracle auto start-stop script.
#
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.
ORACLE_HOME=/u01/app/oracle/product/10.2.0/db_1
PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_HOME PATH
ORA_HOME=/u01/app/oracle/product/10.2.0/db_1
ORA_OWNER=oracle
if [ ! -f $ORA_HOME/bin/dbstart ]
then
echo "Oracle startup: cannot start"
exit
fi
case "$1" in
'start')
# Start the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su $ORA_OWNER -c "$ORA_HOME/bin/dbstart $ORA_HOME"
;;
'stop')
# Stop the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su $ORA_OWNER -c "$ORA_HOME/bin/dbshut $ORA_HOME"
;;
esacCreate the symbolic links related to boot runlevels [since I'm a long-time-Slackware-user and pretty new to Ubuntu, I'm not well versed about Ubuntu boot system so feel free to correct me (the comments are at the end of the post)]:
ln -s /etc/init.d/dbora /etc/rc0.d/k01dboraRelease 2 bug: inside /u01/app/oracle/product/10.2.0/db_1/bin/dbstart there is a bug that will prevent the listener to start (Failed to auto-start Oracle Net Listener using /ade/vikrkuma_new/oracle/bin/tnslsnr); to solve change line 78 from
ln -s /etc/init.d/dbora /etc/rc1.d/k01dbora
ln -s /etc/init.d/dbora /etc/rc2.d/S99dbora
ln -s /etc/init.d/dbora /etc/rc3.d/S99dbora
ln -s /etc/init.d/dbora /etc/rc4.d/S99dbora
ORACLE_HOME_LISTNER=/ade/vikrkuma_new/oracle/bin/tnslsnr
to
ORACLE_HOME_LISTNER=$ORACLE_HOME
source : http://arjuna.deltoso.net/
