The SA_USER_ADMIN.SET_LEVELS procedure assigns minimum and maximum levels to a user, and identifies the default values of the session label and row label of the user.
Applicability
This topic applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only MySQL mode.
Syntax
SA_USER_ADMIN.SET_LEVELS (
policy_name IN VARCHAR,
user_name IN VARCHAR,
max_level IN VARCHAR,
min_level IN VARCHAR := NULL,
def_level IN VARCHAR := NULL,
row_level IN VARCHAR := NULL);
Parameters
| Parameter | Description |
|---|---|
| policy_name | The policy name. You can query the POLICY_NAME column of the ALL_SA_POLICIES data dictionary view for existing policies. |
| user_name | The username. This user does not need to have a label security grant to run this procedure. |
| max_level | The highest privilege level of read and write access. The value uses only the short name of the level. You can query the SHORT_NAME column of the ALL_SA_LEVELS view for existing levels. |
| min_level | The lowest privilege level of write access. The value uses only the short name of the level If the value is set to NULL, the default level is the lowest level of the policy. |
| def_level | The default level, which is equal to or higher than the minimum level and is equal to or lower than the maximum level. The value uses only the short name of the level. If the value is set to NULL, the default level is max_level. |
| row_level | The row level, which is equal to or higher than the minimum level and equal to or lower than the default level. The value uses only the short name of the level. If the value is set to NULL, the row level is def_level. |
Examples
The following example sets levels for shield_agent_policy:
BEGIN
SA_USER_ADMIN.SET_LEVELS (
policy_name => 'shield_agent_policy',
user_name => 'COULSON',
max_level => 'L8',
min_level => 'L5',
def_level => 'L8',
row_level => 'L8');
END;
/