0

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.

2

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;
/
  • 1
    Thank you very much for your quick response! – miguel ramires Oct 9 '19 at 19:00
  • 1
    With the proposed solution in effect clean the FGA_LOG$ table, now the problem is that even if the number of records has dropped from 50,000,000 to 900,000 for example it is still the same size as it was before cleaning, probably due to the high degree fragmentation, can I simply truncate the records in this table ... is it safe to truncate in that table fga_log $? How could I eliminate that fragmentation in that particular table? – miguel ramires Oct 16 '19 at 18:40
  • 2
    @miguelramires Deleting rows from a segment will not decrease the size of the segment, it just marks the rows deleted. If you do not need the data, just truncate that table. – Balazs Papp Oct 16 '19 at 18:59
  • OK, thank you very much – miguel ramires Oct 16 '19 at 19:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.