您的位置:首页 > 数据库 > Oracle

oracle10g在redhat4 下面的启动脚本

2007-11-12 14:36 316 查看
项目中需要用到一个在oracle下面能自动启动的脚本,在网上转了一圈之后经过测试和整理得到如下脚本

#!/bin/sh
#
# chkconfig: 35 95 1
# description: init script to start/stop oracle database 10g, TNS listener, EMS
#
#
# match these values to your environment:

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}"
exit 1
;;

esac

exit 0
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: