starting oracle database automatically.

Posted by Searock on Super User See other posts from Super User or by Searock
Published on 2010-11-13T06:05:20Z Indexed on 2011/01/13 12:55 UTC
Read the original article Hit count: 316

Filed under:
|
|
|

I am using Fedora 8 and Oracle 10g Express Edition.

Every time I start my fedora I have to click on start database.

How can I add startdb.sh to startup so that it automatically executes when Fedora starts?

I have tried adding the path to /etc/rc.d/rc.local but it still doesn't work.

./usr/lib/oracle/xe/app/oracle/product/10.2.0/server/config/scripts/startdb.sh

I have even tried to add this script in /etc/init.d/oracle

#!/bin/bash
#
# Run-level Startup script for the Oracle Instance and Listener
#
# chkconfig: 345 91 19
# description: Startup/Shutdown Oracle listener and instance

ORA_HOME="/u01/app/oracle/product/9.2.0.1.0"
ORA_OWNR="oracle"

# if the executables do not exist -- display error

if [ ! -f $ORA_HOME/bin/dbstart -o ! -d $ORA_HOME ]
then
        echo "Oracle startup: cannot start"
        exit 1
fi

# depending on parameter -- startup, shutdown, restart 
# of the instance and listener or usage display 

case "$1" in
    start)
        # Oracle listener and instance startup
        echo -n "Starting Oracle: "
        su - $ORA_OWNR -c "$ORA_HOME/bin/lsnrctl start"
        su - $ORA_OWNR -c $ORA_HOME/bin/dbstart
        touch /var/lock/subsys/oracle
        echo "OK"
        ;;
    stop)
    # Oracle listener and instance shutdown
        echo -n "Shutdown Oracle: "
        su - $ORA_OWNR -c "$ORA_HOME/bin/lsnrctl stop"
        su - $ORA_OWNR -c $ORA_HOME/bin/dbshut
        rm -f /var/lock/subsys/oracle
        echo "OK"
        ;;
    reload|restart)
        $0 stop
        $0 start
        ;;
    *)
        echo "Usage: $0 start|stop|restart|reload"
        exit 1
esac
exit 0

and even this doesn't work.

startdb.sh is located at /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/config/scripts/startdb.sh

Thanks.

© Super User or respective owner

Related posts about startup

Related posts about fedora