Oracle – Clear Logs & Traces using ADRCI

One of my Oracle servers became full and I noticed one of my Database consumed over 40Go of logs stored in “../diag/rdbms/db_name” unless the Retention Policy was low…

Here’s how i cleaned this up manually using ADRCI tool in a Command Prompt.

C:\Users\Administrator>adrci

ADRCI: Release 11.2.0.3.0 - Production on Mer. Mars 22 09:53:24 2017

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

ADR base = "D:\oracle"
adrci> show homes
ADR Homes:
diag\rdbms\db_name\db_name
adrci> set home diag\rdbms\db_name\db_name
adrci> purge

 

If needed, you can check the Retention Policy using:

adrci> show control

And change it using (Example. Note it is defined in Hours):

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

 

LONGP_POLICY (long term) defaults to 365 days and relates to things like Incidents and Health Monitor warnings.
SHORTP_POLICY (short term) defaults to 30 days and relates to things like trace and core dump files

 

 

 

 

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s