首页 > 数据库 > Oracle > 正文

将oracle加载为linux标准系统服务脚本

2024-08-29 13:45:36
字体:
来源:转载
供稿:网友

  将Oracle加载为linux标准系统服务脚本[root@test11 root]# more /etc/init.d/oracle
#!/bin/sh
 
#chkconfig: 2345 80 05
#description: Oracle 8 Server
 
ORA_HOME=/oracle/PRodUCt/9.2.0
ORA_OWNER=oracle
 
case "" in
"start")
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
su - $ORA_OWNER -c "$ORA_HOME/bin/start.sh"
;;
"stop")
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
su - $ORA_OWNER -c "$ORA_HOME/bin/shutdown.sh"
;;
esac

[root@test11 root]# more /oracle/product/9.2.0/bin/start.sh
sqlplus /nolog << EOF
connect / as sysdba
startup
exit
exit
echo "oracle have started"

[root@test11 root]# more /oracle/product/9.2.0/bin/shutdown.sh
sqlplus /nolog << EOF
connect / as sysdba
shutdown immediate
exit
exit
echo "oracle have shutdown"


#chkconfig --add oracle

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表