2

I try to clean audit trail (my database version is 11.2.0.3.0). Everything run without errors, but audit trail is not purged.

Here is what I do:

1) cleanup inicialization

BEGIN
  IF NOT DBMS_AUDIT_MGMT.IS_CLEANUP_INITIALIZED(DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD)
THEN
  DBMS_AUDIT_MGMT.INIT_CLEANUP(
  audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD, -- AUD log
  default_cleanup_interval => 24 /* hours */);
  END IF;
END;
/

2) setting timestamp

begin
dbms_audit_mgmt.set_last_archive_timestamp(
 audit_trail_type  => dbms_audit_mgmt.audit_trail_aud_std,
 last_archive_time => to_timestamp(SYSDATE - 400),
 rac_instance_number  => null
 );
end;
/

3) clean trail

begin
dbms_audit_mgmt.clean_audit_trail(
   audit_trail_type        =>  dbms_audit_mgmt.audit_trail_aud_std,
  use_last_arch_timestamp => TRUE
);
end;
/
commit;

and when i compare min date of records in AUD$ table it should differ, but value is the same before and after cleaning:

select min(NTIMESTAMP#) from AUD$;

Any ideas what I'm doing wrong? PL/SQL procedure successfully completed is what I get after running dbms_audit_mgmt.clean_audit_trail, but records are not purged.

user3682425
  • 21
  • 1
  • 5
  • What result do you get when you execute `select min(NTIMESTAMP#) from AUD$`? – Bob Jarvis - Слава Україні Jun 25 '14 at 01:49
  • 1
    Problem was this: Note 1431343.1: The audit records in AUD$ were imported from another database and consequently have a different DBID to the current database. DBMS_AUDIT_MGMT.CLEAN_AUDIT_TRAIL uses the DBID of the current database to identify records to be purged. – user3682425 Jun 27 '14 at 07:26

0 Answers0