Note
This view is available starting with V4.0.0.
Purpose
This view displays the privileges that control the current user for the current tenant.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| USER_ID | NUMBER(38) | NO | User ID |
| USERNAME | VARCHAR2(128) | NO | User name |
| DATABASE_NAME | VARCHAR2(128) | NO | Current user name |
| GMT_CREATE | TIMESTAMP(6) WITH LOCAL TIME ZONE | NO | Creation time |
| GMT_MODIFIED | TIMESTAMP(6) WITH LOCAL TIME ZONE | NO | Modification time |
| PRIV_ALTER | VARCHAR2(3) | NO | Whether the user has the privilege to modify tables |
| PRIV_CREATE | VARCHAR2(3) | NO | Whether the user has the privilege to create tables |
| PRIV_DELETE | VARCHAR2(3) | NO | Whether the user has the privilege to delete table records |
| PRIV_DROP | VARCHAR2(3) | NO | Whether the user has the privilege to drop tables |
| PRIV_GRANT_OPTION | VARCHAR2(3) | NO | Whether the user has the privilege to grant privileges |
| PRIV_INSERT | VARCHAR2(3) | NO | Whether the user has the privilege to insert records |
| PRIV_UPDATE | VARCHAR2(3) | NO | Whether the user has the privilege to update records |
| PRIV_SELECT | VARCHAR2(3) | NO | Whether the user has the privilege to query records |
| PRIV_INDEX | VARCHAR2(3) | NO | Whether the user has the privilege to add indexes to tables |
| PRIV_CREATE_VIEW | VARCHAR2(3) | NO | Whether the user has the privilege to create views |
| PRIV_SHOW_VIEW | VARCHAR2(3) | NO | Whether the user has the privilege to view views |
Sample query
Query the privileges that control the current user for the current user tenant.
obclient [SYS]> SELECT * FROM SYS.DBA_OB_DATABASE_PRIVILEGE;
The query result is as follows:
+---------+----------+---------------+------------------------------+------------------------------+------------+-------------+-------------+-----------+-------------------+-------------+-------------+-------------+------------+------------------+----------------+
| USER_ID | USERNAME | DATABASE_NAME | GMT_CREATE | GMT_MODIFIED | PRIV_ALTER | PRIV_CREATE | PRIV_DELETE | PRIV_DROP | PRIV_GRANT_OPTION | PRIV_INSERT | PRIV_UPDATE | PRIV_SELECT | PRIV_INDEX | PRIV_CREATE_VIEW | PRIV_SHOW_VIEW |
+---------+----------+---------------+------------------------------+------------------------------+------------+-------------+-------------+-----------+-------------------+-------------+-------------+-------------+------------+------------------+----------------+
| 200003 | SYS | LBACSYS | 05-FEB-25 05.47.08.718254 PM | 05-FEB-25 05.47.08.718254 PM | YES | YES | YES | YES | NO | YES | YES | YES | YES | YES | YES |
| 200003 | SYS | oceanbase | 05-FEB-25 05.47.08.712015 PM | 05-FEB-25 05.47.08.712015 PM | YES | YES | YES | YES | NO | YES | YES | YES | YES | YES | YES |
| 200003 | SYS | ORAAUDITOR | 05-FEB-25 05.47.08.719295 PM | 05-FEB-25 05.47.08.719295 PM | YES | YES | YES | YES | NO | YES | YES | YES | YES | YES | YES |
| 200003 | SYS | SYS | 05-FEB-25 05.47.08.717198 PM | 05-FEB-25 05.47.08.717198 PM | YES | YES | YES | YES | NO | YES | YES | YES | YES | YES | YES |
| 200003 | SYS | __public | 05-FEB-25 05.47.08.717198 PM | 05-FEB-25 05.47.08.717198 PM | YES | YES | YES | YES | NO | YES | YES | YES | YES | YES | YES |
| 200003 | SYS | __recyclebin | 05-FEB-25 05.47.08.716143 PM | 05-FEB-25 05.47.08.716143 PM | YES | YES | YES | YES | NO | YES | YES | YES | YES | YES | YES |
+---------+----------+---------------+------------------------------+------------------------------+------------+-------------+-------------+-----------+-------------------+-------------+-------------+-------------+------------+------------------+----------------+
6 rows in set
