This topic describes how to view the currently connected Oracle database in ODC or by using an SQL statement.
In ODC
Prerequisites
ODC has connected to the database.
Procedure
Log on to the ODC console.
On the connection management page, select the connected database and click Open.
Place the pointer next to the connection name on the menu bar at the top of the page.
Expected result
You can see the corresponding database username.

Note
In the preceding figure,
oracle-2275is the currently connected database.
By using an SQL statement
SQL statement
SELECT * FROM all_users;
Examples
View all database users.
obclient>SELECT * FROM all_users; +------------+------------------+-----------+ | USERNAME | USERID | CREATED | +------------+------------------+-----------+ | LBACSYS | 1100611139403783 | 16-MAY-22 | | ORAAUDITOR | 1100611139403784 | 16-MAY-22 | | PUBLIC | 1100611139403781 | 16-MAY-22 | | SYS | 1100611139403782 | 16-MAY-22 | +------------+------------------+-----------+ 4 rows in setView the currently connected database user.
obclient> SHOW PROCESSLIST; +------------+------+----------------------+------+---------+------+--------+------------------+ | ID | USER | HOST | DB | COMMAND | TIME | STATE | INFO | +------------+------+----------------------+------+---------+------+--------+------------------+ | 3221487786 | SYS | 100.88.114.135:52340 | SYS | Query | 0 | ACTIVE | SHOW PROCESSLIST | +------------+------+----------------------+------+---------+------+--------+------------------+ 1 row in setNote
In the preceding sample code,
SYSunder theUSERcolumn is the currently connected database user.