ADD_POLICY_CONTEXT Procedure
This procedure adds the context for the active application.
Syntax
DBMS_RLS.ADD_POLICY_CONTEXT (
object_schema VARCHAR2,
object_name VARCHAR2,
namespace VARCHAR2,
attribute VARCHAR2 );
Parameters
Table 56-8 ADD_POLICY_CONTEXT Procedure Parameters
Usage Notes
Note the following:
- This procedure indicates the application context that drives the enforcement of policies; this is the context that determines which application is running.
- The driving context can be session or global.
- At execution time, the server retrieves the name of the active policy group from the value of this context.
- There must be at least one driving context defined for each object that has fine grained access control policies; otherwise, all policies for the object will be executed.
- Adding multiple context to the same object will cause policies from multiple policy groups to be enforced.
- If the driving context is
NULL,
policies from all policy groups are used.
- If the driving context is a policy group with policies, all enabled policies from that policy group will be applied, along with all policies from the SYS_DEFAULT policy group.
- To add a policy to table
hr.emp
in group access_control_group,
the following command is issued:
DBMS_RLS.ADD_GROUPED_POLICY('hr','emp','access_control_
group','policy1','SYS', 'HR.ACCESS');