1. #vi /etc/oratab
ruanko:/ruanko/app/oracle/oracle/product/10.2.0/ruanko:Y
将N改为Y
2#su - oracle
$ cd $ORACLE_HOME/bin
$vi dbstart
找到
ORACLE_HOME_LISTNER=/ruanko/app/oracle/oracle/product/10.2.0/ruanko
改为
ORACLE_HOME_LISTNER=$ORACLE_HOME
同理 dbshut
$exit
3 #cd /etc/rc.d/init.d
#vi oracle10g
#!/bin/bash
#whoami
#root
#chkconfig:315 51 49 (-定要写)
#description:start oracle (-定要写)
#
ORACLE_HOME=/ruanko/app/oracle/oracle/product/10.2.0/ruanko
ORALCLE_OWNER=oracle
case "$1" in
'start')
echo -n "start oracle"
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/dbstart" &
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl start"
touch /data/oracle10
echo
;;
'stop')
echo -n "shutdown oracle"
su - $ORACLE_OWNER -c "ORACLE_HOME/bin/dbshut" &
su - $ORACLE_OWNER -c "$ORACLE_HOME/bin/lsnrctl stop"
rm -fr /data/oracle10
echo
;;
'restart')
echo -n "restarting on oracle"
$0 stop
$0 start
echo
;;
*)
echo "usage:oracle"
exit 1
esac
#chmod a+x oracle10g
#/sbin/chkconfig --add oracle10g
如果出现这个就是上面脚本中没有(#chkconfig: #description:)这两个数
service oracle does not support chkconfig
/sbin/chkconfig --list oracle10g
chkconfig --add oracle10g
chkconfig --list oracle10g
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/16111659/viewspace-664796/
,如需转载,请注明出处,否则将追究法律责任。