Note
This view is available starting with V4.1.0.
Purpose
This view displays the access control policies of all tables or views in the current tenant. You can create multiple policies for a table.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| OBJECT_OWNER | VARCHAR2(128) | YES | The owner of the object controlled by the policy. |
| OBJECT_NAME | VARCHAR2(128) | YES | The name of the object controlled by the policy. |
| POLICY_GROUP | VARCHAR2(128) | NO | The name of the policy group. |
| POLICY_NAME | VARCHAR2(128) | NO | The name of the policy. |
| PF_OWNER | VARCHAR2(128) | NO | The owner of the policy function. |
| PACKAGE | VARCHAR2(128) | NO | The name of the package where the policy function is located. |
| FUNCTION | VARCHAR2(128) | NO | The name of the policy function. |
| SEL | VARCHAR2(3) | NO | Whether the Select operation is affected: YES or NO. |
| INS | VARCHAR2(3) | NO | Whether the Insert operation is affected: YES or NO. |
| UPD | VARCHAR2(3) | NO | Whether the Update operation is affected: YES or NO. |
| DEL | VARCHAR2(3) | NO | Whether the Delete operation is affected: YES or NO. |
| IDX | VARCHAR2(3) | NO | Whether the Index operation is affected: YES or NO. |
| CHK_OPTION | VARCHAR2(3) | NO | Whether the value is checked after the Insert or Update operation: YES or NO. |
| ENABLE | VARCHAR2(3) | NO | Whether the policy is effective: YES or NO. |
| STATIC_POLICY | VARCHAR2(3) | NO | Whether the policy is static: YES or NO. |
| POLICY_TYPE | VARCHAR2(24) | NO | The type of the policy. Valid values:
|
| LONG_PREDICATE | VARCHAR2(3) | NO | Whether the predicate returned by the policy function exceeds 4000. |
| COMMON | VARCHAR2(3) | NO | This column is reserved for compatibility. Its value is fixed to NO. |
| INHERITED | VARCHAR2(3) | NO | This column is reserved for compatibility. Its value is fixed to NO. |
Sample query
Query the access control policies of all tables or views in the current tenant.
obclient [SYS]> SELECT * FROM SYS.DBA_POLICIES;
The query result is as follows:
+--------------+----------------+--------------+----------------+----------+---------+----------------------+------+------+------+------+------+------------+--------+---------------+-------------+----------------+--------+-----------+
| OBJECT_OWNER | OBJECT_NAME | POLICY_GROUP | POLICY_NAME | PF_OWNER | PACKAGE | FUNCTION | SEL | INS | UPD | DEL | IDX | CHK_OPTION | ENABLE | STATIC_POLICY | POLICY_TYPE | LONG_PREDICATE | COMMON | INHERITED |
+--------------+----------------+--------------+----------------+----------+---------+----------------------+------+------+------+------+------+------------+--------+---------------+-------------+----------------+--------+-----------+
| SYS | EMP | SYS_DEFAULT | SAL_POLICY | SYS | NULL | F_POLICY | YES | NO | YES | NO | NO | NO | YES | NO | DYNAMIC | NO | NO | NO |
| SYS | V_SALES_SECURE | GROUP_SALES | POLICY_REGION | SYS | NULL | POLICY_GROUP_FUNC | YES | NO | YES | NO | NO | YES | YES | NO | DYNAMIC | NO | NO | NO |
| SYS | V_SALES_SECURE | GROUP_SALES | POLICY_DEPT | SYS | NULL | POLICY_GROUP_FUNC | YES | NO | NO | NO | NO | NO | YES | NO | DYNAMIC | NO | NO | NO |
| SYS | V_ORDERS_CTX | GROUP_REGION | POLICY_DYNAMIC | SYS | NULL | POLICY_SELECTOR_FUNC | YES | NO | YES | NO | NO | YES | YES | NO | DYNAMIC | NO | NO | NO |
+--------------+----------------+--------------+----------------+----------+---------+----------------------+------+------+------+------+------+------------+--------+---------------+-------------+----------------+--------+-----------+
4 rows in set
References
Query the access control policies of all tables or views accessible to the current user: ALL_POLICIES
Query the access control policies of all tables or views owned by the current user: USER_POLICIES
