12.Oracle之 automatic diagnostic repository特性

2022/6/19 2:21:20

本文主要是介绍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.Oracle之 automatic diagnostic repository特性的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!


扫一扫关注最新编程教程