Purpose
The DBA_USERS view displays all users in the database.
Applicability
This view is available only in OceanBase Database Enterprise Edition.
Columns
| Column | Type | Nullable? | Description |
|---|---|---|---|
| USERNAME | VARCHAR2(128) | NO | The name of the user. |
| USER_ID | NUMBER(38) | NO | The ID of the user. |
| PASSWORD | VARCHAR2(128) | NO | We recommend that you do not use the value of the AUTHENTICATION_TYPE column for this column. |
| ACCOUNT_STATUS | VARCHAR2(30) | NO | The account status. Valid values:
|
| LOCK_DATE | DATE | NO | The date when the account was locked if the account status was LOCKED. |
| EXPIRY_DATE | DATE | NO | The date of expiration of the account. |
| DEFAULT_TABLESPACE | VARCHAR2(30) | NO | The default tablespace for data. |
| TEMPORARY_TABLESPACE | VARCHAR2(30) | NO | The name of the default tablespace for temporary tables or the name of a tablespace group. |
| LOCAL_TEMP_TABLESPACE | VARCHAR2(30) | NO | The local temporary tablespace.
NoteThis column is available in OceanBase Database V4.2.1 BP2 and later. |
| CREATED | DATE | NO | The date when the user was created. |
| PROFILE | VARCHAR2(128) | NO | The name of the user resource configuration file.
NoteThis column is available in OceanBase Database V4.2.1 BP2 and later. |
| INITIAL_RSRC_CONSUMER_GROUP | VARCHAR2(30) | NO | The initial resource consumer group for the user. |
| EXTERNAL_NAME | VARCHAR2(4000) | NO | The external username of the user. |
| PASSWORD_VERSIONS | VARCHAR2(12) | NO | The version of the hash algorithm used for the password.
NoteThis column is available in OceanBase Database V4.2.1 BP2 and later. |
| EDITIONS_ENABLED | VARCHAR2(1) | NO | Indicates whether editions are enabled for the user.
NoteThis column is available in OceanBase Database V4.2.1 BP2 and later. |
| AUTHENTICATION_TYPE | VARCHAR2(8) | NO | The identity authentication mechanism for the user.
NoteThis column is available in OceanBase Database V4.2.1 BP2 and later. |
| PROXY_ONLY_CONNECT | VARCHAR2(1) | NO | Indicates whether the user can connect to the database only as a proxy user.
NoteThis column is available in OceanBase Database V4.2.1 BP2 and later. |
| COMMON | VARCHAR2(3) | NO | Indicates whether the user is a common user.
NoteThis column is available in OceanBase Database V4.2.1 BP2 and later. |
| LAST_LOGIN | TIMESTAMP(9) WITH TIME ZONE | NO | The last login time of the user.
NoteThis column is available in OceanBase Database V4.2.1 BP2 and later. |
| ORACLE_MAINTAINED | VARCHAR2(1) | NO | Indicates whether the user was created and maintained by using a script provided by OceanBase Database in Oracle mode.
NoteThis column is available in OceanBase Database V4.2.1 BP2 and later. |
| INHERITED | VARCHAR2(3) | NO | Indicates whether the user is inherited from other containers.
NoteThis column is available in OceanBase Database V4.2.1 BP2 and later. |
| DEFAULT_COLLATION | VARCHAR2(100) | NO | The default character set.
NoteThis column is available in OceanBase Database V4.2.1 BP2 and later. |
| IMPLICIT | VARCHAR2(3) | NO | Indicates whether the user was created by an implicit application.
NoteThis column is available in OceanBase Database V4.2.1 BP2 and later. |
| ALL_SHARD | VARCHAR2(3) | NO | Indicates whether the user was created with sharding enabled.
NoteThis column is available in OceanBase Database V4.2.1 BP2 and later. |
| PASSWORD_CHANGE_DATE | DATE | YES | The time when the password was last changed.
NoteThis column is available in OceanBase Database V4.2.1 BP2 and later. |
Sample query
Query all databases users in the current tenant.
obclient [SYS]> SELECT * FROM SYS.DBA_USERS\G
The query result is as follows:
*************************** 1. row ***************************
USERNAME: SYS
USERID: 200003
PASSWORD: **********************************
ACCOUNT_STATUS: OPEN
LOCK_DATE: NULL
EXPIRY_DATE: NULL
DEFAULT_TABLESPACE: NULL
TEMPORARY_TABLESPACE: NULL
LOCAL_TEMP_TABLESPACE: NULL
CREATED: 08-AUG-24
PROFILE: DEFAULT
INITIAL_RSRC_CONSUMER_GROUP: NULL
EXTERNAL_NAME: NULL
PASSWORD_VERSIONS: NULL
EDITIONS_ENABLED: N
AUTHENTICATION_TYPE: PASSWORD
PROXY_ONLY_CONNECT: N
COMMON: NO
LAST_LOGIN: NULL
ORACLE_MAINTAINED: N
INHERITED: NO
DEFAULT_COLLATION: USING_NLS_COMP
IMPLICIT: NO
ALL_SHARD: NO
PASSWORD_CHANGE_DATE: 08-AUG-24
*************************** 2. row ***************************
USERNAME: LBACSYS
USERID: 200004
PASSWORD: *********************************
ACCOUNT_STATUS: LOCKED
LOCK_DATE: NULL
EXPIRY_DATE: NULL
DEFAULT_TABLESPACE: NULL
TEMPORARY_TABLESPACE: NULL
LOCAL_TEMP_TABLESPACE: NULL
CREATED: 08-AUG-24
PROFILE: DEFAULT
INITIAL_RSRC_CONSUMER_GROUP: NULL
EXTERNAL_NAME: NULL
PASSWORD_VERSIONS: NULL
EDITIONS_ENABLED: N
AUTHENTICATION_TYPE: PASSWORD
PROXY_ONLY_CONNECT: N
COMMON: NO
LAST_LOGIN: NULL
ORACLE_MAINTAINED: N
INHERITED: NO
DEFAULT_COLLATION: USING_NLS_COMP
IMPLICIT: NO
ALL_SHARD: NO
PASSWORD_CHANGE_DATE: 08-AUG-24
*************************** 3. row ***************************
USERNAME: ORAAUDITOR
USERID: 200005
PASSWORD: **********************************
ACCOUNT_STATUS: LOCKED
LOCK_DATE: NULL
EXPIRY_DATE: NULL
DEFAULT_TABLESPACE: NULL
TEMPORARY_TABLESPACE: NULL
LOCAL_TEMP_TABLESPACE: NULL
CREATED: 08-AUG-24
PROFILE: DEFAULT
INITIAL_RSRC_CONSUMER_GROUP: NULL
EXTERNAL_NAME: NULL
PASSWORD_VERSIONS: NULL
EDITIONS_ENABLED: N
AUTHENTICATION_TYPE: PASSWORD
PROXY_ONLY_CONNECT: N
COMMON: NO
LAST_LOGIN: NULL
ORACLE_MAINTAINED: N
INHERITED: NO
DEFAULT_COLLATION: USING_NLS_COMP
IMPLICIT: NO
ALL_SHARD: NO
PASSWORD_CHANGE_DATE: 08-AUG-24
3 rows in set