Home » SQL & PL/SQL » SQL & PL/SQL » Username
Username [message #283748] Wed, 28 November 2007 01:35 Go to next message
ramya29p
Messages: 100
Registered: November 2007
Location: Chennai
Senior Member
Hi,
is it possible to get the name of the user who logged in windows system by using oracle?
Re: Username [message #283751 is a reply to message #283748] Wed, 28 November 2007 01:37 Go to previous messageGo to next message
Mohammad Taj
Messages: 2412
Registered: September 2006
Location: Dubai, UAE
Senior Member

Did you check v$session view ?
select username,machine,terminal from v$session;
Re: Username [message #283752 is a reply to message #283748] Wed, 28 November 2007 01:38 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
For your session:
SQL> select sys_context('userenv','os_user') from dual;
SYS_CONTEXT('USERENV','OS_USER')
--------------------------------------------------------
X

1 row selected.

Regards
Michel

[Updated on: Wed, 28 November 2007 01:38]

Report message to a moderator

Re: Username [message #283753 is a reply to message #283751] Wed, 28 November 2007 01:39 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
v$session.osuser for OS username.

Regards
Michel
Re: Username [message #283755 is a reply to message #283748] Wed, 28 November 2007 01:39 Go to previous messageGo to next message
varu123
Messages: 754
Registered: October 2007
Senior Member
How about simply
SQL>show user
Re: Username [message #283756 is a reply to message #283755] Wed, 28 November 2007 01:41 Go to previous messageGo to next message
Michel Cadot
Messages: 64103
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
"Show user" gives Oracle user name not OS one.
(But after all is this OS user name or Oracle user name OP wants...)

Regards
Michel
Re: Username [message #283761 is a reply to message #283748] Wed, 28 November 2007 01:47 Go to previous messageGo to next message
varu123
Messages: 754
Registered: October 2007
Senior Member
Oh yes,
I am learning Michel Smile
Re: Username [message #283787 is a reply to message #283752] Wed, 28 November 2007 02:50 Go to previous message
ramya29p
Messages: 100
Registered: November 2007
Location: Chennai
Senior Member
hi Michel,
Thank you.
Previous Topic: PROBLEM WHILE CRETAING AN INDEX WITH PARTITIONS FOR AN EXISTING TABLE
Next Topic: Putting Various Logic in a Query.
Goto Forum:
  


Current Time: Sun Dec 04 08:22:55 CST 2016

Total time taken to generate the page: 0.08167 seconds