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: ORAxxxx & trace files.

RE: ORAxxxx & trace files.

From: Rachel Carmichael <wisernet100_at_yahoo.com>
Date: Thu, 15 Nov 2001 12:38:57 -0800
Message-ID: <F001.003C6ADD.20011115122533@fatcity.com>

not my script, one of the other DBAs wrote it.

#!/bin/ksh
# This script traps any new errors in the alert file and email them
#

WORKIN=/opt/oracle/database/monitor
for INSTANCE in ftcs
do
  . $HOME/${INSTANCE}.sh
  LOOKIN=/opt/oracle/admin/$INSTANCE/bdump/alert_$INSTANCE.log   DATAFILE=$WORKIN/last_error_line.$INSTANCE   #
  cd $WORKIN
  #
  LASTERROR=`cat $DATAFILE`
  LASTERROR=${LASTERROR:-0}
  NEWERROR=`egrep -n 'ORA-|trc|failed' $LOOKIN | tail -1`
  ERRORNUM=`echo $NEWERROR|cut -d ":" -f1`
  ERRORNUM=${ERRORNUM:-0}

  if [ $ERRORNUM -gt $LASTERROR ]
  then
    echo $INSTANCE-$NEWERROR
    ATTIME=`date '+%m/%d/%Y %T'`
     mail $DBA_LIST <<EOD
${ATTIME}-$INSTANCE-$NEWERROR
EOD
  else
    echo "$INSTANCE-No error"
  fi
  #
  echo $ERRORNUM >$DATAFILE
done
Do You Yahoo!?
Find the one for you at Yahoo! Personals http://personals.yahoo.com
-- 
Please see the official ORACLE-L FAQ: http://www.orafaq.com
-- 
Author: Rachel Carmichael
  INET: wisernet100_at_yahoo.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).
Received on Thu Nov 15 2001 - 14:38:57 CST

Original text of this message

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