Note
This view is introduced since OceanBase Database V4.1.0.
Purpose
The USER_POLICY_CONTEXTS view displays the context based on which the corresponding strategy group takes effect.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| OBJECT_NAME | VARCHAR2(128) | YES | The name of the object controlled by the strategy. |
| NAMESPACE | VARCHAR2(128) | NO | The name of the associated context. |
| ATTRIBUTE | VARCHAR2(128) | NO | The name of the attribute in the associated context. |
| COMMON | VARCHAR2(3) | NO | This column is used only for compatibility, and the value is fixed to NO. |
| INHERITED | VARCHAR2(3) | NO | This column is used only for compatibility, and the value is fixed to NO. |
Sample query
Query the context information of the views that the current user has access to.
obclient [SYS]> SELECT * FROM SYS.USER_POLICY_CONTEXTS;
Here is the query result:
+--------------+------------+----------------+--------+-----------+
| OBJECT_NAME | NAMESPACE | ATTRIBUTE | COMMON | INHERITED |
+--------------+------------+----------------+--------+-----------+
| V_ORDERS_CTX | DEPT_CTX | CURRENT_DEPT | NO | NO |
| V_ORDERS_CTX | REGION_CTX | CURRENT_REGION | NO | NO |
+--------------+------------+----------------+--------+-----------+
2 rows in set
References that you can refer to
ALL_POLICY_CONTEXTS: View the context information of the views that the current user has access to.
DBA_POLICY_CONTEXTS: View the context information of all views in the current tenant.