Thursday, July 7, 2011

ADR Command Interpreter (ADRCI) a new tool in Oracle 11g

Introduced in Oracle Database Release 11g, it is a command-line tool that one can use to manage diagnostic data.
Diagnostic data includes incident and problem descriptions, trace files, dumps, health monitor reports, alert log entries, and more
It enables us to:
  • View diagnostic data within the Automatic Diagnostic Repository (ADR).
  • View Health Monitor reports.
  • Package incident and problem information into a zip file for transmission to Oracle Support.

Setting the ADRCI Homepath before Using ADRCI Commands


adrci> show homes

If multiple homes are current, this means that the homepath points to a directory in the ADR directory structure that contains multiple ADR home directories underneath it. To focus on a single ADR home, you must set the homepath to point lower in the directory hierarchy, to a single ADR home directory.

If ADR base is /u01/app/oracle and you want to set the homepath to /u01/app/oracle/diag/rdbms/orclbi/orclbi2/, you use this command:
adrci> set homepath diag/rdbms/orclbi/orclbi2

Viewing the Alert Log

You want to view an alert log by using ADRCI commands. 
adrci>  SHOW ALERT
If more than one ADR home is current, you are prompted to select a single ADR home from a list. The alert log is displayed, with XML tags stripped, in your default editor.
Following are variations on the SHOW ALERT command:
  •  SHOW ALERT -TAIL
This displays the last portion of the alert log (the last 10 entries) in your terminal session.

  • SHOW ALERT -TAIL 50
This displays the last 50 entries in the alert log in your terminal session.
  • SHOW ALERT -TAIL –F

  • SHOW ALERT -P "MESSAGE_TEXT LIKE '%ORA-600%'"

Finding Trace Files


ADRCI enables you to view the names of trace files that are currently in the automatic diagnostic repository (ADR).
The following statement lists the names of all trace files in the current ADR homes, without any filtering:
adrci>SHOW TRACEFILE
The following statement lists the name of every trace file that has the string 'mmon' in its file name. The percent sign (%) is used as a wildcard character, and the search string is case sensitive.
adrci>SHOW TRACEFILE %mmon%
This statement lists the name of every trace file that is located in the /home/user/temp directory and that has the string 'mmon' in its file name:
adrci>SHOW TRACEFILE %mmon% -PATH /home/steve/temp
This statement lists the names of trace files in reverse order of last modified time. That is, the most recently modified trace files are listed first.
adrci>SHOW TRACEFILE -RT
This statement lists the names of all trace files related to incident number 1681:
adrci>SHOW TRACEFILE -I 1681

Viewing Incidents


·          adrci>SHOW INCIDENT
·          adrci>SHOW INCIDENT -MODE BRIEF
·          adrci>SHOW INCIDENT -MODE DETAIL

These commands produce more detailed versions of the incident report.
·          adrci>SHOW INCIDENT -MODE DETAIL -P "INCIDENT_ID=1681"

This shows a detailed incident report for incident 1681 only.

No comments:

Post a Comment