更改/etc/oratab中第三列值为Y,默认为N,也可更改为W
格式如下: orcl:/u01/oracle/product/11.2/db_1:Y
编写启动服务,在/etc/init.d/创建
简单如下:
#!/bin/sh
OPT_=$1
case "$OPT_" in
start)
/bin/echo "$0 : (start)"
su - oracle -c "/u01/oracle/product/11.2/db_1/bin/lsnrctl start"
su - oracle -c "/u01/oracle/product/11.2/db_1/bin/dbstart"
exit 0
;;
stop)
/bin/echo "$0 : (stop)"
su - oracle -c "/u01/oracle/product/11.2/db_1/bin/lsnrctl stop"
su - oracle -c "/u01/oracle/product/11.2/db_1/bin/dbshut"
exit 0
;;
*)
/bin/echo ‘‘
/bin/echo "usage:$0 (start|stop)"
/bin/echo " Invalid argument ==> \"$OPT_\""
/bin/echo ‘‘
exit
;;
esac
设定随机启动关闭软连接
需要查看当前启动级别 /etc/inittab 最后一行
到对应目录结构下执行:
ln -s /etc/init.d/start_shut S99oracle
ln -s /etc/init.d/start_shut K01oracle
本文出自 “8016776” 博客,请务必保留此出处http://8026776.blog.51cto.com/8016776/1695947
原文地址:http://8026776.blog.51cto.com/8016776/1695947