-
Can I use OEM to check the Alert.log file errors
I am interested to check the alert.log file using OEM. I am using Oracle 9.2.0.6. If there is any error in alert.log, then Oracle Enterprise Manager should Email me.
Is it possible..?
-
If your on Li/Unix run this script from an OEM job:
#!/bin/bash
ORACLE_SID=
export ORACLE_SID
ORACLE_HOME=
export ORACLE_HOME
cd /u1/oracle/admin/$ORACLE_SID/bdump
#you may want to make a common place for sym links to all your alert logs
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
Emailing the output is simply a matter of piping the output through your favorite email binary or let OEM send it.
Hope this helps,
Ken
-
I am using Sun Solaris. Any one has script for this activity to put in OEM..
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|