background image
<< stablishing volume copies | Automate responses >>
<< stablishing volume copies | Automate responses >>

Error log check

Oracle on the Sun Solaris OS Scripts . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
C-30
Remote Mirroring of an Oracle Database Using Data Replicator Software
##################################################
# Restarting local database (crossing fingers) #
##################################################
# Assumed root user has database priviledges (probably a bad
assumption) ?
display "Restarting local database"
if [[ $DB_TYPE == 'db2' ]]; then
$RMT_SCRIPT_DIR/.remote/$DB_TYPE/db_start $RMT_DB_ID
$DB_NAME $RMT_LOG_DIR
STATUS=$?
elif [[ $DB_TYPE == 'oracle' ]]; then
$RMT_SCRIPT_DIR/.remote/$DB_TYPE/db_start $PRI_DB_ID
$ORA_SID $ORA_HOME $ORA_DUMP $LOG $TRACE $RMT_SCRIPT_DIR
$ORA_BASE $PRI_HOST
STATUS=$?
sleep 1
fi
if (( STATUS > 0 )); then
Kill_WAIT 1
echo "\t${B1}ERROR:${EB} Bummer, can't restart local
database!"
echo "\tCheck the $RMT_LOG_DIR/$DB_NAME.trace file for
details."
echo `date +%T`" ERROR! - Can not restart local database!"
>> $LOG
echo `date +%T`" Check $RMT_LOG_DIR/
$DB_NAME.trace" >> $LOG
else
echo "\n# rm $RMT_LOG_DIR/$DB_NAME.trace" >> $TRACE
rm $RMT_LOG_DIR/$DB_NAME.trace >> $TRACE 2>&1
echo `date +%T`" SUCCESS - Local database has been
restarted" >> $LOG
Kill_WAIT 0
fi
#######################
# Error log check #
#######################
ESTATUS=`cat $LOG |grep -c 'ERROR'`
WSTATUS=`cat $LOG |grep -c 'WARNING'`
if [[ $ESTATUS != 0 || $WSTATUS != 0 ]]; then
echo `date +%T`" *** $ESTATUS ERROR(S) occurred during
script execution! ***" >> $LOG
echo `date +%T`" *** $WSTATUS WARNINGS(S) occurred during
script execution! ***" >> $LOG