Skip to Main Content

Infrastructure Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

dbora script (dbstart & dbshut)

matt_gloverSep 16 2008 — edited Sep 18 2008
OS: Oracle Enterprise Linux 5 Update 2 (x86_64)
DB: 10.2.0.4.0 Standard Edition

I'm trying to configure my Linux box so that the database and related utilities start and stop when the box is restarted. We did this in the 9i -> 10g certification class using a dbora script that basically just calls the dbstart and dbshut scripts as appropriate.

The dbstart and dbshut scripts write to a log file when they are called. I've been able to successfully have the dbstart script called when the box comes up, however the dbshut script doesn't seem to be being called when the box is going down. At least, the logfile for the shutdown script isn't being written to.

I'm still very new to Linux, so I'm not sure if there is any way to debug this. When I run the individual dbstart and dbshut scripts they appear to work, the db and dbcontrol page come up and down without a problem and the logs are written to. Here is a copy of the dbora script:
#
#!/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=/u01/app/oracle/product/10.2.0/db_1
#ORA_HOME=/u01/app/oracle/product/11.1.0/db_1
ORA_OWNER=oracle

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/dbstart $ORA_HOME"
        ;;
    '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/dbshut $ORA_HOME"
        ;;
esac
Here are the commands for the symbolic links I created:
chmod 750 /etc/rc.d/init.d/dbora
chgrp dba /etc/rc.d/init.d/dbora
ln -s /etc/rc.d/init.d/dbora /etc/rc3.d/S99dbora
ln -s /etc/rc.d/init.d/dbora /etc/rc3.d/K01dbora
ln -s /etc/rc.d/init.d/dbora /etc/rc5.d/S99dbora
ln -s /etc/rc.d/init.d/dbora /etc/rc5.d/K01dbora
I'm wondering if there is a problem with the dbora script, or maybe something like adding additional symbolic links for other run levels. Any help or assistance would be greatly appreciated.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Oct 16 2008
Added on Sep 16 2008
6 comments
11,100 views