Chinaunix

标题: 简单、易用、高效的oracle监控工具OraAlertCheck [打印本页]

作者: hg1995    时间: 2011-12-19 13:56
标题: 简单、易用、高效的oracle监控工具OraAlertCheck
Oracle数据库出故障时发邮件给预设的邮件地址,类似如下:


ORA-1547 Wed Jan  5 18:10:02 MST 2011
Alert log line: ORA-1547 signalled during: alter database recover cancel...

oerr output:
01547, 00000, "warning: RECOVER succeeded but OPEN RESETLOGS would get error below"
// *Cause: Media recovery with one of the incomplete recovery options ended
//        without error.  However, if the ALTER DATABASE OPEN RESETLOGS command
//        were attempted now, it would fail with the specified error.
//        The most likely cause of this error is forgetting to restore one or
//        more datafiles from a sufficiently old backup before executing the
//        incomplete recovery.
// *Action: Rerun the incomplete media recovery using different datafile
//         backups, a different control file, or different stop criteria.
no extra OraAlertCheck information
ERRORCOUNT:2

下载:http://oraalertcheck.googlecode.com/files/oraalertcheck_v0.1.6.zip

安装:http://code.google.com/p/oraalertcheck/wiki/HowTo

How To install and configure OraAlertCheck¶
Download & uncompress the latest release from the download tab or directly from your unix get the latest source code with SVN:
svn checkout http://oraalertcheck.googlecode.com/svn/trunk/ oraalertcheck-read-only
Put all the files in the same directory (example: /home/oracle/OraAlertCheck).
Rename OraAlertCheck_config.sh.sample to OraAlertCheck_config.sh. Edit the file and change the variables to suit your needs. It's important to set the WORKDIR to where the script is located.
OraAlertCheck look for your instances on /etc/oratab by default, so if this does not exists you should create it or link it to the real path.
Check to see if the script can find your alert.log files running:
$ ./OraAlertCheck.sh test
You should see the ORACLE_SID followed by the alert.log path. If you can't and you discover a bug in the program, let me know, if it does then skip to the next paragraph. The script connects to the database "/ as sysdba" to get the value of the background_dump_dest parameter (where alert_SID.log file should be). Sometimes this parameter has characters like "?" to indicate the ORACLE_HOME. Be sure to have the full path there.
Now that the log file was found you can run the script with no parameters. NOTE: Since it's the first time, it will run through all your log file and email you with a lot of errors. The script will generate a hidden file where it will set the current line number so next time it will start just where it finished.
If all worked fine, you can add the script to your crontab, every five minutes should be fine.
The script needs some work yet so please don't hesitate to send me your opinions






欢迎光临 Chinaunix (http://bbs.chinaunix.net/) Powered by Discuz! X3.2