MONITORING ALERT LOG ORA-ERRORS
######################################
Below script is used for monitoring all the ORA-Errors from the alert log and used to send to our mail boxes, we can schedule this through cronjob.
vi monitor_alertlog.sh
------------------------------
tail -10 /u01/app/oracle/diag/rdbms/db/PROD/trace/alert_PROD.log > /u01/app/oracle/monitoring/temp.lst
cat /u01/app/oracle/monitoring/temp.lst | grep ORA- > /u01/app/oracle/monitoring/temp1.lst
cnt=`cat /u01/app/oracle/monitoring/temp1.lst |wc -l`
if [ $cnt -gt 0 ]; then
/bin/mail -s "ORA ERRORS FOUND IN PROD ALERT LOG" jprasad@gmail.com < /u01/app/oracle/monitoring/temp1.lst
fi
rm /u01/app/oracle/monitoring/temp.lst /u01/app/oracle/monitoring/temp1.lst
######################################
Below script is used for monitoring all the ORA-Errors from the alert log and used to send to our mail boxes, we can schedule this through cronjob.
vi monitor_alertlog.sh
------------------------------
tail -10 /u01/app/oracle/diag/rdbms/db/PROD/trace/alert_PROD.log > /u01/app/oracle/monitoring/temp.lst
cat /u01/app/oracle/monitoring/temp.lst | grep ORA- > /u01/app/oracle/monitoring/temp1.lst
cnt=`cat /u01/app/oracle/monitoring/temp1.lst |wc -l`
if [ $cnt -gt 0 ]; then
/bin/mail -s "ORA ERRORS FOUND IN PROD ALERT LOG" jprasad@gmail.com < /u01/app/oracle/monitoring/temp1.lst
fi
rm /u01/app/oracle/monitoring/temp.lst /u01/app/oracle/monitoring/temp1.lst
2 comments:
Thanks for uploading the script.. but if i have to look for ORA errors in alert log for last one day than how can i modify this script.
The script you posted looks for only last 10 lines in alert log.
Hey Ankur,
That wont be a good logic to go for 1 day old.. if so you need to check manually in alert log. But the above specified will display as ORA error to our mail boxes as soon as it reaches(depends on your cron schedule).
-Jagadish.
Post a Comment