ITPub博客

首页 > Linux操作系统 > Linux操作系统 > Automatic Diagnostic Repository in 11g

Automatic Diagnostic Repository in 11g

原创 Linux操作系统 作者:jiuniang012 时间:2009-07-13 09:55:07 0 删除 编辑
自动诊断存储库(Automatic Diagnostic Repository) 是oracle database 11g的一个新特性,它提供了一个中心化存储trace files, dumps, health monitor reports, alert logs等. 不同的产品和实例都有统一的目录结构, 把各自的诊断数据存储在自己的ADR_HOME里.

基本概念:
1. Problem
    Problem就是数据库的一个比较严重的错误,例如:ORA-600, ORA-04031, ORA-07445. 每个problem都有problem key和唯一的problem id, 并被存储于ADR中.
    Problem key: 以文本格式存储了错误代码(ORA-600)和其它更多的参数. 如果两个或两个以上的incidents有相同的problem key,那么他们是有相同的错误导致的.

2. Incident
    出现一次problem就是一个Incident. 如果一个problem发生多次,则没发生一次就产生一个incident,并有唯一的incident id 存储于ADR. 当产生一个incident时,将发生incident alert到 OEM, 以dump files的格式收集诊断数据,然后把dump文件存储在ADR incident子目录里.

3. Incident package
    incident package是所有incidents数据的集合. 逻辑包逻辑上定义了incidents的集合, 在上传包给oracle support之前,必须创建物理的包(physic package). 可以用ADRCI创建和管理包,具体细节见后文.

4. ADRCI 命令:
正确设置ORACLE_HOME, PATH之后可以使用adrci.

ADRCI: Release 11.1.0.6.0 - Beta on Mon Jul 13 14:02:29 2009

Copyright (c) 1982, 2007, Oracle.  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

 There are other commands intended to be used directly by Oracle, type
 "HELP EXTENDED" to see the list

adrci> show home
ADR Homes:
diag/tnslsnr/liang/listener
diag/rdbms/orcl/orcl

adrci> show incident

ADR Home = /u01/app/oracle/diag/tnslsnr/liang/listener:
*************************************************************************
0 rows fetched

ADR Home = /u01/app/oracle/diag/rdbms/orcl/orcl:
*************************************************************************
INCIDENT_ID          PROBLEM_KEY                                                 CREATE_TIME
-------------------- ----------------------------------------------------------- ----------------------------------------
2529                 ORA 600 [kpotcgah-7]                                        2009-07-12 00:46:39.840091 +08:00
1 rows fetched

adrci> show problem

ADR Home = /u01/app/oracle/diag/tnslsnr/liang/listener:
*************************************************************************
0 rows fetched

ADR Home = /u01/app/oracle/diag/rdbms/orcl/orcl:
*************************************************************************
PROBLEM_ID           PROBLEM_KEY                                                 LAST_INCIDENT        LASTINC_TIME
-------------------- ----------------------------------------------------------- -------------------- ----------------------------------------
1                    ORA 600 [kpotcgah-7]                                        2529                 2009-07-12 00:46:39.840091 +08:00
1 rows fetched

adrci> show incident -mode brief

ADR Home = /u01/app/oracle/diag/tnslsnr/liang/listener:
*************************************************************************
0 rows fetched



ADR Home = /u01/app/oracle/diag/rdbms/orcl/orcl:
*************************************************************************

**********************************************************
INCIDENT INFO RECORD 1
**********************************************************
   INCIDENT_ID                   2529
   STATUS                        ready
   CREATE_TIME                   2009-07-12 00:46:39.840091 +08:00
   PROBLEM_ID                    1
   CLOSE_TIME                   
   FLOOD_CONTROLLED              none
   ERROR_FACILITY                ORA
   ERROR_NUMBER                  600
   ERROR_ARG1                    kpotcgah-7
   ERROR_ARG2                    12534
   ERROR_ARG3                    ORA-12534: TNS:operation not supported

   ERROR_ARG4                   
   ERROR_ARG5                   
   ERROR_ARG6                   
   ERROR_ARG7                   
   ERROR_ARG8                   
   SIGNALLING_COMPONENT         
   SIGNALLING_SUBCOMPONENT      
   SUSPECT_COMPONENT            
   SUSPECT_SUBCOMPONENT         
   ECID                         
   IMPACTS                       0
1 rows fetched

adrci> show incident -mode detail

ADR Home = /u01/app/oracle/diag/tnslsnr/liang/listener:
*************************************************************************
0 rows fetched



ADR Home = /u01/app/oracle/diag/rdbms/orcl/orcl:
*************************************************************************

**********************************************************
INCIDENT INFO RECORD 1
**********************************************************
   INCIDENT_ID                   2529
   STATUS                        ready
   CREATE_TIME                   2009-07-12 00:46:39.840091 +08:00
   PROBLEM_ID                    1
   CLOSE_TIME                   
   FLOOD_CONTROLLED              none
   ERROR_FACILITY                ORA
   ERROR_NUMBER                  600
   ERROR_ARG1                    kpotcgah-7
   ERROR_ARG2                    12534
   ERROR_ARG3                    ORA-12534: TNS:operation not supported

   ERROR_ARG4                   
   ERROR_ARG5                   
   ERROR_ARG6                   
   ERROR_ARG7                   
   ERROR_ARG8                   
   SIGNALLING_COMPONENT         
   SIGNALLING_SUBCOMPONENT      
   SUSPECT_COMPONENT            
   SUSPECT_SUBCOMPONENT         
   ECID                         
   IMPACTS                       0
   PROBLEM_KEY                   ORA 600 [kpotcgah-7]
   FIRST_INCIDENT                2529
   FIRSTINC_TIME                 2009-07-12 00:46:39.840091 +08:00
   LAST_INCIDENT                 2529
   LASTINC_TIME                  2009-07-12 00:46:39.840091 +08:00
   IMPACT1                       0
   IMPACT2                       0
   IMPACT3                       0
   IMPACT4                       0
   KEY_NAME                      ProcId
   KEY_VALUE                     16.52
   KEY_NAME                      Client ProcId
   KEY_VALUE                     oracle@liang.2363_4140193472
   KEY_NAME                      SID
   KEY_VALUE                     170.17926
   OWNER_ID                      1
   INCIDENT_FILE                 /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_w000_2363.trc
   OWNER_ID                      1
   INCIDENT_FILE                 /u01/app/oracle/diag/rdbms/orcl/orcl/incident/incdir_2529/orcl_w000_2363_i2529.trc
1 rows fetched

adrci> show incident -mode detail -p "incident_id=2529"

ADR Home = /u01/app/oracle/diag/tnslsnr/liang/listener:
*************************************************************************
0 rows fetched



ADR Home = /u01/app/oracle/diag/rdbms/orcl/orcl:
*************************************************************************

**********************************************************
INCIDENT INFO RECORD 1
**********************************************************
   INCIDENT_ID                   2529
   STATUS                        ready
   CREATE_TIME                   2009-07-12 00:46:39.840091 +08:00
   PROBLEM_ID                    1
   CLOSE_TIME                   
   FLOOD_CONTROLLED              none
   ERROR_FACILITY                ORA
   ERROR_NUMBER                  600
   ERROR_ARG1                    kpotcgah-7
   ERROR_ARG2                    12534
   ERROR_ARG3                    ORA-12534: TNS:operation not supported

   ERROR_ARG4                   
   ERROR_ARG5                   
   ERROR_ARG6                   
   ERROR_ARG7                   
   ERROR_ARG8                   
   SIGNALLING_COMPONENT         
   SIGNALLING_SUBCOMPONENT      
   SUSPECT_COMPONENT            
   SUSPECT_SUBCOMPONENT         
   ECID                         
   IMPACTS                       0
   PROBLEM_KEY                   ORA 600 [kpotcgah-7]
   FIRST_INCIDENT                2529
   FIRSTINC_TIME                 2009-07-12 00:46:39.840091 +08:00
   LAST_INCIDENT                 2529
   LASTINC_TIME                  2009-07-12 00:46:39.840091 +08:00
   IMPACT1                       0
   IMPACT2                       0
   IMPACT3                       0
   IMPACT4                       0
   KEY_NAME                      ProcId
   KEY_VALUE                     16.52
   KEY_NAME                      Client ProcId
   KEY_VALUE                     oracle@liang.2363_4140193472
   KEY_NAME                      SID
   KEY_VALUE                     170.17926
   OWNER_ID                      1
   INCIDENT_FILE                 /u01/app/oracle/diag/rdbms/orcl/orcl/trace/orcl_w000_2363.trc
   OWNER_ID                      1
   INCIDENT_FILE                 /u01/app/oracle/diag/rdbms/orcl/orcl/incident/incdir_2529/orcl_w000_2363_i2529.trc
1 rows fetched

5. Package Incidents
Step 1—Create a logical incident package.
Step 2—Add diagnostic information to the incident package
Step 3—Generate the physical incident package

5.1 Create a logical incident package
      1). 创建逻辑包
           命令:

         
IPS CREATE PACKAGE INCIDENT incident_number
                    IPS CREATE PACKAGE PROBLEM problem_ID
                    IPS CREATE PACKAGE PROBLEMKEY "problem_key"
         
IPS CREATE PACKAGE SECONDS sec
         
IPS CREATE PACKAGE TIME 'start_time' TO 'end_time'
     实例:
adrci> ips create package incident 2529
DIA-48448: This command does not support multiple ADR homes
adrci> show home
ADR Homes:
diag/tnslsnr/liang/listener
diag/rdbms/orcl/orcl
注: 该命令不支持多ADR_HOME
adrci> set home diag/rdbms/orcl/orcl
adrci> ips create package incident 2529
Created package 3 based on incident id 2529, correlation level typical
此时incident 2529逻辑包已经创建成功.

adrci> IPS CREATE PACKAGE TIME '2007-07-24 00:00:00 -07:00' to '2007-07-30 23.59.59 -07:00'

2). 添加信息到逻辑包
命令:
IPS ADD INCIDENT incident_number PACKAGE package_number
IPS ADD FILE filespec PACKAGE package_number
注: filespec必须是全路径+文件名

3). 产生物理包
命令:
完全包(complete package)
IPS GENERATE PACKAGE package_number IN path
增量包(incremental package:containing only the incidents that have occurred since the last package generation.)
IPS GENERATE PACKAGE package_number IN path INCREMENTAL
实例:
adrci> ips generate package 3 in /tmp
Generated package 3 in file /tmp/ORA600kpo_20090713141545_COM_1.zip, mode complete

6. 配置IPS
1). 显示IPS配置
adrci> ips show configuration
2). 配置IPS
ips set configuration parameter_id value
例如:
adrci> ips set configuration 3 10

Snap1.jpg

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9466564/viewspace-608990/,如需转载,请注明出处,否则将追究法律责任。

下一篇: Health Monitor
请登录后发表评论 登录
全部评论

注册时间:2009-07-02

  • 博文量
    126
  • 访问量
    211808