#! /bin/ksh # # $DBA/dbostopt # # Script to handle timeout of the dbostop calling script's failure to perform # a SHUTDOWN IMMEDIATE on the database. # # If this script waits more than the number of seconds in $1, the parent # dbostop script will be aborted, and it will then be re-executed with the # ABORT parameter. # # Parameters: # $1 = Unix pid of the parent dbostop process. # $2 = Number of seconds to wait for the "shutdown immediate" to occur. # # Restrictions: # 1) The DBA and ORACLE_SID environment variables must be defined. # 2) mailto must exist and be found in the PATH. # # <<<<<<<<<<<<<<<< MODIFICATION HISTORY >>>>>>>>>>>>>>>> # Date Programmer Description # 10/03/97 Brian Lomasky Original # if [ $# -ne 2 ]; then echo "Error - Incorrect number of parameters passed from dbostop" exit 2 fi echo "Waiting for up to $2 seconds for the database shutdown to occur..." sleep $2 echo "Database Shutdown Timeout has occurred!! - Aborting parent process" kill -9 $1 echo "" mailto "Retrying..." \ "dbostop: Timeout exceeded during $ORACLE_SID database shutdown!" echo "dbostop: Timeout exceeded during $ORACLE_SID database shutdown!\007" echo " Retrying database shutdown with ABORT option..." echo "" $DBA/dbostop $ORACLE_SID ABORT