# chkconfig: 345 99 10
# description: Startup Script for Oracle Databases
# /etc/rc.d/init.d/oradbstart
export ORACLE_BASE=/u01/app/Oracle/
export ORACLE_HOME=/u01/app/Oracle/product/10.2.0/db_1
export ORACLE_SID=orcl
export PATH=$PATH:$ORACLE_HOME/bin
case "$1" in
start)
su oracle -c $ORACLE_HOME/bin/dbstart
touch /var/lock/oracle
echo "OK"
;;
stop)
echo -n "Shutdown Oracle: "
su oracle -c $ORACLE_HOME/bin/dbshut
rm -f /var/lock/oracle
echo "OK"
;;
*)
echo "Usage: 'basename $0' start|stop"
exit 1
esac
exit 0 4.修改脚本的运行权限 $su - root #chown oracle.oinstall /etc/rc.d/init.d/oradbstart #chmod 775 /etc/rc.d/init.d/oradbstart 5.把oradbstart 服务添加到 chkconfig 中 chkconfig --add oradbstart chkconfig --list oradbstart
本文出自 “相信自己” 博客,请务必保留此出处http://yesican.blog.51cto.com/700694/247393