Removing tracefiles with ADRCI

Removing tracefiles with ADRCI

The ADRCI (Automatic Diagnostic Repository Command Interpreter) is a command-line tool that you use to manage Oracle Database diagnostic data.

Below command will manually purge all tracefiles older than 10 days (14400 minutes) reducing occupation of filesystem “/u01”:

Syntax:

purge [[-i {id | start_id end_id}] | [-age mins [-type {ALERT|INCIDENT|TRACE|CDUMP|HM}]]]


$ df -kh /u01
Filesystem Size Used Avail Use% Mounted on
/dev/mapper/VGExaDbM-LVDbOra1
129G 86G 37G 71% /u01

$ adrci

ADRCI: Release 12.1.0.2.0 - Production on Tue May 19 11:50:42 2020

Copyright (c) 1982, 2014, Oracle and/or its affiliates. All rights reserved.

ADR base = "/u01/app/oracle"
adrci> show home
ADR Homes:
diag/rdbms/adp1/adp12
diag/rdbms/adp2/adp22
diag/rdbms/tenancy/tenancy2
diag/diagtool/user_oracle/host_3121538055_80
adrci> set home diag/rdbms/tenancy/tenancy2
adrci> purge -age 14400 -type trace

$ df -kh /u01
Flesystem Size Used Avail Use% Mounted on
/dev/mapper/VGExaDbM-LVDbOra1
129G 80G 43G 65% /u01

 

Setting Retention Policy:

LONGP_POLICY is set to 720 hours (30 days). It is responsible for Incidents and Health Monitor warnings
SHORTP_POLICY is set to 8760 hours (One year). It manages the trace and core dump files.

 


adrci> show control

ADR Home = /u01/app/oracle/diag/rdbms/tenancy/tenancy2:
*************************************************************************
ADRID SHORTP_POLICY LONGP_POLICY LAST_MOD_TIME LAST_AUTOPRG_TIME LAST_MANUPRG_TIME ADRDIR_VERSION ADRSCHM_VERSION ADRSCHMV_SUMMARY ADRALERT_VERSION CREATE_TIME
----------- ------------ ------------ ------------------------- -------------------------- ------------------- -------------- --------------- ---------------- ---------------- -----------
514873012 720 8760 2017-07-12 10:25:21.914962 -03:00 2020-05-13 13:58:55.293112 -03:00 2020-03-23 06:54:59.256114 -03:00 1 2 82 1 2017-07-12 10:25:21.914962 -03:00
1 rows fetched

Changing the retention police. Specify the time in hours ( 360 = 15 days , 1095 = 1.5 Months )


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

 

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


adrci> purge

 

References

ADRCI: ADR Command Interpreter. Available at: https://docs.oracle.com/cd/B28359_01/server.111/b28319/adrci.htm#BABBHGFC