分类: Oracle
2009-10-14 17:21:13
ORACLE 数据库自启动
1.修改 $ORACLE_HOME/bin/dbstart 和 $ORACLE_HOME/bin/dbshut
ORACLE_HOME_LISNER=$ORACLE_HOME的实际路径
2.修改 /etc/oratab 最的 N 改为 Y
3.加为linux服务:
# vi /etc/init.d/oracle
#!/bin/sh
# chkconfig: 35 90 90
# description: Oracle 11gR2
# /etc/init.d/oracle
#
# Run-level Stratup script for the Oracle Instance, Listener, and Web Interface
export LANG=zh_CN.GBK
export ORACLE_BASE=/db/app/oracle
export ORACLE_HOME=/db/app/oracle/product/
#export ORACLE_HOME_LISTNER=$ORACLE_HOME
export ORACLE_SID=alpha
export PATH=$PATH:$ORACLE_HOME/bin
ORA_OWNR="oracle"
case "$1" in
start)
su $ORA_OWNR -lc $ORACLE_HOME/bin/dbstart
echo "Oracle Start Successful!"
;;
stop)
su $ORA_OWNR -lc $ORACLE_HOME/bin/dbshut
echo "Oracle Stop Successful!"
;;
reload|restart)
$0 stop
$0 start
;;
*)
echo $"Usage: `basename $0` {start|stop|reload|restart}"
exit 1
esac
exit 0
#chmod 755 /etc/init.d/oracle
#chkconfig --add oracle
#chkconfig –list oracle