RE: Audit Purge Script

  • From: Michael Dinh <mdinh@xxxxxxxxx>
  • To: "'Joel.Patterson@xxxxxxxxxxx'" <Joel.Patterson@xxxxxxxxxxx>, "martin.a.berger@xxxxxxxxx" <martin.a.berger@xxxxxxxxx>, "nagaraj.chk@xxxxxxxxx" <nagaraj.chk@xxxxxxxxx>
  • Date: Fri, 30 Mar 2012 11:29:25 -0700

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@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx] On 
Behalf Of Joel.Patterson@xxxxxxxxxxx
Sent: Friday, March 30, 2012 10:32 AM
To: martin.a.berger@xxxxxxxxx; nagaraj.chk@xxxxxxxxx
Cc: oracle-l@xxxxxxxxxxxxx
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@xxxxxxxxxxxxx [mailto:oracle-l-bounce@xxxxxxxxxxxxx] On 
Behalf Of Martin Berger
Sent: Friday, March 30, 2012 3:13 AM
To: nagaraj.chk@xxxxxxxxx
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@xxxxxxxxx> wrote:
> Kindly give me steps that need to schedule Audit Purge Job for purging the
> table SYS.AUD$ records more than 90 days
--
//www.freelists.org/webpage/oracle-l


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


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


Other related posts: