Running Oracle 11gR1 in an XP SP2 virtual machine. Full disclosure: This is for an assignment.
I'm attempting to audit whenever a user is granted the DBA role and fire off an email when the event occurs.
I believe the command AUDIT DBA;
will audit all actions performed upon the DBA role. I have a fully working procedure which will take care of the email portion, but I'm not aware of a way for standard auditing to trigger the procedure in the same way a fine-grained auditing policy can.
I've tried using the policy
begin
dbms_fga.drop_policy
(object_schema => 'SYS',
object_name => 'DBA_ROLE_PRIVS',
policy_name => 'EXAMPLE');
dbms_fga.add_policy
(object_schema => 'SYS',
object_name => 'DBA_ROLE_PRIVS',
policy_name => 'EXAMPLE',
audit_condition => 'GRANTED_ROLE = DBA',
audit_column => 'GRANTED_ROLE',
handler_schema => 'SYS',
handler_module => 'FGA_NOTIFY');
end;
Where FGA_NOTIFY is the email procedure. But I get the notice "adding a policy to an object owned by SYS is not allowed." Searching through Oracle's documentation I have found no way around this.
My question is: can anyone suggest a method for auditing and Oracle database for when a user gains DBA role which can also trigger an email notification?
Thanks in advance for your help!