Home

Traditional auditing packages/functions INIT_CLEANUP, DEINIT_CLEANUP, IS_CLEANUP_INITIALIZED are desupported

Description

    Starting with Oracle Database 23ai, traditional auditing subprograms such as INIT_CLEANUP, DEINIT_CLEANUP, and IS_CLEANUP_INITIALIZED from the DBMS_AUDIT_MGMT package are desupported and removed. These procedures were used to manage audit trail cleanup in the standard auditing framework.

    Oracle now recommends using Unified Auditing along with policy-based cleanup and audit management via supported procedures or manual SQL operations. Developers must revise legacy cleanup logic accordingly to maintain compatibility with Oracle 23ai and beyond.

Key Benefits

  • Future-proofing: Ensures your auditing implementation is compliant with Oracle's current standards.
  • Improved control: Encourages transition to Unified Auditing, which offers centralized and flexible audit management.
  • Reduced risk: Eliminates usage of removed functions that would otherwise lead to runtime failures in newer Oracle versions.

 

Non-compliant Code Example

BEGIN
   IF NOT SYS.DBMS_AUDIT_MGMT.IS_CLEANUP_INITIALIZED() THEN         --Non compliant code (DBMS_AUDIT_MGMT.IS_CLEANUP_INITIALIZED functions is desupported)
      SYS.DBMS_AUDIT_MGMT.INIT_CLEANUP(                             --Non compliant code (DBMS_AUDIT_MGMT.INIT_CLEANUP functions is desupported)
         AUDIT_TRAIL_TYPE => SYS.DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD,
         DEFAULT_CLEANUP_INTERVAL => 24
      );
   END IF;

   SYS.DBMS_AUDIT_MGMT.DEINIT_CLEANUP(                              --Non compliant code (DBMS_AUDIT_MGMT.DEINIT_CLEANUP functions is desupported)
      AUDIT_TRAIL_TYPE => SYS.DBMS_AUDIT_MGMT.AUDIT_TRAIL_AUD_STD
   );
END;

Compliant Code Example

--Manually delete audit records older than a certain date
BEGIN
   DBMS_AUDIT_MGMT.SET_LAST_ARCHIVE_TIMESTAMP(                  --Compliant code 
      AUDIT_TRAIL_TYPE => DBMS_AUDIT_MGMT.AUDIT_TRAIL_UNIFIED,
      LAST_ARCHIVE_TIME => SYSTIMESTAMP - INTERVAL '90' DAY
   );

   DBMS_AUDIT_MGMT.CLEAN_AUDIT_TRAIL(                           --Compliant code 
      AUDIT_TRAIL_TYPE => DBMS_AUDIT_MGMT.AUDIT_TRAIL_UNIFIED,
      USE_LAST_ARCH_TIMESTAMP => TRUE
   );
END;
Visual Expert 2025
 VEPLSQLRULE215