Database Administration (MOSC)

MOSC Banner

alert log monitoring

edited Jan 30, 2012 10:05AM in Database Administration (MOSC) 5 commentsAnswered
I have the following scripts:

#!/bin/ksh
cd /dsk01/oradata/test/bdump
files="alert_*.log"
for file in $(find $files)
do
DT=$(date)
awk '
BEGIN {Flg=0}
NR==1  {R=split(DATE, TMP, " ")
       Day=TMP[1]
       Month=TMP[2]
       NoDay=TMP[3]}
{NoDayM=NoDay-1}
NF==5 && $2==Month && ( $3==(NoDayM) || $3==NoDay ) {Flg=1}
Flg==1  {print $0}
' DATE="$DT" $file | awk '
/^ORA-/ || /cannot/ {print DATE
print $0}
NF==5  {DATE=$0}
'
done
exit 0

I just tested to run the script in the command line. Nothing happened. Should it print out something as least? Ideally, I would like it to send an email to me, but to create an output file is also good. Right now, I don't even know whether this script works properly or not. Any advice? Thanks.

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center