Re: Oracle Auditing by User

From: onedbguru <onedbguru_at_yahoo.com>
Date: Sat, 23 Apr 2011 09:37:05 -0700 (PDT)
Message-ID: <afce4c39-0c91-4d8a-8e26-dec4fa793e4a_at_l6g2000vbn.googlegroups.com>



On Apr 22, 9:36 pm, indytoatl <indyto..._at_gmail.com> wrote:
> I am trying to audit select statements on a column for everyone except
> JohnDoe who works in the HR dept. How do I create the correct
> audit_condition??
>
> BEGIN
>     DBMS_FGA.ADD_POLICY(
>          object_schema => 'HR'
>         ,object_name => 'EMPLOYEES'
>         ,policy_name => 'PAYROLL_INFO'
>         ,audit_condition => 'DBUser NOT = 'JohnDoe'
>         ,audit_column => 'SALARY'
>         ,handler_schema => NULL
>         ,handler_module => NULL
>         ,enable => TRUE
>         ,statement_types => 'SELECT'
>         ,audit_trail => DBMS_FGA.DB_EXTENDED
>         ,audit_column_opts => DBMS_FGA.ANY_COLUMNS
>     );
> END;
> /

 ,audit_condition => 'sys_Context(''USERENV'',''SESSION_USER'') <> '' JOHNDOE'' ' I don't have a system to test it on at the moment... notice the double single-quotes... Received on Sat Apr 23 2011 - 11:37:05 CDT

Original text of this message