Sometimes, you switched the connection to another schema for more operations and forgot where you are. Here are some ways to know who am I (whoami in Linux).
SQL*Plus
If you're in sqlplus, you check it with the short cut.
SQL> show user
USER is "SCOTT"
USER() Function
If you're not in sqlplus, you can also check the information by querying the environmental function USER().
SQL> select user from dual;
USER
------------------------------
SCOTT
Dictionary View
Typically and officially, you can query your own dictionary USER_USERS for sure.
SQL> select distinct username from user_users;
USERNAME
---------------
SCOTT
SYS_CONTEXT
From the system point of view, we can check current session user by SYS_CONTEXT() function.
SQL> select sys_context('USERENV', 'SESSION_USER') "USER" from dual;
USER
--------------------
SCOTT
nice! thank you!
My pleasure!
Thank you, a good tip!
My pleasure!