Posts

Showing posts from 2017

Oracle 12c : How To Purge The UNIFIED AUDIT TRAIL

Image
Oracle 12c : How To Purge The UNIFIED AUDIT TRAIL  APPLIES TO: Oracle Database - Enterprise Edition - Version 12.1.0.1 and later Information in this document applies to any platform. GOAL  How to purge the  UNIFIED_AUDIT_TRAIL table ? SOLUTION The unified audit trail can be purged using the DBMS_AUDIT_MGMT package:  qlplus / as sysdba SQL>  select  count(*) from unified_audit_trail;   COUNT(*) ----------       2619 SQL>  BEGIN DBMS_AUDIT_MGMT.CLEAN_AUDIT_TRAIL( audit_trail_type         =>  DBMS_AUDIT_MGMT.AUDIT_TRAIL_UNIFIED, use_last_arch_timestamp  =>  FALSE); END; / PL/SQL procedure successfully completed. SQL>  select  count(*) from unified_audit_trail;   COUNT(*) ----------          1 You can also use the last_arch_timestamp, if you don't want to purge all the audit record and kept the most recent record: BEGIN DBMS_AUDIT_MGMT.SET_LAST_ARCHIVE_TIMESTAMP(audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_OS,last_archive_ti