How to Delete Old Trace & Dump files with ADRCI


The ADRCI command interpreter has multiple features:-
  • Create a package with incident or problem information for Oracle Support
  • Analyze diagnostic data within the Automatic Diagnostic Repository (ADR)
  • Run health checks
In this post, we'll be concentrating on deleting 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 home

ADR Homes:
diag/rdbms/db11g/DB11G
diag/tnslsnr/sol10/listener

Choose the ADR home from the list above:
adrci> set home diag/rdbms/db11g/DB11G
Check the current retention policy:

adrci> show control


Check the following columns in the output:
LONGP_POLICY:-
It is set to 365 days by default.
It is responsible for Incidents and Health Monitor warnings.
SHORTP_POLICY:-
It is set to 30 days by default.
It manages the trace and core dump files.

Use the following commands to change the retention policy:
Specify the time in hours: 10 Days = 240 , 1 Month = 744

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

Now you have the following choices to purge the old logs/traces:
1) Purge the old files manually:
 To delete manually you have to specify the retention period explicitly
Specify the time in minutes e.g 7 days old files is  7x24x60 = 10080
It is also possible to delete 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:
With just this command the current retention policy is applied.

adrci> purge

Comments

Post a Comment