RE: Audit Purge Script

From: Michael Dinh <mdinh_at_XIFIN.Com>
Date: Fri, 30 Mar 2012 11:29:25 -0700
Message-ID: <D29F9902E534D5478F2E83FD6A44B30649BF83CC70_at_mail02.mba.xifin.com>



This is what I have in place for 11.2.0.2 for AUDIT purging.

HTH BEGIN
  DBMS_AUDIT_MGMT.create_purge_job(

    audit_trail_type           => DBMS_AUDIT_MGMT.AUDIT_TRAIL_ALL,
    audit_trail_purge_interval => 24,
    audit_trail_purge_name     => 'PURGE_ALL_AUDIT_TRAILS',
    use_last_arch_timestamp => TRUE); END;
/

BEGIN
  DBMS_SCHEDULER.create_job (

    job_name        => 'SET_LAST_ARCHIVE_TIMESTAMP',
    job_type        => 'PLSQL_BLOCK',
    job_action      => 'BEGIN DBMS_AUDIT_MGMT.SET_LAST_ARCHIVE_TIMESTAMP(audit_trail_type=>DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD,last_archive_time=>SYSTIMESTAMP-90); END;',
    start_date      => SYSTIMESTAMP,
    repeat_interval => 'FREQ=DAILY; INTERVAL=1;',
    end_date        => NULL,
    enabled         => TRUE,
    comments        => 'SET_LAST_ARCHIVE_TIMESTAMP');
END;
/

Michael Dinh
Disparity Breaks Automation (DBA)

Confidence comes not from always being right but from not fearing to be wrong - Peter T Mcintyre Great minds discuss ideas; average minds discuss events; small minds discuss people - Eleanor Roosevelt  When any rule or formula becomes a substitute for thought rather than an aid to thinking, it is dangerous and should be discarded -Thomas William Phelps  
-----Original Message-----
From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Joel.Patterson_at_crowley.com Sent: Friday, March 30, 2012 10:32 AM
To: martin.a.berger_at_gmail.com; nagaraj.chk_at_gmail.com Cc: oracle-l_at_freelists.org
Subject: RE: Audit Purge Script

The problem I had to wrestle with when considering dbms_audit_mgmt was that the audit table needs to be moved to an entirely new tablespace... which I believe comes with upgrade details.

I kathryn's script works and does the job just as good, it certainly is easier. All the code in this doc ID seems to be an awful lot when compared scheduling this simple script.

Joel Patterson
Database Administrator
904 727-2546

-----Original Message-----
From: oracle-l-bounce_at_freelists.org [mailto:oracle-l-bounce_at_freelists.org] On Behalf Of Martin Berger Sent: Friday, March 30, 2012 3:13 AM
To: nagaraj.chk_at_gmail.com
Cc: oracle-l
Subject: Re: Audit Purge Script

maybe you want to read
SCRIPT: Basic example to manage AUD$ table in 11.2 with dbms_audit_mgmt [ID 1362997.1]
in MetaLink.

hth,
 Martin

On Thu, Mar 29, 2012 at 22:45, Nagaraj S <nagaraj.chk_at_gmail.com> wrote:
> Kindly give me steps that need to schedule Audit Purge Job for purging the
> table SYS.AUD$ records more than 90 days

--
http://www.freelists.org/webpage/oracle-l


--
http://www.freelists.org/webpage/oracle-l


--
http://www.freelists.org/webpage/oracle-l
Received on Fri Mar 30 2012 - 13:29:25 CDT

Original text of this message