Hi ,
I have tried to implement RLS policy of oracle.
I have two Schema X1 & X1_DBA.
I have created the emp table in X1_DBA
create table emp(empid number,ename varchar2(10),deptno number)
and inserted some rows into the Table. i have created the below function in X1_DBA schema & Given Select Privilege to X1.
CREATE OR REPLACE FUNCTION no_dept10(
p_schema IN VARCHAR2,
p_object IN VARCHAR2)
RETURN VARCHAR2
AS
BEGIN
RETURN 'deptno != 10';
END;
Grant select on emp to X1;
When i Add the Policy in X1_DBA.schema i am getting the Error as Table does not exist
SQL> BEGIN
2 DBMS_RLS.add_policy
3 (object_schema => 'X1',
4 object_name => 'EMP',
5 policy_name => 'quickstart',
6 policy_function => 'no_dept10');
7 END;
8 /
BEGIN
DBMS_RLS.add_policy
(object_schema => 'X1',
object_name => 'EMP',
policy_name => 'quickstart',
policy_function => 'no_dept10');
END;
ORA-00942: table or view does not exist
ORA-06512: at "SYS.DBMS_RLS", line 20
ORA-06512: at line 2
Could any one please tell me why i am Getting the Error?