How To Delete Trace Files, listener log etc with ADRCI

With ADRCI, it is possible to delete files such as “log, trace, incident, cdump” created before a certain day. Instead of manually deleting individual files, you can do this very easily using adrci.

You must have set Oracle Base to use ADRCI. You can find detailed information about the use of this tool in the article “ADR Command Interpreter (ADRCI)“.

Start ADRCI:

Then you should list the available homes and set a home. The example shows the steps required to delete listener alert files.

List of available homes:

Set home:

Deleting previous Trace and ALERT files created before 3600 minutes(1 day) in set home:

It is possible to delete the following file types with the same command:

  • ALERT – files in ./alert directory
  • INCIDENT — files in ./incident/incdir_<incid> directory
  • TRACE — files in ./trace directory
  • CDUMP — files in ./cdump directory
  • UTSCDMP — ./trace/cdmp_<timestamp> directories
  • STAGE — files in ./stage directory
  • SWEEP — files in ./sweep directory
  • HM — files in the ./hm directory and metadata information in the HM schema
  • IPS — files in the ./incpkg directory and the metadata information in the IPS schema

The following command can be used to delete all files:

These processes can be done automatically using the adrci tool.

Current policies need to be changed after the relevant home is set.

An empty LAST_AUTOPRG_TIME field in the above output indicates that no deletions have been made automatically.

SHORTP_POLICY value should be changed for Incident and health monitor warnings and LONGP_POLICY value should be changed for trace and core dump files. The values ​​here are in hours. It is observed that it will not erase for a very long time according to the current values. We need to make these values ​​more acceptable. For example, files before a week can be deleted.

Set SHORTP_POLICY and LONGP_POLICY:

Instead of making this change one by one for each home, it is possible to do it at once with a script as follows.

adrci_set_policy.sh

dbtut
Author: dbtut

We are a team with over 10 years of database management and BI experience. Our Expertises: Oracle, SQL Server, PostgreSQL, MySQL, MongoDB, Elasticsearch, Kibana, Grafana.

One comment

  1. “Deleting previous Trace and ALERT files created before 3600 minutes(1 day) in set home:”

    purge is in minutes

    60 minutes X 24 hours = 1440 minutes NOT 3600

    setting 3600 you delete files older than 2.5 day (3600 / 60min / 24 h)

Leave a Reply

Your email address will not be published. Required fields are marked *