The ADD_GROUPED_POLICY procedure is used to add a policy to a specified policy group.
Applicability
This content applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support it.
Syntax
DBMS_RLS.ADD_GROUPED_POLICY(
object_schema IN VARCHAR2 := NULL,
object_name IN VARCHAR2,
policy_group IN VARCHAR2 := 'SYS_DEFAULT',
policy_name IN VARCHAR2,
function_schema IN VARCHAR2 := NULL,
policy_function IN VARCHAR2,
statement_types IN VARCHAR2 := NULL,
update_check IN BOOLEAN := FALSE,
enable IN BOOLEAN := TRUE,
static_policy IN BOOLEAN := FALSE,
policy_type IN BINARY_INTEGER := NULL,
long_predicate IN BOOLEAN := FALSE,
sec_relevant_cols IN VARCHAR2 := NULL,
sec_relevant_cols_opt IN BINARY_INTEGER := NULL,
namespace IN VARCHAR2 := NULL,
attribute IN VARCHAR2 := NULL);
Parameters
Parameter |
Description |
|---|---|
| object_schema | The name of the schema to which the table or view belongs. Default isNULL, indicating the current schema. |
| object_name | The name of the table or view. |
| policy_group | Policy group name. Default value:SYS_DEFAULT. |
| policy_name | The name of the policy. |
| function_schema | The schema to which the policy function belongs. Default isNULL, indicating the current schema. |
| policy_function | The name of the policy function. |
| statement_types | SQL statement type of the application policy. Default value:NULL, which indicates all types. |
| update_check | Whether to check the policy after insertion or update. Default isFALSE. |
| enable | Whether to enable the policy after it is added. Default value:TRUE. |
| static_policy | Whether it is a static policy. Default value:FALSE. |
| policy_type | Policy type. |
| long_predicate | Whether the predicate exceeds 2,000 bytes. Default isFALSE. |
| sec_relevant_cols | List of security-related column names. |
| sec_relevant_cols_opt | Security-related column options. |
| namespace | Namespace. |
| attribute | Attribute. |
Examples
BEGIN
DBMS_RLS.ADD_GROUPED_POLICY(
object_schema => 'hr',
object_name => 'employees',
policy_group => 'admin_group',
policy_name => 'emp_dept_policy',
function_schema => 'hr',
policy_function => 'auth_emps',
statement_types => 'SELECT');
END;
/
