oracle 服务脚本

软件集成
117
linux
linux 举报
04月15日 18:05
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


倒序看帖 只看楼主
推广信息