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
DBA Tips Data Pump Reference

0 comments:

Post a Comment

 

dba topics. Copyright 2011-16 All Rights Reserved | Site Map | Contact | Disclaimer | Google