数据库
首页 > 数据库> > 12.Oracle之 automatic diagnostic repository特性

12.Oracle之 automatic diagnostic repository特性

作者:互联网

以下都是在11g上面进行操作

1.查看数据库的版本

SQL> select * from v$version where rownum<2;

BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production

2.查看告警日志文件的位置信息

SQL> show parameter background_dump_dest;

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
background_dump_dest                 string      /u01/app/oracle/diag/rdbms/orc
                                                 l/orcl/trace

3.diagnostic_dest是oracle 11g的新特性自动诊断库(automatic Diagnostic repository , ADR)的设置,该目录用于存放数据库诊断日志、跟踪文件等。通常被称为ADR base.

 ADR信息可以通过v$DIAG_INFO视图查询,其中Diag Alert和Diag Trace对应的目录分别存储了xml和文本格式的告警日志

SQL> select * from v$diag_info;

   INST_ID NAME                 VALUE
---------- -------------------- --------------------------------------------------
         1 Diag Enabled         TRUE
         1 ADR Base             /u01/app/oracle
         1 ADR Home             /u01/app/oracle/diag/rdbms/orcl/orcl
         1 Diag Trace           /u01/app/oracle/diag/rdbms/orcl/orcl/trace
         1 Diag Alert           /u01/app/oracle/diag/rdbms/orcl/orcl/alert
         1 Diag Incident        /u01/app/oracle/diag/rdbms/orcl/orcl/incident
         1 Diag Cdump           /u01/app/oracle/diag/rdbms/orcl/orcl/cdump
         1 Health Monitor       /u01/app/oracle/diag/rdbms/orcl/orcl/hm
         1 Default Trace File   /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_or
                                a_8562.trc

         1 Active Problem Count 0
         1 Active Incident Count 011 rows selected.

4.随着ADR的引入,一个新的工具ADRCI(ADR command interpreter)随之提供,在命令行中输入'adrci’可以启用adrci工具。

[oracle@11g:/home/oracle]$ adrci

ADRCI: Release 11.2.0.4.0 - Production on Sat Jun 18 10:29:25 2022

Copyright (c) 1982, 2011, Oracle and/or its affiliates.  All rights reserved.

ADR base = "/u01/app/oracle"
adrci> help;    

 HELP [topic]
   Available Topics:
        CREATE REPORT
        ECHO
        EXIT
        HELP
        HOST
        IPS
        PURGE
        RUN
        SET BASE
        SET BROWSER
        SET CONTROL
        SET ECHO
        SET EDITOR
        SET HOMES | HOME | HOMEPATH
        SET TERMOUT
        SHOW ALERT
        SHOW BASE
        SHOW CONTROL
        SHOW HM_RUN
        SHOW HOMES | HOME | HOMEPATH
        SHOW INCDIR
        SHOW INCIDENT
        SHOW PROBLEM
        SHOW REPORT
        SHOW TRACEFILE
        SPOOL
adrci> show alert;

Choose the alert log from the following homes to view:

1: diag/rdbms/orcl/orcl
2: diag/rdbms/test/test
3: diag/tnslsnr/11g/listener
Q: to quit

标签:12,rdbms,repository,diag,app,diagnostic,orcl,oracle,u01
来源: https://www.cnblogs.com/zmc60/p/16387879.html