Wednesday, February 4, 2026

Dropping an audit policy for a specific user

You have the following audit policy:
CREATE AUDIT POLICY monitor_sys_everything
  ACTIONS ALL;

AUDIT POLICY monitor_sys_everything BY SYS;
I wanted to drop the auditing policy:
SQL> noaudit policy monitor_sys_everything;

Noaudit succeeded.

SQL> drop audit policy monitor_Sys_everything;
drop audit policy monitor_Sys_everything
*
ERROR at line 1:
ORA-46361: Audit policy cannot be dropped as it is currently enabled.
Reason:

The policy is enabled for a specific user. The "noaudit" statement used above will disable it for everyone.

Solution:

Disable it for the specific user:
SQL> NOAUDIT POLICY monitor_sys_everything BY SYS;
It can now be dropped:
drop audit policy monitor_sys_everything;

No comments:

Post a Comment