Change purge policy with adrci utility in Orace

Set the purge policy for trace files with ADRCI utility in Automatic Diagnostic Repository

In ADR, we have the default setting for purging our log files like alert log ,trace ,listener, we have different homes set in diag location which we will have to purge the trace files automatic as per setting.

Show the purging details set in your environment with ADRCI utility

# connect with ADRCI utility on Oracle Server installed.
C:\Users\oracle>adrci
ADRCI: Release 18.0.0.0.0 - Production on Sat Sep 25 12:12:53 2021
Copyright (c) 1982, 2019, Oracle and/or its affiliates.  All rights reserved.
ADR base = "C:\Oracle"

# Show the homes
adrci> show homes
ADR Homes:
diag\rdbms\xe\xe
diag\tnslsnr\IXC1-LT8TBDWT2\listener

# Set the homes
adrci> set home diag\rdbms\xe\xe

# See the current setting of purging policy 
adrci> show control

ADR Home = C:\Oracle\diag\rdbms\xe\xe:
*************************************************************************
ADRID                SHORTP_POLICY        LONGP_POLICY         LAST_MOD_TIME                            LAST_AUTOPRG_TIME                        LAST_MANUPRG_TIME                        ADRDIR_VERSION       ADRSCHM_VERSION      ADRSCHMV_SUMMARY     ADRALERT_VERSION     CREATE_TIME
-------------------- -------------------- -------------------- ---------------------------------------- ---------------------------------------- ---------------------------------------- -------------------- -------------------- -------------------- -------------------- ----------------------------------------
213375795            72                   8760                 2021-09-13 18:48:37.996000 +05:30        2021-09-25 12:00:22.782000 +05:30                                                 1                    2                    110                  1                    2019-09-18 15:33:15.739000 +05:30
1 row fetched

In current setting, we have shortp_policy and longp_policy both values are consider in hours to purge the trace or log files. Example Shortp_policy = 72 hours means 3 days or Longp_policy = 8760 hours means 365 days (1 year)

Shortp_policy used for purge the short life needed trace or logs like TRACE, CDUMP, UTSCDMP etc.

Longp_policy used for purge long life needed trace or logs file like alert, incident, sWeep, stage etc.

Change the value of shortp_policy and longp_policy:

-- Set for shortp_policy for 30 days
adrci> SET CONTROL (SHORTP_POLICY = 720 )

--Set longp_policy for 90 days
adrci> SET CONTROL (LONGP_POLICY = 2160 )

--Check changed values:
adrci> show control

ADR Home = C:\Oracle\diag\tnslsnr\IXC1-LT8TBDWT2\listener:
*************************************************************************
ADRID                SHORTP_POLICY        LONGP_POLICY         LAST_MOD_TIME                            LAST_AUTOPRG_TIME                        LAST_MANUPRG_TIME                        ADRDIR_VERSION       ADRSCHM_VERSION      ADRSCHMV_SUMMARY     ADRALERT_VERSION     CREATE_TIME
-------------------- -------------------- -------------------- ---------------------------------------- ---------------------------------------- ---------------------------------------- -------------------- -------------------- -------------------- -------------------- ----------------------------------------
2233230090           720                  2160                 2021-09-25 12:26:08.873000 +05:30                                                                                          1                    2                    110                  1                    2019-09-18 15:28:56.125000 +05:30
1 row fetched

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.