Oracle 10G在Fedora6的自动启动

Oracle 10G在Fedora6的自动启动

用Oracle用户,将/etc/oratab文件修改为"Y",  如:TSH1:/u01/app/oracle/product/9.2.0:Y

将下面脚本保存到/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"<<EOO
lsnrctl start
sqlplus /nolog<<EOS
connect / as sysdba
startup
EOS
emctl start dbconsole
EOO
;;

stop)
su - "$ORACLE_USER"<<EOO
lsnrctl stop
sqlplus /nolog<<EOS
connect / as sysdba
shutdown immediate
EOS
emctl stop dbconsole
EOO
;;

*)
echo "Usage: $0 {start|stop}"
;;
esac
支持下