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: Auto startup of db after reboot...

RE: Auto startup of db after reboot...

From: Ravindra Basavaraja <ravindra_at_sentica.com>
Date: Wed, 6 Dec 2000 17:56:19 -0000
Message-Id: <10702.123882@fatcity.com>


This is a multi-part message in MIME format.

------=_NextPart_000_003E_01C05FAD.D6B54A00 Content-Type: text/plain;

        charset="iso-8859-1"
Content-Transfer-Encoding: 7bit

use the dbstart file attached to this mail. it will work.i am using the same file.

Ravindra

-----Original Message-----
From: root_at_fatcity.com [mailto:root_at_fatcity.com]On Behalf Of Maser, Donna (SEA)
Sent: Wednesday, December 06, 2000 10:59 PM To: Multiple recipients of list ORACLE-L Subject: RE: Auto startup of db after reboot...

Hi Rocky,
  I copied this from metalink, in case you can not gain access:

Doc ID: Note:98418.1
Type: PROBLEM
Status: PUBLISHED
 Content Type: TEXT/PLAIN
Creation Date: 07-FEB-2000
Last Revision Date: 13-JUL-2000
Language: USAENG

Problem Description


  "dbstart" is a shellscript used on Unix platforms to start databases   listed in the "oratab" file. It is often called from system startup   scripts.

  The "dbstart" script shipped with all versions of Oracle up to and   including 8.1.6 does not start any 8.1.6 instances if they are down.   "dbstart" will report "Database <SID> warm started" rather than starting   the instance. This problem only affects 8.1.6 (or later) instances.

  The change in the banner may affect users custom startup / shutdown   scripts.

  "dbshut" has no problem.

  Please note there are 2 related issues which should be born in mind   when changing any startup / shutdown scripts:

     Advance notification of Server Manager desupport      [NOTE:74943.1]
     Advance notification of CONNECT INTERNAL desupport    [NOTE:50508.1]


Solution Description


  Enterprise Edition Workaround



  The workaround is to change the dbstart script to look for the string   "Oracle8i Enterprise Edition" instead of "PL/SQL" by making the following   changes:
  1. Save a copy of the 8.1.6 $ORACLE_HOME/bin/dbstart script
  2. Edit the script and change the 'awk' lines from: VERSION=`$ORACLE_HOME/bin/svrmgrl command=exit | awk '
    /PL\/SQL (Release|Version)/ {substr($3,1,3) ;
    print substr($3,1,3)}'` to: VERSION=`$ORACLE_HOME/bin/svrmgrl command=exit | awk '
    /PL\/SQL (Release|Version)/ { print substr($3,1,3); exit }
    /Oracle7 Server (Release|Version)/ { print substr($4,1,3); exit }
    /Oracle8i Enterprise Edition (Release|Version)/ { print
    substr($5,1,3); exit }
    /Oracle8i (Release|Version)/ { print substr($3,1,3); exit }'`
      Additionally for platforms which set LD_LIBRARY_PATH in the dbstart
      script you should change the following:
      From:
            LD_LIBRARY_PATH=${LD_LIBRARY_PATH}:${ORACLE_HOME}/lib ;
            export LD_LIBRARY_PATH
      To:
            LD_LIBRARY_PATH=${ORACLE_HOME}/lib:${LD_LIBRARY_PATH} ;
            export LD_LIBRARY_PATH


   3. Copy the updated "dbstart" to any location it is expected to reside.
      Eg: system startup scripts often run /usr/local/bin/dbstart.

      IMPORTANT: Do not overwrite existing scripts without taking a backup
                 copy first as the script you are overwriting may have
                 been modified.

   NOTE: This workaround will only work for Oracle8 Enterprise Editions
         Similar workarounds may be used for other editions.


Explanation


  The problem is caused by a change in the Oracle banner which is output   by Oracle version 8.1.6. The banner no longer includes a PL/SQL line   and so the test in "dbstart" for a PL/SQL version returns a blank string   which in turn causes the step to startup the instance to be skipped.

References


  The problem is reported in [BUG:1154931]

  The "oratab" file typically exists in either /etc/oratab or   /var/opt/oracle/oratab

  [NOTE:50508.1] - Advance notification of CONNECT INTERNAL desupport   [NOTE:74943.1] - Advance notification of Server Manager desupport

-----Original Message-----
Sent: Wednesday, December 06, 2000 7:23 PM To: Multiple recipients of list ORACLE-L

Hi gang,
The dbstart script on my 8.1.6 database on Solaris 8/Sun 450 doesn't seem to work. If I issue the dbstart command it returns:

OEM01 warm started

Whether the database is down or up. It doesn't start the database at all. I have the proper entry in my /var/opt/oracle/oratab file but no luck.

Any suggestions?

TIA,
-Rocky



Rocky Welch
Senior Consultant - Internet Services Group Arthur Andersen

The information contained in this email is intended for the personal and confidential use of the addressee only. It may also be privileged information. If you are not the intended recipient then you are hereby notified that you have received this document in error and that any review, distribution or copying of this document is strictly prohibited. If you have received this communication in error, please notify Celltech Group immediately on:

+44 (0)1753 534655, or email 'is_at_celltech.co.uk'

Celltech Group plc
216 Bath Road, Slough, SL1 4EN, Berkshire, UK

Registered Office as above. Registered in England No. 2159282

--
Please see the official ORACLE-L FAQ: http://www.orafaq.com
--
Author: Maser, Donna  (SEA)
  INET: DonnaMaser_at_chiroscience.com

Fat City Network Services    -- (858) 538-5051  FAX: (858) 538-5051
San Diego, California        -- Public Internet access / Mailing Lists
--------------------------------------------------------------------
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).

------=_NextPart_000_003E_01C05FAD.D6B54A00
Content-Type: application/octet-stream;
	name="dbstart"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
	filename="dbstart"

:
#
# $Header: dbstart.sh.pp 09-dec-99.09:51:46 mdenney Exp $ dbstart.sh.pp =
Copyr (c) 1991 Oracle
#

###################################
#=20
# usage: dbstart
#
# This script is used to start ORACLE from /etc/rc(.local).
# It should ONLY be executed as part of the system boot procedure.
#
#####################################

ORATAB=3D/var/opt/oracle/oratab

trap 'exit' 1 2 3
case $ORACLE_TRACE in
    T)	set -x ;;
esac
   =20
# Set path if path not set (if called from /etc/rc)
case $PATH in
    "")	PATH=3D/bin:/usr/bin:/etc
	export PATH ;;
esac

#
# Loop for every entry in oratab file and and try to start
# that ORACLE
#

cat $ORATAB | while read LINE
do
    case $LINE in
	\#*)		;;	#comment-line in oratab
	*)
#       Proceed only if third field is 'Y'.
        if [ "`echo $LINE | awk -F: '{print $3}' -`" =3D "Y" ] ; then
            ORACLE_SID=3D`echo $LINE | awk -F: '{print $1}' -`
	    if [ "$ORACLE_SID" =3D '*' ] ; then
		ORACLE_SID=3D""
	    fi
#           Called programs use same database ID
            export ORACLE_SID
            ORACLE_HOME=3D`echo $LINE | awk -F: '{print $2}' -`
#           Called scripts use same home directory
            export ORACLE_HOME
#           Put $ORACLE_HOME/bin into PATH and export.
            PATH=3D$ORACLE_HOME/bin:/bin:/usr/bin:/etc ; export PATH
#           add for bug # 652997
            LD_LIBRARY_PATH=3D${LD_LIBRARY_PATH}:${ORACLE_HOME}/lib ; =
export LD_LIBRARY_PATH

            PFILE=3D${ORACLE_HOME}/dbs/init${ORACLE_SID}.ora

#	Figure out if this is a V5, V6, or V7 database. Do we really need V5?
	    if [ -f $ORACLE_HOME/bin/sqldba ] ; then
		VERSION=3D`$ORACLE_HOME/bin/sqldba command=3Dexit | awk '
	                /SQL\*DBA: (Release|Version)/ {split($3, V, ".") ;
			print V[1]}'`
	    else
		if test -f $ORACLE_HOME/bin/svrmgrl; then
#		    VERSION=3D`$ORACLE_HOME/bin/svrmgrl command=3Dexit | awk '
#			/PL\/SQL (Release|Version)/ {substr($3,1,3) ;
#			print substr($3,1,3)}'`
# The following statement was added because the above statement
# can never get the right version. -Ravindra
		    VERSION=3D"8.1"
	    	else
			VERSION=3D"8.2"
	    	fi
	    fi
	    STATUS=3D1
	    if [ "$VERSION" =3D "8.1" ]=20
		then
		pmon=3D`ps -ef | egrep pmon_$ORACLE_SID  | grep -v grep`
		if [ "$pmon" !=3D "" ];=20
		then
		  STATUS=3D"-1"
		  echo "Database \"${ORACLE_SID}\" already started."
		fi
	    else=20
		if test -f $ORACLE_HOME/dbs/sgadef${ORACLE_SID}.dbf -o \
		     -f $ORACLE_HOME/dbs/sgadef${ORACLE_SID}.ora
	      then
	    	  STATUS=3D"-1"
	      else
		  STATUS=3D1
	      fi
	    fi

	    case $STATUS in
                1)  if [ -f $PFILE ] ; then
			case $VERSION in
			    6)  sqldba command=3Dstartup
				;;

			    7)  sqldba <<EOF
connect internal
startup
EOF
				;;

			   7.3) svrmgrl <<EOF
connect internal
startup
EOF
				;;
			   8.0) svrmgrl <<EOF
connect internal
startup
EOF
				;;
			   8.1) sqlplus /nolog <<EOF
connect internal
startup
EOF
				;;
			esac

                        if test $? -eq 0 ; then
			    echo ""
		            echo "Database \"${ORACLE_SID}\" warm started."
			else
			    echo ""
                            echo "Database \"${ORACLE_SID}\" NOT =
started."
		        fi
                    else
			echo ""
                        echo "Can't find init file for Database =
\"${ORACLE_SID}\"."
                        echo "Database \"${ORACLE_SID}\" NOT started."
		    fi
                    ;;

		-1) echo ""
		    echo "Database \"${ORACLE_SID}\" possibly left running when system =
went down (system crash?)."
                    echo "Notify Database Administrator."
		    case $VERSION in
			6)  sqldba "command=3Dshutdown abort"
			    ;;

			7)  sqldba <<EOF
connect internal
shutdown abort
EOF
			    ;;

		      7.3)  svrmgrl <<EOF
connect internal
shutdown abort
EOF
			    ;;
		      8.0) svrmgrl <<EOF
connect internal
shutdown abort
EOF
			    ;;
		      8.1) sqlplus /nolog <<EOF
connect internal
shutdown abort
EOF
			    ;;

		    esac

                    if test $? -eq 0 ; then
			if [ -f $PFILE ] ; then
			    case $VERSION in
				6)  sqldba command=3Dstartup
				    ;;

				7)  sqldba <<EOF
connect internal
startup
EOF
				    ;;
			      7.3)  svrmgrl <<EOF
connect internal
startup
EOF
				    ;;
			      8.0) svrmgrl <<EOF
connect internal
startup
EOF
				    ;;
			      8.1) sqlplus /nolog <<EOF
connect internal
startup
EOF
				    ;;

			    esac
                            if test $? -eq 0 ; then
				echo ""
				echo "Database \"${ORACLE_SID}\" warm started."
			    else
				echo ""
				echo "Database \"${ORACLE_SID}\" NOT started."
Received on Wed Dec 06 2000 - 11:56:19 CST

Original text of this message

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