ADRCI how to purge oracle trace files

 

ADRCI – Auto Purge Old Trace and Incident files
How to purge Oracle trace files through adrci
What is ADRCI?

ADRCI is a new feature introduced from 11G onwards. It is used to deal with diagnostic information.

It has multiple features such as:

  1. Analyze diagnostic data within the Automatic Diagnostic Repository (ADR).
  2. Create a package with incident/problem information for Oracle Support.
  3. Auto purge of old diagnostic files.

Auto purge of old Diagnostic files:

One of the feature of ADRCI is to purge the old diagnostic information/files. This is controlled by two parameters in ADRCI utility.

  1. SHORTP_POLICY:  Which is used for automatically purging short-lived files, i.e. core dump files and traces, expressed in hours and defaults to 30 days.
  1. LONGP_POLICY: Which is used for automatically purging long-lived files, i.e. incidents and health monitor warnings, expressed in hours and defaults to 1 year.

How the purge cycle is defined:

The auto-purge will ONLY purge every 7 days and this has always been the way it was designed. It then uses the SHORTP_POLICY and LONGP_POLICY values to determine how much information to purge. The ADR purge is run towards the end of the regular AWR purge.

There is no control on the purge frequency, it is fixed to be 48 hours after startup and then every 7 days. Manual purge is the only way to control purge actions in between.

Some commands for ADRCI:
Set environment variable

. oraenv
SID

After set environment Enter adrci command to connect adrci prompt

[oracle@prod ~]$ adrci
ADRCI: Release 11.2.0.1.0 – Production on Mon Feb 6 00:42:15 2017
Copyright (c) 1982, 2009, Oracle and/or its affiliates. All rights reserved.
ADR base = “/u01/app/oracle”

Adrci> show homes (This command will list all the available database trace directories.)

adrci> show homes
ADR Homes:
diag/tnslsnr/prod/lsnrctl_prod
diag/tnslsnr/prod/prod
diag/tnslsnr/prod/listener
diag/tnslsnr/prod/listener_prod
diag/rdbms/prod/prod
diag/rdbms/chicago/chicago
diag/rdbms/india/india
diag/rdbms/qdev1/qdev1

adrcihome

Adrci> set homepath <home path to set>(This command will use to set a specific home value (trace directory)

adrci> set homepath diag/rdbms/chicago/Chicago

sethome

Adrci> show control

This command will list the settings of “shortp_policy”, “longp_policy” and when was the last auto purge happened.

show control1

adrci > set control (SHORTP_POLICY = 168)

adrci> set control (LONGP_POLICY = 168)

This command is use to reset the short policy and long policy and this is set in hours.

After set control now sort policy and long policy is 168hr /7 days.

Adrci>Show control

showcontrol2

SHORTP POLICY (ADRCI SETTINGS) –
168 hours / 7 days (will keep last 7 days of files and delete all)

LONGP POLICY (ADRCI SETTINGS) –
168 hours / 7 days (will keep last 7 days of files and delete all)

ADRCI SETTINGS and PURGE:

Adrci> set homepath <home path to set>
adrci > set control (SHORTP_POLICY = 168)
adrci> set control (LONGP_POLICY = 168)

Purge – this will purge all the files by keeping last 7 days of files.
Adrci> purge
Manually purge the traces-

Adrci> help
Use to get help on commands.

Leave a Reply

Your email address will not be published. Required fields are marked *