Results 1 to 3 of 3
  1. #1
    Join Date
    Jul 2004
    Posts
    102

    Unanswered: Automatic start database and listener on boot

    Hi all,

    I'm using Oracle 9i on linux 9 (RedHat). My problem is Database and listener dose not start on boot. Please help me by given script and elaborate way to enable the script to start database and listener on boot. For your kind information i'm very new in linux.

    Thanks inadvance for your help
    Working Together...

  2. #2
    Join Date
    May 2003
    Location
    France
    Posts
    112
    You have to place a script in /etc/init.d, for example dbora, and create a link on it in /etc/rc2.d (the name is important(K19dbora) beacause unix use it to know the order of execution of the different scripts) :
    Don't forget to adapt ORA_HOME and ORA OWNR :
    ORA_HOME="/home/oracle/OraHome1"
    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 TEST"
    su - $ORA_OWNR -c "$ORA_HOME/bin/lsnrctl start TRIBORD"
    su - $ORA_OWNR -c "$ORA_HOME/bin/lsnrctl start TRIBORD2"
    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 TEST"
    su - $ORA_OWNR -c "$ORA_HOME/bin/lsnrctl stop TRIBORD"
    su - $ORA_OWNR -c "$ORA_HOME/bin/lsnrctl stop TRIBORD2"
    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


    This script use the standard oracle script to start/stop instance and listener. The instances are known by reading /etc/oratab.

    Rgds

  3. #3
    Join Date
    Jul 2004
    Posts
    102
    Thanks ndu35. I'll confirm you after testing your script.

    Thanks a lot.
    Working Together...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •