Unable To Create Or Drop Purge Job Using DBMS_AUDIT_MGMT (Doc ID 1252235.1)

Last updated on OCTOBER 13, 2016

Applies to:

Oracle Audit Vault - Version 10.2.2 to 10.2.3.2.0
Oracle Database - Enterprise Edition - Version 10.2.0.4 to 11.2.0.4 [Release 10.2 to 11.2]
Information in this document applies to any platform.

Symptoms

You are trying to create an audit trail purge job using DBMS_AUDIT_MGMT and it is failing with the following error:


SQL> BEGIN
DBMS_AUDIT_MGMT.CREATE_PURGE_JOB (
AUDIT_TRAIL_TYPE => DBMS_AUDIT_MGMT.AUDIT_TRAIL_ALL,
AUDIT_TRAIL_PURGE_INTERVAL => 2,
AUDIT_TRAIL_PURGE_NAME => 'CLEANUP_OS_DB_AUDIT_RECORDS',
USE_LAST_ARCH_TIMESTAMP => TRUE );
END;
/
2 3 4 5 6 7 8 BEGIN
*
ERROR at line 1:
ORA-46254: 'CLEANUP_OS_DB_AUDIT_RECORDS' already exists
ORA-06512: at "SYS.DBMS_AUDIT_MGMT", line 41
ORA-06512: at "SYS.DBMS_AUDIT_MGMT", line 2158
ORA-06512: at line 2


Even dropping this job will fail with the following error:


SQL>
begin
DBMS_AUDIT_MGMT.DROP_PURGE_JOB(AUDIT_TRAIL_PURGE_NAME => 'CLEANUP_OS_DB_AUDIT_RECORDS');
end;SQL> 2 3
4 /
begin
*
ERROR at line 1:
ORA-27475: "SYS.CLEANUP_OS_DB_AUDIT_RECORDS" must be a job
ORA-06512: at "SYS.DBMS_ISCHED", line 182
ORA-06512: at "SYS.DBMS_SCHEDULER", line 615
ORA-06512: at line 1
ORA-06512: at "SYS.DBMS_AUDIT_MGMT", line 2508
ORA-06512: at line 2


However DBA_AUDIT_MGMT_CLEANUP_JOBS might reference the job:

SQL> select * from DBA_AUDIT_MGMT_CLEANUP_JOBS;

JOB_NAME JOB_STAT AUDIT_TRAIL
---------------------------------------------------------------------------------------------------- -------- ----------------------------
JOB_FREQUENCY
----------------------------------------------------------------------------------------------------
CLEANUP_OS_DB_AUDIT_RECORDS ENABLED ALL AUDIT TRAILS
FREQ=HOURLY;INTERVAL=2



Changes

This scenario can occur at any stage.

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms