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
- Mark Leith <mark_at_cool-tools.co.uk> wrote:
> Rachel,
>
> As always I would be interested in seeing your take on this! Please
> do send
> it over.
>
> Cheers
>
> Mark
>
> -----Original Message-----
> Carmichael
> Sent: 15 November 2001 16:15
> To: Multiple recipients of list ORACLE-L
>
>
> not that I know of... we have a script that runs in cron every 15
> minutes and looks for certain words, it's unix, is that usable?
>
>
> --- Mark Leith <mark_at_cool-tools.co.uk> wrote:
> > Hi list,
> >
> > Does anybody have a good list of all the ORA errors that will cause
> a
> > trace
> > file to be generated? We have a user of our tools that wants to
> > monitor for
> > any trace files/dumps being generated. I can think of two ways:
> >
> > 1) monitor the alert log as above for specific errors
> > 2) monitor the directories that these are generated in (bdump/cdump
> > etc.)
> > for any new files generated in the timeframe..
> >
> > Anybody already doing this - or have any scripts to save me
> > re-inventing the
> > wheel?
> >
> > Cheers
> >
> > Mark
> >
> > ===================================================
> > Mark Leith | T: +44 (0)1905 330 281
> > Sales & Marketing | F: +44 (0)870 127 5283
> > Cool Tools UK Ltd | E: mark_at_cool-tools.co.uk
> > ===================================================
> > http://www.cool-tools.co.uk
> > Maximising throughput & performance
> >
> >
> > --
> > Please see the official ORACLE-L FAQ: http://www.orafaq.com
> > --
> > Author: Mark Leith
> > INET: mark_at_cool-tools.co.uk
> >
> > 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).
>
>
> __________________________________________________
> 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).
>
> --
> Please see the official ORACLE-L FAQ: http://www.orafaq.com
> --
> Author: Mark Leith
> INET: mark_at_cool-tools.co.uk
>
> 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).
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