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

_____________________________________________________________________________________________________________________

0 comments:

Post a Comment

 

acehints.com Copyright 2011-17 All Rights Reserved | Site Map | Contact | Disclaimer | Google