Oracle Alert Monitoring, Copy & Cleanup

Need to monitor my alert logs: Oracle=11.2.0.3 & + & OS= AIX 6 & OLE 5

1. Get email as soon as there is any ORA- in the alert log, also looking for HSM related message too, or if there is any other text/string, if needed
2. Have to keep only 10 or 15 days of alert.log at the primary location, rest should be copy/purge to a secondary location
3. Also is there any fastest way to check/look into alert log, instead of first locating the directory (v$diag_info) and then cd and then tail -100f

Please assist/advice ... thanks in advance.
Mushfique KhanDirector OperationsAsked:
Who is Participating?
 
johnsoneSenior Oracle DBACommented:
If you are looking to query the alert log, look at X$DBGALERTEXT.  You can also set up an external table that reads the alert log.

To keep a certain number of days, I suggest a cron job that rotates the log every day.  We used to do it weekly, but easy enough to do every day.  All you should have to do is rename the alert log with a date stamp.  A new one will automatically be created.
0
 
Mark GeerlingsDatabase AdministratorCommented:
I do two things to help manage our Oracle alert_*.log files:
1. I move them out of the default location, since I don't want log and trace files to possibly fill up my ORACLE_HOME disk location.  The size of the ORACLE_HOME remains quite static this way, except when patches or upgrades get applied.  To change the default location for these files do:
alter system set diagnostic_dest=[a valid disk path on your system] scope=both;
2. Use a "cron" (or OEM) job to rename the alert*.log file each night at 11:59pm to include the numeric month and day.  Here are the commands that we use for that in a Linux system:
cd /s10/diag/rdbms/prod/prod/trace
# wait 45 seconds to be close to midnight:
sleep 45
mv alert_prod.log alert_prod_`date '+%m%d'`.log
# Also, rename the *.xml version:
cd ../alert
mv log.xml log_prod_`date '+%m%d'`.xml
0
 
Mushfique KhanDirector OperationsAuthor Commented:
thanks, especially markgeer, how about the #1 & #3, is there any fastest way to look for and got  alerted as soon as there is any ORA- error there?

And we have almost 17 instances running on each node, having 3 nodes cluster, please assist/advise/guide, how to accomplish this too.

Thanks in advance.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.