Change the ADR retention

It is a good practice to set proper SHORTP_POLICY & LONGP_POLICY for your environment. For example retention in TEST/DEV environment is shorter than in PROD.

The default retention for SHORTP_POLICY is 720 ( HOURS ) /30 days, LONGP_POLICY is 8760 ( HOURS ) or 1 year.  The details are described as below:

Attribute NameDescription
SHORTP_POLICYNumber of hours after which to purge ADR contents that have a short life. Default is 720 (30 days).A setting of 0 (zero) means that all contents that have a short life can be purged. The maximum setting is 35791394. If a value greater than 35791394 is specified, then this attribute is set to 0 (zero).

 


The ADR contents that have a short life include the following:

  • Trace files
  • Core dump files
  • Packaging information
LONGP_POLICYNumber of hours after which to purge ADR contents that have a long life. Default is 8760 (365 days).A setting of 0 (zero) means that all contents that have a long life can be purged. The maximum setting is 35791394. If a value greater than 35791394 is specified, then this attribute is set to 0 (zero).

 

The ADR contents that have a long life include the following:

  • Incident information
  • Incident dumps
  • Alert logs
SHORTP_POLICY & LONGP_POLICY definition

The following example illustrates how to change retention policies to 1 week ( 168 hours )  and 2 weeks ( 336 hours ) respectively:

oracle@racnode1:/u01/app/oracle/diag/rdbms/ractest/RACTEST1/trace$ adrci

ADRCI: Release 12.1.0.2.0 - Production on Mon May 22 10:43:49 2017

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

ADR base = "/u01/app/oracle"
adrci> show home
ADR Homes:
diag/rdbms/eactest/RACTEST1
adrci> select SHORTP_POLICY,LONGP_POLICY from ADR_CONTROL;

ADR Home = /u01/app/oracle/diag/rdbms/ractest/RACTEST1:
*************************************************************************exit

SHORTP_POLICY         LONGP_POLICY
-------------------- --------------------
720                   8760

1 rows fetched

adrci> set control (SHORTP_POLICY=168);
adrci> select SHORTP_POLICY,LONGP_POLICY from ADR_CONTROL;

ADR Home = /u01/app/oracle/diag/rdbms/ractest/RACTEST1:
*************************************************************************
SHORTP_POLICY         LONGP_POLICY
-------------------- --------------------
168                    8760

1 rows fetched

adrci> set control (LONGP_POLICY=336 );
adrci> select SHORTP_POLICY,LONGP_POLICY from ADR_CONTROL;

ADR Home = /u01/app/oracle/diag/rdbms/ractest/RACTEST1:
*************************************************************************
SHORTP_POLICY         LONGP_POLICY
-------------------- --------------------
168                   336

1 rows fetched


adrci> purge;
adrci>

To purge incident files older than 6 days ( 8640 MINUTES ) , you will need to prefer the following commands:

adrci> purge -age 8640 -type INCIDENT

Where is 12.1.0.2 Oracle Clusterware Diagnostic and Alert Logs ?

From 12.1.0.2, Clusterware Diagnostic and Alert Logs are relocated from $GI_HOME/log/ to GI $ORACLE_BASE/diag/

We’ve just upgraded Oracle 12.1.0.1 GI to 12.1.0.2, and found clusterware logs have been relocated from $GI_HOME/log/.

According to Oracle support Doc (ID 1915729.1), from Oracle 12.1.0.2 on Oracle clusterware (part of Grid Infrastructure) uses Oracle database fault diagnosability infrastructure to manage diagnostic data and its alert logs. As a result, most diagnostic data resides in the Automatic Diagnostic Repository (ADR).

Please note :

1)More space is required for GI $ORACLE_BASE in case of file system full , because Clusterware logs are moved to ADR which is part of ORACLE_BASE.

2)When opening SR, instead of diagcollection.pl, TFA should be used to collect diagnostics:
$/u01/app/12.1.0.2/grid/bin/tfactl diagcollect -from “Jan/20/2015 08:00:00” -to “Jan/23/2015 13:00:00”

Collecting data for all nodes
Scanning files from Jan/20/2015 08:00:00 to Jan/23/2015 13:00:00

Repository Location in hx415 : /u01/app/grid/tfa/repository
2015/01/23 14:42:55 EST : Running an inventory clusterwide …
2015/01/23 14:42:55 EST : Collection Name : tfa_Fri_Jan_23_14_42_49_EST_2015.zip
……
……
……