0

いくつかの Linux ブート スクリプト、特に Oracle 10g データベースと oc4j コンテナを起動するスクリプトに問題があります。

chkconfig を使用して Linux にコンテナーの前にデータベースを開始するように指示しましたが、oc4j がまったく好まないデータベースの前にコンテナーが開始するようです。アプリケーションにアクセスできますが、DB 接続がありません。oc4j を再起動すると、すべて正常に動作します。

データベース (およびリスナー) が両方とも開始され、接続の準備が整うまで、oc4j の開始を「一時停止」する方法はありますか?

4

1 に答える 1

1

それらを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"
        ;;
esac
于 2010-02-09T07:56:49.407 に答える