将下面脚本保存到/etc/init.d/dbora.
然后运行:chmod 750 /etc/init.d/dbora
最后将dbora加到服务中:chkconfig --level 345 dbora on
引用:#!/bin/bash
#
# chkconfig: 35 95 1
# description: init script to start/stop oracle database 10g, TNS listener, EMS
#
#
# match these values to your environment:
export ORACLE_BASE=/u01/app/oracle
export ORACLE_HOME=$ORACLE_BASE/product/10.2.0/db_1
export ORACLE_TERM=xterm
export PATH=/home/oracle/bin:$ORACLE_HOME/bin:$PATH
#export NLS_LANG='croatian_croatia.ee8iso8859p2'
export ORACLE_SID=TSH1
export DISPLAY=localhost:0
export ORACLE_USER=oracle
# see how we are called:
case $1 in
start)
su - "$ORACLE_USER"<lsnrctl start
sqlplus /nolog<connect / as sysdba
startup
EOS
emctl start dbconsole
EOO
;;
stop)
su - "$ORACLE_USER"<lsnrctl stop
sqlplus /nolog<connect / as sysdba
shutdown immediate
EOS
emctl stop dbconsole
EOO
;;
*)
echo "Usage: $0 {start|stop}"
;;
esac
Augseptm 于 2007-01-15 09:42:52发表:
支持下