菜单

教你怎样用Oracle方便地查看报警日志错误www.2138.com

2020年2月12日 - www.2138.com

在网上查了几天的资料,尝试综合消逝告急日志内容及建国门外界表的章程来减轻这一难题。

黄金年代:备份并湮灭告急日志内容

将每天的告急日志备份好,然后开展破除。

1:备份报告急察方日志

在$ORACLE_www.2138.com,教你怎样用Oracle方便地查看报警日志错误www.2138.com。HOME/SID/bdump/
目录下,按日期备份alert_ORACLE_你的实例名.LOG这么些文件,如:alert_ORACLE_orcl_201408111639_bak.LOG。

2:消除日志内容

开发报告警方日志文件,用true 文件名 可清除掉当中的内容

切切实实示例:假设,作者今后第三遍进行该装置,小编先把现存的告急日志进行备份,如:

–备份文件名称:今日16点24分前的报告警察方日志音讯

[oracle@rac2 bdump]$ cp alert_orcl2.log alert_orcl2_before_201408111624_bak.log

-清空报告警察方日志

[oracle@rac2 bdump]$ true  alert_orcl2.log

于今报告急察方日志是空的。切换下归档日志,检查报告急察方日志里是或不是出现了新剧情:

SQL alter system switch logfile;System altered.

则现在alert_orcl2.log笔录的是二〇一四年一月19日16点24分后至你下一次对报告警察方日志进行备份,截取前的新闻。

二:建外界表查看报告急方日志错误

风姿罗曼蒂克旦已创造了叁个客户,并赋相应的权杖,所以直接建构目录对象并确立外界表就能够了。

1.确立目录对象

SQL conn test / 123Connected.SQL create directory bdump as '/oracle/u01/app/oracle/admin/db2/bdump';Directory created.

2.创设外界表

SQL create table alert_log(text varchar2(400))organization external(type oracle_loaderdefault directory bdumpaccess parameters(records delimited by newline)location('alert_db2.log'));

3.测验首先查看是还是不是查到alert_db2.log的内容

SQL select * from alert_log where rownum  10;TEXT--------------------------------------------------------------------------------Thu Jun 11 00:51:46 2009Starting ORACLE instance (normal)Cannot determine all dependent dynamic libraries for /proc/self/exeUnable to find dynamic library libocr10.so in search pathsRPATH = /ade/aime1_build2101/oracle/has/lib/:/ade/aime1_build2101/oracle/lib/:/ade/aime1_build2101/oracle/has/lib/:LD_LIBRARY_PATH is not set!The default library directories are /lib and /usr/libUnable to find dynamic library libocrb10.so in search pathsUnable to find dynamic library libocrutl10.so in search paths9 rows selected.

测验成功然后大家测量检验查报告急察方新闻’ORA-%’

SQL select * from alert_log where text like 'ORA-%';TEXT--------------------------------------------------------------------------------ORA-00202: control file: '/oracle/u01/app/oracle/product/10.2.0/db2/dbs/cntrldb2.dbf'ORA-27037: unable to obtain file statusORA-205 signalled during: ALTER DATABASE MOUNT...ORA-00301: error in adding log file '/home/oracle/oracle/oradata/testdb/redo01.log' - file cannot be createdORA-27040: file create errorORA-1501 signalled during: CREATE DATABASE db2ORA-00200: control file could not be createdTEXT--------------------------------------------------------------------------------ORA-00202: control file: '/oracle/u01/app/oracle/product/10.2.0/db2/dbs/cntrldb2.dbf'ORA-27038: created file already existsORA-1501 signalled during: CREATE DATABASE db2ORA-00200: control file could not be createdORA-00202: control file: '/oracle/u01/app/oracle/product/10.2.0/db2/dbs/cntrldb2.dbf'ORA-27038: created file already existsORA-1501 signalled during: CREATE DATABASE db2

–固然,你的告警日志文件只含有明天的音信,则经过外界表能够查到当天时有发生了什么样不当。

相关文章

发表评论

电子邮件地址不会被公开。 必填项已用*标注

网站地图xml地图