Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Mailing Lists -> Oracle-L -> Re: [Q] LINUX reboot does NOT automatic bring up database????

Re: [Q] LINUX reboot does NOT automatic bring up database????

From: Brian Haas <bhaas_at_musiciansfriend.com>
Date: Fri, 16 May 2003 15:16:47 -0800
Message-ID: <F001.0059B9AE.20030516151647@fatcity.com>


Mike,

here is what I use on a redhat box. I use redhat's init setup so take a look at the chkconfig line near the top. This allows you to user the chkconfig and service utils for this init script. This only starts one instance, but could be modified to use oratab to start up more than one. I copy this script to /etc/inti.d/oracle, then do a chkconfig 345 oracle on - this sets it to start on runlevels 3,4 and 5. To start/stop - service oracle [start/stop]. Obviously, this is for an 8i database so you need to change svrmgrl to sqlplus and get rid of connect internal. This has worked fine for me for the last 2 years without a problem.

HTH, -Brian

#!/bin/sh
#
# oracle This shell script takes care of starting and stopping
# the oracle database.
# The following line sets up chkconfig to start in levels 345, start prioroty
# 93 and stop priority 07
#
# chkconfig: - 345 93 07
# description: starts the oracle listener and the "internal" db instance.

ORACLE_HOME=<your oracle home>
ORACLE_SID=<your sid>
PATH=$PATH:$ORACLE_HOME/bin
export ORACLE_HOME ORACLE_SID PATH

# Source function library.

. /etc/rc.d/init.d/functions

# Source networking configuration.

. /etc/sysconfig/network

# Check that networking is up.

[ ${NETWORKING} = "no" ] && exit 0

RETVAL=0
# See how we were called.

case "$1" in

   start)

         # Start daemons.
         echo -n "Starting Oracle: "
         su - oracle -c /opt/oracle/release/8i/bin/lsnrctl > /dev/null 2>&1 \
                 <<EOF

start
quit
EOF
         su - oracle -c /opt/oracle/release/8i/bin/svrmgrl > /dev/null 2>&1 \
                 <<EOF

connect internal
startup
quit
EOF
         RETVAL=$?
         if [ $RETVAL -eq 0 ]
         then
                 touch /var/lock/subsys/oracle
                 echo_success
         else
                 echo_failure
         fi
         echo
         ;;
   stop)
         # Stop daemons.
         echo -n "Shutting down Oracle: "
         su  oracle -c /opt/oracle/release/8i/bin/lsnrctl > /dev/null 2>&1 \
                 <<EOF

stop
quit
EOF
         su  oracle -c /opt/oracle/release/8i/bin/svrmgrl > /dev/null 2>&1 \
                 <<EOF

connect internal
shutdown immediate;
quit
EOF
         RETVAL=$?
         if [ $RETVAL -eq 0 ]
         then
                 rm -f /var/lock/subsys/oracle
                 echo_success
         else
                 echo_failure
         fi
         echo
         ;;
   restart|reload)
         $0 stop
         $0 start
         RETVAL=$?
         ;;
   *)
         echo "Usage: oracle {start|stop|restart}"
         exit 1

esac

exit $RETVAL

mike mon wrote:

> We are test LINUX AS 2.1 with ORACLE 9ir2.  Currently
> one of functions    
> does not work.  It can NOT automatic bring up database
> after reboot.  We  
> have no problem under SUN SOlaris.  On LINUX:
> 
> 1. /etc/oratab have 'Y" setup
> 2. dbstart       -- work fine
> 3. dbora start   -- work fine
> 4. /etc/rc3.d/S99dbora link to dbora
> 5. reboot won't bring up database
> 
> 
> Any ideal?
> Thanks.
> 
> 
> 
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
> http://search.yahoo.com


-- 
/************************************************************
  * Brian Haas                bhaas_at_musiciansfriend.com      *
  * Database Administrator    Musician's Friend, Inc.        *
  * Phone:(541)774-5211       http://www.musiciansfriend.com *
  ************************************************************/

-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.net
-- 
Author: Brian Haas
  INET: bhaas_at_musiciansfriend.com

Fat City Network Services    -- 858-538-5051 http://www.fatcity.com
San Diego, California        -- Mailing list and web hosting services
---------------------------------------------------------------------
To REMOVE yourself from this mailing list, send an E-Mail message
to: ListGuru_at_fatcity.com (note EXACT spelling of 'ListGuru') and in
the message BODY, include a line containing: UNSUB ORACLE-L
(or the name of mailing list you want to be removed from).  You may
also send the HELP command for other information (like subscribing).
Received on Fri May 16 2003 - 18:16:47 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US