免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 1268 | 回复: 0
打印 上一主题 下一主题

简单、易用、高效的oracle监控工具OraAlertCheck [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2011-12-19 13:56 |只看该作者 |倒序浏览
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

您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP