How to Check Which User is Connected to Current Oracle Session? 3 different methods

There are three different simple ways to identify the current user session in oracle sqlplus.
1.     Using DBMS_UTILITY. OLD_CURRENT_USER function.

select DBMS_UTILITY.OLD_CURRENT_USER from dual;
SQL> /

OLD_CURRENT_USER

-----------------
STHOMAS

2.     SQL*Plus command – Show user


SQL> show user
USER is "STHOMAS"

3.     Using SYS_CONTEXT function
SQL> select SYS_CONTEXT ('USERENV', 'CURRENT_USER') from dual;

SYS_CONTEXT('USERENV','CURRENT_USER')
--------------------------------------

STHOMAS

No comments:

Post a Comment