ITPub博客

首页 > 数据库 > Oracle > Linux 下oracle自启动脚本

Linux 下oracle自启动脚本

Oracle 作者:leixue0906 时间:2015-04-26 09:18:08 0 删除 编辑
在实际应用时,需要先启动数据库,再启动应用。
系统为:redhat6.3、oracle11g

以下是oracle自启动脚本:
vi /home/oracle/orastart.sh

  1. #!/bin/sh
  2. su - oracle <<EOF
  3. export ORACLE_SID=starboss
  4. lsnrctl start
  5. sqlplus /nolog <<EOF
  6. conn / as sysdba
  7. startup
  8. exit
  9. EOF
  10. exit
  11. EOF



在开机启动文件按如下配置,实现先启动数据库完成后,再启动实际应用。

# more /etc/rc.local 
#!/bin/sh
#
# This script will be executed *after* all the other init scripts.
# You can put your own initialization stuff in here if you don't
# want to do the full Sys V style init stuff.

touch /var/lock/subsys/local

/home/oracle/orastart.sh

/bin/sleep 60

su - root -c "cd /starboss/jboss-4.0.2/bin/ && nohup ./run.sh >>/dev/null 2>&1 &"

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/26845409/viewspace-1602321/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2012-07-26

  • 博文量
    90
  • 访问量
    437566