The SA_SYSDBA.CREATE_POLICY procedure is used to create a new label security policy, define the column names for specific policies, and specify the default policy options.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition does not support this feature.
Syntax
SA_SYSDBA.CREATE_POLICY (
policy_name IN VARCHAR,
column_name IN VARCHAR := NULL,
default_options IN VARCHAR := NULL
);
Parameters
| Parameter | Description |
|---|---|
| policy_name | Specifies the name of the policy. The name must be unique in the database. The maximum length of the policy name is 30 characters, but only the first 26 characters are valid. Two different policies can have the same name for the first 26 characters. To find the list of existing policies, query the POLICY_NAME column in the ALL_SA_POLICIES view. |
| column_name | Specifies the name of the column to be added to the table protected by the policy. If NULL, policy_name_COL is used. Two label security policies cannot share the same column name. |
| default_options | Specifies the default enforcement options. When a policy is applied but no specific table or schema is specified, the default enforcement options (including enforcement options and the option to hide label columns) are used. Separate each option with a comma. |
Examples
The following example creates a security policy named shield_agent_policy.
BEGIN
SA_SYSDBA.CREATE_POLICY (
policy_name => 'shield_agent_policy',
column_name => 'secret_label');
END;
/
