Sunday, 30 July 2017

Automatic Diagnostic Repository Command Interface (ADRCI)
ADRCI is a command line tool for managing Oracle’s Diagnostic data – whenever a problem is encountered in database, we diagnoise by looking at various locations like alert logs, trace files, dumps etc., It’s been a nice thing if we were able to manage all the logs at one place. ADRCI provides that kind of ability –
Let’s see the functionality of ADRCI –
To enter into ADRCI interactive mode –
C:\>adrci
ADRCI: Release 11.2.0.1.0 - Production on Sun Jun 26 19:01:09 2011
Copyright (c) 1982, 2009, Oracle and/or its affiliates.  
All rights reserved.
ADR base = "c:\app\mgrvinod"
adrci>

Note ::  Assuming ORACLE_HOME and PATH environment variables 
         are set properly.
Now, set ADR homepath – if you have multiple instances then you will have multiple homes, so to focus on a single ADR home, you must set the homepath to a single ADR home directory. This can be done as follows –
adrci> show homes
ADR Homes:
diag\rdbms\mgrorcl\mgrorcl
diag\rdbms\mgrorcl1\mgrorcl1
diag\rdbms\orcl\orcl
diag\tnslsnr\mypc\listener
adrci>

To set to a particular SID - 

adrci> set homepath diag\rdbms\orcl\orcl
adrci> show homes
ADR Homes:
diag\rdbms\orcl\orcl
adrci>
You can view the alert log by issuing the following command –
adrci> show alert
ADR Home = c:\app\mgrvinod\diag\rdbms\orcl\orcl:
***************************************************************
Output the results to file: c:\..\alert_10932_10912_orcl_8.ado

You can even limit to view only the ORA - errors in the 
alert log - 

adrci> SHOW ALERT -P "MESSAGE_TEXT LIKE '%ORA-%'"

ADR Home = c:\app\mgrvinod\diag\rdbms\orcl\orcl:
***************************************************************
Output the results to file: c:\..\alert_10932_10912_orcl_9.ado

For rectifying any problem, sometimes it is necessary to contact Oracle support. Before doing so, it is necessary to gather relevant information, which will be useful for problem study. ADRCI utility is handy in not only providing the relevant information like trace files, alert logs, incident dumps etc., but it is also useful in grouping all the relevant file into a single package(compressed file).
Let us see how this can be done –
 
adrci> show incidents
ADR Home = c:\app\mgrvinod\diag\rdbms\orcl\orcl:
**************************************************************
INCIDENT_ID   PROBLEM_KEY   CREATE_TIME
-------------------- -----------------------------------------
161           ORA 227       2011-05-25 18:20:46.735000 +08:00
162           ORA 227       2011-05-25 18:21:49.522000 +08:00
2 rows fetched
Oneo can get more detailed information regarding the above incidents
by issuing the following command ..
adrci> show incident -mode DETAIL -p "incident_id=161"      

ADR Home = c:\app\mgrvinod\diag\rdbms\orcl\orcl:
**********************************************************
INCIDENT INFO RECORD 1
**********************************************************
   INCIDENT_ID              161
   STATUS                   ready
   CREATE_TIME              2011-05-25 18:20:46.735000 +08:00
   .
   .
   .
   PROBLEM_KEY              ORA 227
   FIRST_INCIDENT           161
   FIRSTINC_TIME            2011-05-25 18:20:46.735000 +08:00
   LAST_INCIDENT            162
   LASTINC_TIME             2011-05-25 18:21:49.522000 +08:00
   .
   .
   OWNER_ID                 1
   INCIDENT_FILE            c:\app\mgrvinod\diag\rdbms\orcl
                              \orcl\trace\orcl_m000_416.trc
   OWNER_ID                 1
   INCIDENT_FILE            c:\app\mgrvinod\diag\rdbms\orcl
                               \orcl\incident\incdir_161
                               \orcl_m000_416_i161.trc
1 rows fetched
Packages can be created based on Incident ID’s or Problem keys or also
using time. So with the help of Incident Packaging Service (IPS)
we can create the packages –
adrci> IPS CREATE PACKAGE INCIDENT 161
Created package 1 based on incident id 161,correlation level typical
adrci>

This creates a package and includes diagnostic information for 
incident(s). 

This package is a logical construct only, which means a collection 
of metadata in the Automatic Diagnostic Repository (ADR). As you add 
and remove package contents, only the metadata is modified. When you 
are ready to upload the data to Oracle Support,you create a physical 
package using ADRCI, which saves the data into a zip file. 

You can add/remove new incidents or files to the created package - 

adrci> IPS ADD INCIDENT 162 PACKAGE 1
Added incident 162 to package 1
adrci>

adrci> IPS ADD FILE c:\app\..\orcl_m000_416_i161.trc PACKAGE 1
Added file c:\app..\orcl_m000_416_i161.trc to package 1
adrci>

adrci> ips remove file c:\..\alert_orcl.log package 1;
Removed file c:\..\alert_orcl.log from package 1
adrci>

Now we are ready to generate a Physical package – This is a compressed file created in the current directory or else you can mention the location in the command –
adrci> ips generate package 1;
Generated package 1 in file C:\ORA227_20110626001721_COM_4.zip, 
mode complete
adrci>

No comments:

Post a Comment