ADRCI-Automatic_Diagnostic_Repository_Command_Interpreter

ADRCI -Automatic Diagnostic Repository Command Interpreter in Oracle Database 19c

Introduction

Oracle Database includes a powerful diagnostic tool called ADRCI – Automatic Diagnostic Repository Command Interpreter. It is a command-line utility used to manage diagnostic data, investigate database issues, view alert logs, and package incident information for Oracle Support.

Database administrators commonly use ADRCI to troubleshoot errors, review health information, and maintain the Automatic Diagnostic Repository (ADR).

In this blog, we’ll explore some of the most useful ADRCI commands with practical examples.

What is ADRCI?

ADRCI is a command-line interface that allows you to work with diagnostic information stored in the Automatic Diagnostic Repository (ADR).

Using ADRCI, you can:

  • View database and listener alert logs
  • Investigate incidents and problems
  • Manage trace and dump files
  • Purge old diagnostic data
  • Create diagnostic packages for Oracle Support

Prerequisites

Before using ADRCI, ensure that the Oracle binary directory is included in your system PATH.

For example:

export PATH=$ORACLE_HOME/bin:$PATH

Then start ADRCI by running:

adrci

Listing Available ADR Homes

To view all available ADR homes, run:

show homes

If your server hosts multiple databases or listeners, multiple ADR homes will be displayed.

Setting the ADR Home

If multiple ADR homes exist, set the required home before running commands.

set homepath <ADR_HOME_PATH>

You can change the home path at any time by specifying a different ADR home.

Viewing the Alert Log

One of the most useful ADRCI features is viewing the database alert log.

Use the following command:

show alert

This command displays recent entries from the alert log.

If multiple ADR homes are configured, first select the appropriate home using the set homepath command.

Purging Old Diagnostic Files

Over time, alert logs and trace files consume disk space.

You can remove older diagnostic files using the purge command.

For example, to delete alert logs older than 600 minutes:

purge -age 600 -type ALERT

This removes alert log entries older than 600 minutes.

ADR Retention Policies

ADRCI manages diagnostic files using two retention policies.

LONGP_POLICY

This policy controls the retention period for:

  • ALERT
  • INCIDENT
  • SWEEP
  • Other long-term diagnostic data

The default retention period is 365 days.

SHORTP_POLICY

This policy controls the retention period for:

  • TRACE files
  • CDUMP files
  • Other short-term diagnostic data

The default retention period is 30 days.

Viewing Current Policies

To view the current retention policies, run:

show control

This displays the configured LONGP_POLICY and SHORTP_POLICY values.

Modifying Retention Policies

You can customize the retention period according to your requirements.

For example:

set control (LONGP_POLICY = 8760)

set control (SHORTP_POLICY = 720)

These commands change the retention period for long-term and short-term diagnostic files.

Viewing Database Incidents

To display all recorded incidents:

show incident

This command lists incidents generated by the database, including critical errors such as ORA-600 and ORA-7445.

Creating an Incident Package

When working with Oracle Support, you may need to package incident information.

To package incidents within a specific time range:

ips pack time ‘2026-05-20 12:00:00.00’ to ‘2026-05-21 13:00:00.00’

The package contains diagnostic data that can be uploaded to Oracle Support for analysis.

Viewing Packages

To display all available packages:

ips show package

To view information about a specific package:

ips show package <package_number>

This displays the package contents and associated incidents.

Deleting a Package

If a package is no longer required, delete it using:

ips delete package 2

Replace 2 with the appropriate package number.

Removing an Incident from a Package

To remove an incident from an existing package:

ips remove incident 2 package 1

This removes incident 2 from package 1.

Removing a Problem from a Package

You can also remove a problem key from a package.

Example:

ips remove problem 4 package 3

Replace the problem and package numbers as required.

Common ADRCI Commands

Command Description
show homes Lists available ADR homes
set homepath Sets the active ADR home
show alert Displays the alert log
show incident Lists database incidents
show control Displays retention policies
purge Deletes old diagnostic files
ips pack Creates an incident package
ips show package Displays package information
ips delete package Deletes a package
ips remove incident Removes an incident from a package

Best Practices

 

  • Regularly review the database alert log for warnings and errors.
  • Purge old trace and alert files to prevent unnecessary disk usage.
  • Configure retention policies based on your organization’s requirements.
  • Create incident packages before opening Service Requests with Oracle Support.
  • Monitor ADR storage regularly, especially in production environments.

Conclusion

ADRCI is an essential diagnostic tool for Oracle Database administrators. It simplifies the process of viewing alert logs, investigating incidents, managing diagnostic files, and collecting information for Oracle Support.

By learning the commonly used ADRCI commands, DBAs can troubleshoot issues more efficiently, maintain a clean diagnostic repository, and reduce the time required to resolve database problems. Whether you are managing development, testing, or production databases, ADRCI is a valuable tool that should be part of every Oracle DBA’s toolkit.

 

Recent Posts