Oracle 12c how to purge the FGA audit records before a certain date

auditoracleoracle-12c

please I need to know how to purge the FGA audit records before a certain date, I have an Oracle 12c R1 database in which the audit with FGA is implemented, the tables of this are in a tablespace called ts_audit.dbf that It has already had 3 full datafiles and continues to be filled at a dizzying pace due to the intensive use of the database, for this reason I need to purge the oldest records, let's just leave those of the last week.
Thank you very much for your help.

Best Answer

Administering the Audit Trail

begin
  DBMS_AUDIT_MGMT.SET_LAST_ARCHIVE_TIMESTAMP
  (
    audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_FGA_STD,
    last_archive_time => sysdate - 7
  );
end;
/


begin
  DBMS_AUDIT_MGMT.CLEAN_AUDIT_TRAIL
  (
    audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_FGA_STD,
    use_last_arch_timestamp => true
  );
end;
/