June 17th, 2013, 10:06 AM
VPD Policy Issue.
Hi , I am using 18.104.22.168.0 version of oracle.
I am trying below VPD policy function on one of my column and i am expecting the column value to be shown as null when the table is being queried from USER1 and USER2. But i am not able to get it, its showing all the text values.
(Note-I dont want to put the restriction on SCHEMA(USER1,USER2) level for all objects using default 'EXEMPT ACCESS POLICY', so i have revoked the same from USER1,USER2 and trying to achive the same using below policy function.)
DBMS_RLS.ADD_POLICY (object_schema => 'USER1',
object_name => 'tde_test',
policy_name => 'test_vpd',
function_schema => 'USER1',
policy_function => 'vpd_function',
sec_relevant_cols => 'COL1',
sec_relevant_cols_opt => DBMS_RLS.ALL_ROWS);
CREATE OR REPLACE FUNCTION vpd_function (obj_owner IN VARCHAR2,
obj_name IN VARCHAR2)
IF SYS_CONTEXT ('USERENV', 'SESSION_USER') IN ('USER1','USER2')