Tuesday, December 27, 2022

How to Delete Old Trace & Dump files with ADRCI


How to Delete Old Trace & Dump files with ADRCI

How to use the purge command in adrci

Purging Oracle Database's Alert Log with ADRCI

Cleaning Database logs using ADRCI

Oracle Automatic Diagnostic Repository 

 

In this post we'll focus on how to delete old trace and dump file with ADRCI

In you server, set your environment or run your environment file. 

Now run this ADRCI command

 

Note: purge command does not support multiple ADR home, So you have to select your home first.

adrci> show home

    ADR Homes: 

    diag/rdbms/test/TEST

    diag/tnslsnr/ebs/test

 

 Choose the ADR home from the list above:

adrci> set home diag/rdbms/test/TEST


 To purge all files at once

adrci> purge -age 1440  

(1440 number counting as minutes, 1440 minutes = 24 Hour = 1 day)

you can change number of minutes as per your requirements


To delete different diagnostic files separately


adrci> purge -age 1440 -type ALERT

adrci> purge -age 1440 -type TRACE

adrci> purge -age 1440 -type cdump

adrci> purge -age 1440 -type incident

adrci> purge -age 1440 -type hm

adrci> purge -age 1440 -type utscdmp


To Use autopurge option according to retention policy 

adrci> purge

 

If you want to check and change your current retention policy, then check below info... 

 adrci> show control


 LONGP_POLICY is set with default value 8760 hours is equal to 365 days

SHORTP_POLICY is set with default value 720 hours is equal to 30 days


you can set your own retention policy as per your required days

use below command to set your retention policy..

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

 

now check again

adrci> show control


 

Hope you understand this article and if you have any queries  then feel free to comment below.


 You can find me on Fiverr & LinkedIn