This is how I purged my unified audit trail on an Oracle 12.2 instance. The procedure has also been tested in a 19c instance.
First, check the LAST_ARCHIVE_TS:
SELECT * FROM DBA_AUDIT_MGMT_LAST_ARCH_TS;
If you want to keep some of your audit records, set a timestamp before which all records should be purged. In this particular example, I want to preserve only the last 30 days worth of audit data. The rest can be purged:
BEGIN DBMS_AUDIT_MGMT.SET_LAST_ARCHIVE_TIMESTAMP ( AUDIT_TRAIL_TYPE => DBMS_AUDIT_MGMT.AUDIT_TRAIL_UNIFIED, LAST_ARCHIVE_TIME => SYSTIMESTAMP-30); END; /
Purge the audit trail, up until the LAST_ARCHIVE_TIMESTAMP:
BEGIN DBMS_AUDIT_MGMT.clean_audit_trail( audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_UNIFIED, use_last_arch_timestamp => TRUE); END; /
If you simply want to purge all records, run the same procedure but without the "use_last_arch_timestamp" directive:
BEGIN DBMS_AUDIT_MGMT.clean_audit_trail( audit_trail_type => DBMS_AUDIT_MGMT.AUDIT_TRAIL_UNIFIED, use_last_arch_timestamp => FALSE); ); END; /
The dbms_audit_mgmt is documented here