Automatic start of Oracle database on Linux
In certain cases Oracle does not start automatically on Linux after installation.
To fix this, you need to do these steps:
Modify oratab
vi /etc/oratab
change the “N” at the end => “Y”
For example:
From: orcl:/u01/app/oracle/product/11.2.0/dbhome_1:N
To: orcl:/u01/app/oracle/product/11.2.0/dbhome_1:Y
Create a dbora file under /etc/init.d/
vi /etc/init.d/dbora
#!/bin/sh
# chkconfig: 345 99 10
# description: Automatic Oracle database start-stop script.
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.
ORA_HOME=/u01/app/oracle/product/11.2.0/dbhome_1
ORA_OWNER=oracle
if [ ! -f $ORA_HOME/bin/dbstart ]
then
echo “Oracle startup: cannot start”
exit
fi
case “$1″ in
’start’)
# Start Oracle databases:
su – $ORA_OWNER -c “$ORA_HOME/bin/dbstart $ORA_HOME”
touch /var/lock/subsys/dbora
;;
’stop’)
# Stop Oracle databases:
su – $ORA_OWNER -c “$ORA_HOME/bin/dbshut $ORA_HOME”
rm -f /var/lock/subsys/dbora
;;
esac
If you modify the script above, remember to keep the 3 first commented lines (shell, chkconfig and description).
Change the privileges to appropriate level with:
chmod 750 /etc/init.d/dbora
Now add the script to chkconfig:
chkconfig –add dbora
You can check this with:
$> chkconfig –list | grep db
dbora 0:off 1:off 2:off 3:on 4:on 5:on 6:off
You’re done, verify after next reboot:
ps -ef | grep smon
Tags: Auto-start, Automatic start, Linux, Oracle