Edit the "/etc/oratab" file instance to 'Y'.

orcl:/u01/app/oracle/product/9.2.0:Y


Next, create a file called "/etc/init.d/dbora" as the root user, containing the following.



ORA_HOME=/u01/app/oracle/product/9.2.0
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/lsnrctl start"

su - $ORA_OWNER -c $ORA_HOME/bin/dbstart
;; '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
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop" ;;
esac

chmod 750 /etc/init.d/dbora

chkconfig --level 345 dbora on

0 comments