Wednesday, September 4, 2019

Generate Incident Report in Oracle Database


The Automatic Diagnostics Repository (ADR) is a hierarchical file-based repository for handling diagnostic information. 

Directory structure is as:

$ADR_BASE/diag/rdbms/{DB-name}/{SID}/alert
$ADR_BASE/diag/rdbms/{DB-name}/{SID}/cdump
$ADR_BASE/diag/rdbms/{DB-name}/{SID}/hm
$ADR_BASE/diag/rdbms/{DB-name}/{SID}/incident
$ADR_BASE/diag/rdbms/{DB-name}/{SID}/trace
$ADR_BASE/diag/rdbms/{DB-name}/{SID}/{others}

To generate incident report quickly, we can follow the below steps:

adrci> show problem
adrci> show incident

adrci> show incident -mode detail -p "incident_id=incident_no" 
adrci> ips create package problem <problem_id>correlate all
adrci> ips generate package  in "/tmp"







bash-4.3$ adrci

ADRCI: Release 11.2.0.4.0 - Production on Mon Sep 2 13:08:07 2019

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

ADR base = "/orafs/app/oracle"

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

ADR Home = /orafs/app/oracle/diag/rdbms/testdb/testdb12:
*************************************************************************

**********************************************************
INCIDENT INFO RECORD 1
**********************************************************
   INCIDENT_ID                   13123035
   STATUS                        ready
   CREATE_TIME                   2019-08-25 14:52:26.394000 +06:00
   PROBLEM_ID                    42
   CLOSE_TIME                   
   FLOOD_CONTROLLED              none
   ERROR_FACILITY                ORA
   ERROR_NUMBER                  7445
   ERROR_ARG1                    __lwp_kill()+48
   ERROR_ARG2                    SIGIOT
   ERROR_ARG3                    ADDR:0x7437
   ERROR_ARG4                    PC:0xC0000000003125F0
   ERROR_ARG5                    unknown code
   ERROR_ARG6                   
   ERROR_ARG7                   
   ERROR_ARG8                   
   ERROR_ARG9                   
   ERROR_ARG10                   
   ERROR_ARG11                   
   ERROR_ARG12                   
   SIGNALLING_COMPONENT         
   SIGNALLING_SUBCOMPONENT       
   SUSPECT_COMPONENT             
   SUSPECT_SUBCOMPONENT         
   ECID                         
   IMPACTS                       0
   PROBLEM_KEY                   ORA 7445 [__lwp_kill()+48]
   FIRST_INCIDENT                13123035
   FIRSTINC_TIME                 2019-08-25 14:52:26.394000 +06:00
   LAST_INCIDENT                 13123035
   LASTINC_TIME                  2019-08-25 14:52:26.394000 +06:00
   IMPACT1                       0
   IMPACT2                       0
   IMPACT3                       0
   IMPACT4                       0
   KEY_NAME                      Client ProcId
   KEY_VALUE                     oracle@sdbablv2.29751_1
   KEY_NAME                      SID
   KEY_VALUE                     1130.3
   KEY_NAME                      ProcId
   KEY_VALUE                     35.2
   OWNER_ID                      1
   INCIDENT_FILE                 /orafs/app/oracle/diag/rdbms/testdb/testdb12/trace/testdb12_lck0_29751.trc
   OWNER_ID                      1
   INCIDENT_FILE                 /orafs/app/oracle/diag/rdbms/testdb/testdb12/incident/incdir_13123035/testdb12_lck0_29751_i13123035.trc
1 rows fetched

adrci> ips create package problem 42 correlate all
Created package 8 based on problem id 42, correlation level all

adrci> ips generate package 8 in "/tmp"
Can't locate Sys/Hostname.pm in @INC (@INC contains: /orafs/app/11.2.0/grid/perl/lib/5.10.0/IA64.ARCHREV_0-thread-multi-LP64 /orafs/app/11.2.0/grid/perl/lib/5.10.0 /orafs/app/11.2.0/grid/perl/lib /orafs/app/11.2.0/grid/perl/lib/5.10.0/IA64.ARCHREV_0-thread-multi-LP64 /orafs/app/11.2.0/grid/perl/lib/5.10.0 /orafs/app/11.2.0/grid/perl/lib/site_perl/5.10.0/IA64.ARCHREV_0-thread-multi-LP64 /orafs/app/11.2.0/grid/perl/lib/site_perl/5.10.0 .) at /orafs/app/11.2.0/grid/bin/diagcollection.pl line 80.
BEGIN failed--compilation aborted at /orafs/app/11.2.0/grid/bin/diagcollection.pl line 80.
Generated package 8 in file /tmp/ORA7445___20190902130940_COM_1.zip, mode complete
adrci> exit
bash-4.3$ cd /tmp/

No comments: