[root@txzldb ~]# head -n 6 /etc/init.d/network >/etc/init.d/oracle10g
[root@txzldb ~]# vi /etc/init.d/oracle10g
# oracle oracle
#! /bin/bash
#
# oracle oracle start/shutdown
# chkconfig: 345 99 01
# description: oracle10g server
ORACLE_HOME=/u01/app/oracle/10g
if [ ! -f $ORACLE_HOME/bin/dbstart ]
then
echo "oracle cannot start"
exit
fi
if [ ! -f $ORACLE_HOME/bin/lsnrctl ]
then
echo "lsnrctl cannot start"
exit
fi
case "$1" in
'start')
echo "start oracle10g ..."
su - oracle -c "$ORACLE_HOME/bin/dbstart"
;;
'stop')
echo "stop oracle10g ..."
su - oracle -c "$ORACLE_HOME/bin/dbshut"
;;
*)
echo "usage $0:start|stop"
;;
esac
~
~
~
~
~
"/etc/rc.d/init.d/oracle10g" 36L, 520C written
[root@txzldb ~]# chmod a+x /etc/init.d/oracle10g
[root@txzldb ~]# chkconfig oracle10g on
[root@txzldb ~]# chkconfig oracle10g --list
oracle10g 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭