我的几个linux引导脚本出现了问题,特别是启动Oracle10g数据库和oc4j容器的那些脚本。
我使用了chkconfig告诉Linux在容器之前启动数据库,然而,容器似乎在数据库之前启动,这是oc4j根本不喜欢的。我可以访问我的应用程序,但是,我没有数据库连接。如果我重新启动oc4j,一切工作正常。
有没有一种方法可以“暂停”oc4j的启动,直到数据库(和侦听器)都启动并准备好连接?
发布于 2010-02-09 15:56:49
将它们放在1个启动脚本中?
start listener
start database
start appserver这是我的/etc/init.d/dbora脚本。添加启动OC4J的调用
#!/bin/sh
# chkconfig: 345 99 10
# description: Oracle auto start-stop script.
#
# Set ORA_HOME to be equivalent to the $ORACLE_HOME
# from which you wish to execute dbstart and dbshut;
#
# Set ORA_OWNER to the user id of the owner of the
# Oracle database in ORA_HOME.
ORA_HOME=/app/oracle/product/10.2.0/db_1
ORA_OWNER=oracle
echo $1
if [ ! -f $ORA_HOME/bin/dbstart ]
then
echo "Oracle startup: cannot start"
exit
fi
case "$1" in
'start')
# Start the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl start"
su - $ORA_OWNER -c $ORA_HOME/bin/dbstart
su - $ORA_OWNER -c $ORA_HOME/bin/emctl start dbconsole
;;
'stop')
# Stop the Oracle databases:
# The following command assumes that the oracle login
# will not prompt the user for any values
su - $ORA_OWNER -c $ORA_HOME/bin/emctl stop dbconsole
su - $ORA_OWNER -c $ORA_HOME/bin/dbshut
su - $ORA_OWNER -c "$ORA_HOME/bin/lsnrctl stop"
;;
esachttps://stackoverflow.com/questions/2222681
复制相似问题