Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Automatic Purge of OS Audit Files Older Than 30 Days

2906806Apr 15 2015 — edited Apr 16 2015

Running Oracle 11.2.0.4. We're attempting to purge OS Audit files (.aud) in this case on an AIX system.

Using this command:

begin

   dbms_audit_mgmt.create_purge_job (

   audit_trail_type            => dbms_audit_mgmt.audit_trail_OS,

   audit_trail_purge_interval  => 24,

   audit_trail_purge_name      => 'OS_PURGE',

   use_last_arch_timestamp     => TRUE

   );

end;

/


I was able to delete files >30 days old using this command to create a timestamp:

begin

   dbms_audit_mgmt.set_last_archive_timestamp(

     audit_trail_type  => dbms_audit_mgmt.audit_trail_OS,

     last_archive_time =>

        to_timestamp('2015-03-14 00:00:00','YYYY-MM-DD HH24:MI:SS'),

     rac_instance_number  => null

   );

end;

/

The way it's setup, I can get it to delete all files before March 14th every 24 hours, which is good for April 14th, 2015! However, we need someway to do this automatically.

Is there anyway to either have some alternate use of "use_last_arch_timestamp => false" so that it doesn't use a time stamp but also doesn't delete everything?

Or is there a way to automate the creation of a timestamp that would create something 30 days prior? 

Also, I apologize if I didn't put this in the right Place, I was not sure at all where I should put this.

This post has been answered by ABU JAMAN on Apr 15 2015
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on May 14 2015
Added on Apr 15 2015
4 comments
1,397 views