ADRCI – ADR Command Interpreter

Here we covered following points in this post:

  1. About ADRCI.
  2. Terminology of Problems & Incidents.
  3. Getting adrci prompt.
  4. Getting help.
  5. Setting ADRCI homepath. ( ADR home )
  6. How to check Oracle alerts with ADRCI prompt.
  7. Finding trace file.
  8. Ensuring/Cross-verifying recent Problems.
  9. Ensuring/Cross-verifying recent incidents.
  10. Tracefile management. ( With purging )
  11. Get output of adrci command.

 

1. About ADRCI:

Handling Oracle errors is now bit easy for DBA with the Automatic Diagnostic Repository Command Interpreter ( ADRCI ), this is the command line tool especially to handles Oracle diagnostic data.

Diagnostic data includes: Problem information, Incident information, Health monitor reports, Trace files & information associated with it, Dumps and much more.

ADRCI is offering you:

  • Cross-verification of diagnostic data easily.
  • Cross-verification of health check reports.
  • In case of we need Oracle support, incident can be easily packaged & problem info can be easily zipped to transmit.

2. Terminology of Problems & Incidents:

Problem – Problem is nothing but critical error occured. Critical error’s like ORA-00600, ORA-07445: OS Exception, ORA-04031: Out of memory in shared pool, etc.

Incident – Incident is nothing but reduendancy of any perticuler problem occurence.

Note: Each problem & incident have its unique ID & Key.

 

 

3. Getting adrci prompt:

To start with ADRCI tool, issue the following command on your command prompt:

[oracle@oracle ~]$ adrci

ADRCI: Release 11.2.0.1.0 – Production on Tue Jan 21 07:33:23 2014
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.

ADR base = “/home/oracle/app/oracle”
adrci>

To exit from ADRCI too, issue EXIT or QUIT.

 

 

4. Getting adrci help:

With the help of adrci ‘help’ command we can list down all ADR commands, options and help for individual commands.
Some examples are:

[oracle@oracle ~]$ adrci -help

adrci> help

adrci> help set home    //To get help on ‘set home’ command.

adrci> help show incident    //To get help on ‘show incident’ command.

adrci> show problem    //To get help on ‘show problem’ command.

 

 

5. Setting ADRCI homepath: ( ADR home )

Issue the ‘show home’ adrci command to get all homepath & issue ‘set home’ adrci command to set homepath:
Note:
In my case we are using orcl database for adrci tool hands-on & catalogdb database is for recovery manager.

adrci> show home
ADR Homes:
diag/rdbms/orcl/orcl
diag/rdbms/catalogdb/catalogdb
diag/tnslsnr/centos/listener
diag/tnslsnr/oracle/listener

adrci> set home diag/rdbms/orcl/orcl

 

To ensure current homepath:
adrci> show home;
ADR Homes:
diag/rdbms/orcl/orcl

 

 

6. Finding trace file:

To list down all the trace files in the current home, issue following:
adrci> show tracefile
diag/rdbms/orcl/orcl/trace/orcl_arc1_10144.trc
diag/rdbms/orcl/orcl/trace/orcl_j000_826.trc
….

 

To list down all tracefile accroding to timestamp in revers order, issue the following command:
adrci> show tracefile -rt
21-JAN-14 02:45:21 diag/rdbms/orcl/orcl/trace/orcl_arc2_27454.trc
21-JAN-14 02:45:21 diag/rdbms/orcl/orcl/trace/alert_orcl.log
21-JAN-14 02:00:00 diag/rdbms/orcl/orcl/trace/orcl_vkrm_5787.trc
21-JAN-14 02:00:00 diag/rdbms/orcl/orcl/trace/orcl_dbrm_26656.trc
20-JAN-14 22:04:34 diag/rdbms/orcl/orcl/trace/orcl_ckpt_26668.trc
20-JAN-14 22:02:00 diag/rdbms/orcl/orcl/trace/orcl_arc0_27450.trc
20-JAN-14 22:00:08 diag/rdbms/orcl/orcl/trace/orcl_j001_5809.trc
….

 

To list down all the trace files related to particulate search string, issue following command:
Note: ‘smon’ is search string and we are considering ‘%’ sign as wildcard search character.

adrci> show tracefile %smon%
diag/rdbms/orcl/orcl/trace/orcl_smon_26670.trc

 

To list down all the trace files located at perticuler path, then issue the following command:
adrci> show tracefile %smon% diag/rdbms/orcl/orcl/trace/
diag/rdbms/orcl/orcl/trace/orcl_smon_26670.trc

 

To list down all the trace files related to incident number 1557, then issue the following command:
adrci> show tracefile -I 1557
7. How to check Oracle alerts with ADRCI prompt:

Following command retrieves all alerts from trace files:
adrci> show alert

 

Following command retrieves recent alert logs, by default 10 entries.
adrci> show alert -tail

 

Following command retrieves recent alert logs, 30 entries.
adrci> show alert -tail 30

 

Following command retrieves recent 10 alert logs & will wait for more messages to arrive in alert logs. This is like live monitoring of your alert logs.
adrci> show alert -tail -f

CTRL + C to exit.

 

Following command retrieves alert logs which is identical to search string.

adrci> show alert -P “message_text like ‘%ORA-600%'”
ADR Home = /home/oracle/app/oracle/diag/rdbms/orcl/orcl:
*************************************************************************
8. Ensuring/Cross-verifying recent Problems:

Following command retrives all problems occured on current ADR home.
adrci> show problem -all
ADR Home = /home/oracle/app/oracle/diag/rdbms/orcl/orcl:
*************************************************************************
0 rows fetched

Following command retrives datail information of problem id number 4 only.
adrci> show problem -p “problem_id=4”
ADR Home = /home/oracle/app/oracle/diag/rdbms/orcl/orcl:
*************************************************************************
0 rows fetched
9. Ensuring/Cross-verifying recent incidents:

The “adrci show incident” command displays information about open incidents. Each incident have its own incident ID, problem key & incident timestamp.

 

To view a report of all open incidents, issue following command:
adrci> show incident;
ADR Home = /home/oracle/app/oracle/diag/rdbms/orcl/orcl:
*************************************************************************
0 rows fetched

 

Following command retrieves brief mode of incident:
adrci> show incident -mode brief
ADR Home = /home/oracle/app/oracle/diag/rdbms/orcl/orcl:
*************************************************************************
0 rows fetched
Following command retrieves all details of incident report:
adrci> 
ADR Home = /home/oracle/app/oracle/diag/rdbms/orcl/orcl:
*************************************************************************
0 rows fetched
Following command retrieves details of incident report of ID 1557 only:
adrci> show incident -mode detail -P “incident_id=1557”
ADR Home = /home/oracle/app/oracle/diag/rdbms/orcl/orcl:
*************************************************************************
0 rows fetched

 

10. Tracefile management: ( With purging )
=============================================================
Purging of all trace file has been done automatically as well as manually, as per our requirements.
As we know Oracle 11g generates lots of trace file, thats why we need to purge it on timely basis.

To check default policy, issue the following command:
adrci> show control

ADR Home = /home/oracle/app/oracle/diag/rdbms/orcl/orcl:
*************************************************************************
ADRID SHORTP_POLICY LONGP_POLICY LAST_MOD_TIME LAST_AUTOPRG_TIME LAST_MANUPRG_TIME ADRDIR_VERSION ADRSCHM_VERSION ADRSCHMV_SUMMARY ADRALERT_VERSION CREATE_TIME
——————– ——————– ——————– —————————————- —————————————- —————————————- ——————– ——————– ——————– ——————– —————————————-
1335663986 720 8760 2014-01-02 14:37:49.687919 +00:00 2014-01-16 00:29:18.331252 +00:00 1 2 76 1 2014-01-02 14:37:49.687919 +00:00
1 rows fetched

By default, An ordinary tracefiles will stay upto 30 days means 720 hours OR Incident files stay 1 year means 8760 hours.

To change default policy settings, issue the following command:
adrci> set control (SHORTP_POLICY =24) //Ordinary tracefiles will retain upto 1 day.
adrci> set control (LONGP_POLICY =720) //Incident tracefiles will retain upto 30 days.

 

To ensure above changes, issue the following command:
adrci> show control

ADR Home = /home/oracle/app/oracle/diag/rdbms/orcl/orcl:
*************************************************************************
ADRID SHORTP_POLICY LONGP_POLICY LAST_MOD_TIME LAST_AUTOPRG_TIME LAST_MANUPRG_TIME ADRDIR_VERSION ADRSCHM_VERSION ADRSCHMV_SUMMARY ADRALERT_VERSION CREATE_TIME
——————– ——————– ——————– —————————————- —————————————- —————————————- ——————– ——————– ——————– ——————– —————————————-
1335663986 24 720 2014-01-21 09:15:32.525486 +00:00 2014-01-16 00:29:18.331252 +00:00 1 2 76 1 2014-01-02 14:37:49.687919 +00:00
1 rows fetched
11. Get output of adrci command:

To do so, issue the following command on adrci prompt:
adrci> spool /home/oracle/data/adrci_output.log
adrci> show tracefile
adrci> spool off

This outputs the alert logs, without XML tags to the file /home/oracle/data/adrci_output.log.

***********************************************************************

Note: Please don’t hesitate to revert in case of any query OR feedback.

Thanking you.

Have a easy life ahead.

Leave a Reply