Re: anyone have a decent purge script for 11g diag directories

From: hpuxrac <johnbhurley_at_sbcglobal.net>
Date: Sat, 15 Nov 2008 07:12:28 -0800 (PST)
Message-ID: <d58f5ef5-f6cd-4af7-b6fb-c4fa44e5a50b@40g2000prx.googlegroups.com>


On Nov 15, 5:15 am, "jan.benjam..._at_gmail.com" <jan.benjam..._at_gmail.com> wrote:

snip

> The new adrci command line tool could do this, look at the purge
> command:
>
> $ adrci
>
> ADRCI: Release 11.1.0.7.0 - Production on Sat Nov 15 11:16:48 2008
>
> Copyright (c) 1982, 2007, Oracle.  All rights reserved.
>
> ADR base = "/app/oracle"
> adrci> help purge
>
>   Usage: PURGE [[-i <id1> | <id1> <id2>] |
>                [-age <mins> [-type ALERT|INCIDENT|TRACE|CDUMP|HM|
> UTSCDMP]]]:
>
>   Purpose: Purge the diagnostic data in the current ADR home. If no
>            option is specified, the default purging policy will be
> used.
>
>   Options:
>     [-i id1 | id1 id2]: Users can input a single incident ID, or a
>     range of incidents to purge.
>
>     [-age <mins>]: Users can specify the purging policy either to all
>     the diagnostic data or the specified type. The data older than
> <mins>
>     ago will be purged
>
>     [-type ALERT|INCIDENT|TRACE|CDUMP|HM|UTSCDMP]: Users can specify
> what type of
>     data to be purged.
>
>   Examples:
>     purge
>     purge -i 123 456
>     purge -age 60 -type incident
>
> adrci>

Yes thank you this seems to work well and was what I was looking for ... ( will come up with something that looks at the various adr homes and drives a purge based on parameters of how many days old alert files to ditch ).

Looks like it cleans out the .trc and .trm files together of course ...

#!/bin/ksh
. /home/oracle/ora_11g_env
adrci << EOF
set home diag/rdbms/test11g/test11g
purge -age 4320 -type trace
exit
EOF Received on Sat Nov 15 2008 - 09:12:28 CST

Original text of this message