Site icon Database Tutorials

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:

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

Exit mobile version