Home » RDBMS Server » Security » how to find current user in database (oracle 9i)
how to find current user in database [message #524166] Thu, 22 September 2011 01:56 Go to next message
sathish16787
Messages: 56
Registered: September 2011
Location: mumbai
Member
query to find the current user accessing the database
Re: how to find current user in database [message #524169 is a reply to message #524166] Thu, 22 September 2011 02:08 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Query V$SESSION, something like
select username from v$session;
Include more columns for more information.
Re: how to find current user in database [message #524278 is a reply to message #524169] Thu, 22 September 2011 08:54 Go to previous messageGo to next message
BlackSwan
Messages: 26766
Registered: January 2009
Location: SoCal
Senior Member
>query to find the current user accessing the database
SHOW USER
Re: how to find current user in database [message #526759 is a reply to message #524278] Wed, 12 October 2011 20:18 Go to previous messageGo to next message
harshpatel
Messages: 6
Registered: August 2011
Location: Ahmedabad
Junior Member

You can find using SHOW USER query.
Re: how to find current user in database [message #526786 is a reply to message #524166] Thu, 13 October 2011 01:11 Go to previous messageGo to next message
Michel Cadot
Messages: 68728
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
SQL> select user, 
  2         sys_context('userenv','session_user') ses_user,
  3         sys_context('userenv','current_schema') cur_schema
  4  from dual
  5  /
USER                 SES_USER             CUR_SCHEMA
-------------------- -------------------- --------------------
MICHEL               MICHEL               MICHEL

Available to any user and any SQL tool.

Regards
Michel
Re: how to find current user in database [message #526787 is a reply to message #526759] Thu, 13 October 2011 01:11 Go to previous message
Michel Cadot
Messages: 68728
Registered: March 2007
Location: Saint-Maur, France, https...
Senior Member
Account Moderator
harshpatel wrote on Thu, 13 October 2011 03:18
You can find using SHOW USER query.


SHOW USER is not a query, it is a SQL*Plus command.

Regards
Michel

Previous Topic: Oracle Password Encryption
Next Topic: audit the update/modify and insert
Goto Forum:
  


Current Time: Tue Dec 17 19:54:37 CST 2024