/etc/init.d/dbora:
#!/bin/sh
#
# chkconfig: 345 50 49
# description: starts the oracle dabase deamons
#
echo "Oracle 9i auto start/stop"
ORA_OWNER=oracle
ORA_HOME=/opt/oracle/product/9.0.1
case "$1" in
'start')
echo -n "Starting Oracle9i: "
su - $ORA_OWNER -c $ORA_HOME/bin/dbstart
echo -n "Starting the Listener for 9i: "
su - $ORA_OWNER -c "${ORA_HOME}/bin/lsnrctl start"
touch /var/lock/subsys/oracle9i
echo
;;
'stop')
echo -n "Shutting Oracle9i: "
su - $ORA_OWNER -c $ORA_HOME/bin/dbshut
echo -n "Shutting down Listener for 9i: "
su - $ORA_OWNER -c "${ORA_HOME}/bin/lsnrctl stop"
rm -f /var/lock/subsys/oracle9i
echo
;;
'restart')
echo -n "Restarting Oracle9i: "
$0 stop
$0 start
echo
;;
*)
echo "Usage: oracle9i {start | stop | restart }"
exit 1
esac
exit 0
|