You created an application context successfully. The user OE was granted the EXECUTE
privilege on the DBMS_SESSION package. The user receives this error while setting the value
for an attribute within the context:
SQL> EXECUTE
DBMS_SESSION.SET_CONTEXT(‘SALES_ORDERS_CTX’,’ACCOUNT_MGR’,’OE’);
BEGIN DBMS_SESSION.SET_CONTEXT(‘SALES_ORDERS_CTX’,’ACCOUNT_MGR’,’OE’);
END;
*
ERROR at line 1:
ORA-01031: insufficient privileges
ORA-06512: at "SYS.DBMS_SESSION", line 94
ORA-06512: at line 1
What is the reason for this error?
A.
The context was created with a package name in the USING clause.
B.
The attribute can be set only in the package associated with the context.
C.
The package associated with the context did not exist at the time of creation of the context.
D.
The value for an attribute of a user-defined context can be set only by the ALTER SESSION command.
B
(1) create one application context with USING one package
(2) create that package mentioned in (1) to set the context name-value pair VIA calling DBMS_SESSION.SET_CONTEXT
(3) create logon trigger to set the context on one user like SCOTT’s context value
(4) create policy function to return policy predicate like depart_no=SYS_CONTEXT(mycontext, ‘department’, ‘IT’),
notes schema and object are IN formal parameters even though they are not really used.
(5) invoke DBMS_RLS.XXXPolicy to add the policy
??