请oracle817 for linux 应该如果设置才能自动启动?
操作系统:mandrake8.1
数据库:oracle8.1.7.01
我写一个简单的脚步文件/home/oracle/startdb.sh
svrmgrl <<EOF
connect internal/oracle
startup
EOF
然后在/etc/rc.local文件中加入
su - oracle -c "/u01/app/oracle/product/8.1.7/bin/lsnrctl start"
su - oracle -c "/home/oracle/startdb.sh"
但是数据库好像没有自动启动,每次都需要手工启动,请问应该如何设置才能启动启动呢,
先谢谢了!
# !/bin/sh
# chkconfig: 345 51 49
# description: starts the oracle dabase deamons
#
ORA_HOME=/u01/app/oracle/product/8.1.7
ORA_OWNER=oracle
case "$1" in
'start')
echo -n "Starting Oracle8i: "
su - $ORA_OWNER -c $ORA_HOME/bin/dbstart
touch /var/lock/subsys/oracle8i
echo
;;
'stop')
echo -n "Shutting down Oracle8i: "
su - $ORA_OWNER -c $ORA_HOME/bin/dbshut
rm -f /var/lock/subsys/oracle8i
echo
;;
'restart')
echo -n "Restarting Oracle8i: "
$0 stop
$0 start
echo
;;
*)
echo "Usage: oracle8i { start | stop | restart }"
exit 1
esac
exit 0
上面是脚本,放在/etc/rc.d/init.d/下的oracle8i中
然后运行下面的命令
# chmod 700 /etc/rc.d/init.d/oracle8i
# whoami
root
# cd /etc/rc.d/init.d/
# chkconfig --add oracle8i
# chkconfig --list oracle8i
oracle8i 0:off 1:off 2:off 3:on 4:on 5:on 6:off