Friday, February 18, 2011

Oracle Auto DB Startup setup

I was able to configure the Auto DB start successfully following this link AutomatingDatabaseStartupAndShutdownOnLinux in DIT box and now every thing seems to be working fine..

Just an overview of what I have done, in 4 steps...as it may help

Step1 : edit file "/etc/oratab" and set the restart flag to Y for DB instance "orcldit"

orcldit:
/home/platform-idc/app/platform-idc/product/11.2.0/dbhome_3:Y

Step2.
Created a dbora file under /etc/init.d as the root user
#!/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=/home/platform-idc/app/platform-idc/product/11.2.0/dbhome_3
 
ORA_OWNER=platform-idc
 
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"
        touch /var/lock/subsys/dbora
        ;;
    '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"
        rm -f /var/lock/subsys/dbora
        ;;
esac


Step 3. chmod 750 /etc/init.d/dbora

Step 4. chkconfig --add dbora ........

After that restarted the linux and could see during the linux boot up the DB instance is also gets started...From 10g onwards the dbstart will in turn start the TNSlinstener, so we do NOT explicitly need to start that.

---------------------------------------Other ----------------------------------------------------

We had some issues with EM/DBconsole and had to redo this to get that up..
re-configure em completely

emctl stop dbconsole 
emca -repos drop 
emca -repos create 
emca -deconfig dbcontrol db 
emca -config dbcontrol db

No comments:

Post a Comment