Linux 下oracle自啟動指令碼

leixue0906發表於2015-04-26
在實際應用時,需要先啟動資料庫,再啟動應用。
系統為: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部落格 ” ,連結:http://blog.itpub.net/26845409/viewspace-1602321/,如需轉載,請註明出處,否則將追究法律責任。

相關文章