Purge-Trace-Dump-Files-11g



From Oracle 11g onwards, there is a new feature to deal with diagnostic information. 

ADR Command Interpreter (ADRCI) 

It has multiple features such as 
  • analyze diagnostic data within the Automatic Diagnostic Repository (ADR).
  • create a package with incident / problem information for Oracle Support
  • run the Health Checks

and many other features.

In this post, we'll be focusing on purging the old diagnostic files with ADRCI.

Set your environment and run the ADRCI utility:

$ adrci


Use the following command to list the ADR homes:


adrci> show homes

ADR Homes:

diag/rdbms/mytestdb/MYTESTDB1
diag/rdbms/mytestdb/MYTESTDB

Choose the ADR home from the list above:

adrci> set homepath diag/rdbms/mytestdb/MYTESTDB1

Check the current retention policy:

adrci> show control



Check the following columns in the output:

LONGP_POLICY (long term) is set to 365 days by default. It is responsible for Incidents and Health Monitor warnings.


SHORTP_POLICY (short term) is set to 30 days by default. It manages the trace and core dump files. 


Use the following commands to change the retention policy (optional).
* Specify the time in hours ( 240 = 10 days , 1095 = 1 .5 Months )


adrci> set control (SHORTP_POLICY = 240)
adrci> set control (LONGP_POLICY = 1095)


Now you have the following alternatives to purge the old logs/traces:

1) Purge the old files manually ( specify the retention period explicitly )

* Specify the time in minutes ( 10080/60/24=7 Days )
** It is possible to purge different diagnostic files separately
adrci> purge -age 10080 -type ALERT
adrci> purge -age 10080 -type TRACE
adrci> purge -age 10080 -type incident
adrci> purge -age 10080 -type hm
adrci> purge -age 10080 -type utscdmp
adrci> purge -age 10080 -type cdump

** Also you may want to purge all files at once
adrci> purge -age 10080


2) Use autopurge option ( in this case the current retention policy is applied )

adrci> purge

No comments: