#!/bin/ksh # oracle_start.sh # This script does the following: # # 1. Startup the database # # Author : Biju Thomas # Date : 08/22/97 # # Variables if test $# -ne 1 then echo 'ORACLE_SID should be passed in as a parameter' return 1 fi wdt=`date '+%m%d'` export ORACLE_SID=$1 export ORACLE_HOME=`find_ohome.sh ${ORACLE_SID}` export SHLIB_PATH=$ORACLE_HOME/lib:/usr/lib export TMPDIR=/tmp export LD_LIBRARY_PATH=$ORACLE_HOME/lib export SVRMGR=$ORACLE_HOME/bin/svrmgrl export wlogfile=ostart_log.$ORACLE_SID export werrfile=ostart_err.$ORACLE_SID # # Initialize log and err files # echo "**********************************************************************" > $werrfile echo "**********************************************************************" > $wlogfile # # Startup after Backup Begin Date and Time. # echo Startup after Backup Begin Time `date '+%m/%d/%y %X %A'` >> $wlogfile # # Bring back the database up # echo "Start Oracle Database" >> $wlogfile $SVRMGR >> $wlogfile <> $werrfile else echo "Database startup complete" >> $wlogfile fi # # If there are errors during the above steps, inform dbaoc # if test `cat $werrfile | wc -l` -ne 1 then echo "**********************************************************************" >> $werrfile echo "Verify $wlogfile for more details" >> $werrfile echo "Date : "`date '+%m/%d/%y %X %A '` >> $werrfile echo "Database : "$ORACLE_SID >> $werrfile echo "Server : "`uname -n` >> $werrfile echo "**********************************************************************" >> $werrfile mailx -s "Errors occured while oracle startup after cold backup - $ORACLE_SID" "mail@host.com" > /dev/null < $werrfile else echo "Successful completion of oracle startup after cold backup $ORACLE_SID" >> $wlogfile echo "No Errors / Alerts Encountered" >> $wlogfile echo "**********************************************************************" >> $wlogfile fi # # Startup after Backup End Date and Time. # echo Startup after Backup End Time `date '+%m/%d/%y %X %A'` >> $wlogfile # # PIN objects in SGA if script file available # if test -f ${ORACLE_SID}_sgapin.sql then echo "PINning objects to SGA..." >> $wlogfile $SVRMGR >> $wlogfile <> $wlogfile ${ORACLE_SID}_after_start.sh fi # # # end of script ##