在实际应用时,需要先启动数据库,再启动应用。
系统为:redhat6.3、oracle11g
以下是oracle自启动脚本:
vi /home/oracle/orastart.sh
-
#!/bin/sh
-
su - oracle <<EOF
-
export ORACLE_SID=starboss
-
lsnrctl start
-
sqlplus /nolog <<EOF
-
conn / as sysdba
-
startup
-
exit
-
EOF
-
exit
-
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/
,如需转载,请注明出处,否则将追究法律责任。