ORA_HOME=/u01/oracle
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:
echo "Starting Oracle Databases ... "
su - $ORA_OWNER -c "$ORA_HOME/bin/dbstart"
echo "Done"
# Start the Listener:
echo "Starting Oracle Listeners ... "
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
echo "Done."
touch /var/lock/subsys/oracle
;;
'stop')
# Stop the Oracle Listener:
echo "Stoping Oracle Listeners ... "
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
echo "Done."
rm -f /var/lock/subsys/oracle
# Stop the Oracle Database:
echo "Stoping Oracle Databases ... "
su - $ORA_OWNER -c "$ORA_HOME/bin/dbshut"
echo "Done."
;;
'restart')
$0 stop
$0 start
;;
esac