lubinsu:/usr/u01/app/product/11.2.0/dbhome_1:Y
#!/bin/sh
# chkconfig: 345 61 61
# description: Oracle 11g release 2 autorun services
JAVA_HOME=/home/lubinsu/soft/app/jdk7
CLASSPATH=/usr/u01/app/product/11.2.0/dbhome_1/JRE:/usr/u01/app/product/11.2.0/dbhome_1/jlib:/usr/u01/app/product/11.2.0/dbhome_1/rdbms/jlib
ORACLE_BASE=/usr/u01/app; export ORACLE_BASE
ORACLE_HOME=$ORACLE_BASE/product/11.2.0/dbhome_1; export ORACLE_HOME
ORACLE_SID=lubinsu; export ORACLE_SID
export JAVA_HOMEexport CLASSPATH
export PATH=$PATH:$ORACLE_HOME/bin
ORA_OWNR="oracle"
if [ ! -f $ORACLE_HOME/bin/dbstart -o ! -d $ORACLE_HOME ]
then
echo "Oracle startup: cannot start"
exit 1
fi
# of the instance and listener or usage display
start)
# Oracle listener and instance startup
su $ORA_OWNR -lc $ORACLE_HOME/bin/dbstart
echo "Oracle Start Succesful!OK."
;;
stop)
# Oracle listener and instance shutdown
su $ORA_OWNR -lc $ORACLE_HOME/bin/dbshut
echo "Oracle Stop Succesful!OK."
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo $"Usage: `basename $0` {start|stop|reload|reload}"
exit 1
esac
;;
stop)
# Oracle listener and instance shutdown
su $ORA_OWNR -lc $ORACLE_HOME/bin/dbshut
echo "Oracle Stop Succesful!OK."
;;
#
chkconfig --add oralubinsu
--現在還可以這麼啓動關閉數據庫:
[root@200-168-1-4 init.d]#
service oralubinsu stop
Processing Database instance "lubinsu": log file /usr/u01/app/product/11.2.0/dbhome_1/shutdown.log
Oracle Stop Succesful!OK.
[root@200-168-1-4 init.d]# service oralubinsu start
Processing Database instance "lubinsu": log file /usr/u01/app/product/11.2.0/dbhome_1/startup.log
Oracle Start Succesful!OK.