Saturday, January 11, 2014

How to purge Oracle alert, trace and log files generated in Oracle 11gRx?

Today I have been seen a lot of files generated into "$ORACLE_BASE/diag" directory (I'm using Oracle Enterprise Linux 5).
So I decided to know how to delete them gracefully.
I looked for through Oracle documentation and I founded the following utility out called
ADRCI  (stands for ADR Command Interpreter -ADRCI). So I tried to use it and see what happens.

1. The first Step
Connect to Oracle server using a ssh,telnet or X-windows connector utility. I'm going to use Kitty (ssh tool connector)


login as: oracle
oracle@192.168.1.17's password:







After this, load the Oracle environment's variables.

$. oraenv   (see the period at the beginning of the line)

$ . oraenv
ORACLE_SID = [oracle] ? demogpr
The Oracle base for ORACLE_HOME=/oracle/db/product/11.2.0/home is /oracle/db



ScreenShot-01







2. Second step
Go to  $ORACLE_HOME

$ cd $ORACLE_BASE
$ adrci

ADRCI: Release 11.2.0.2.0 - Production on Sat Jan 11 20:11:22 2014

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

ADR base = "/oracle/db"
adrci>

ScreenShot-02










Now, it is important to know what "homes" the system has set up on your system, so use the "show homes" command to see them

adrci> show homes
ADR Homes:
diag/rdbms/demogpr/demogpr
diag/tnslsnr/demogpr/listener
diag/tnslsnr/demogpr/listenerpdn
adrci>








3. Clean your "homes"
Using adrci I'm going to clean the rdbms home first.
As a result I will purge the last 21 days ( specify the time in minutes 21 days = 21*60*24)

Ok. You know how many homes you have so you need to select one by one and clean them.

Choose the ADR home from the list above:

adrci>set homepath  diag/rdbms/demogpr/demogpr

Now purge the alert types

adrci> purge -age 21600 -type ALERT
adrci> purge -age 21600 -type TRACE
adrci> purge -age 21600 -type incident
adrci> purge -age 21600 -type hm
adrci> purge -age 21600 -type utscdmp
adrci> purge -age 21600 -type cdump

Screenshot04






If you want to see more details please read

http://docs.oracle.com/cd/E11882_01/server.112/e22490/adrci.htm#SUTIL700

No comments:

Post a Comment