Solved

How to tell who you are in sql session

Posted on 2011-03-03
5
433 Views
Last Modified: 2012-05-11
sqlplus login as sys
select USERNAME,PROGRAM, SID, SERIAL# from v$session where username is not null;
Have got a lot of sqlplus.exe entries like me. Is there any way to distinguish my login from the other?
0
Comment
Question by:jl66
5 Comments
 
LVL 23

Assisted Solution

by:wdosanjos
wdosanjos earned 30 total points
ID: 35032086
Check MACHINE and OSUSER also. They may provide the info you need to distinguish your session.

select USERNAME,PROGRAM, SID, SERIAL#, MACHINE, OSUSER
  from v$session
where username is not null
0
 
LVL 40

Assisted Solution

by:Sharath
Sharath earned 30 total points
ID: 35032121
Can you try this?

select USERNAME,PROGRAM, SID, SERIAL# from v$session where audsid=userenv('SESSIONID');
0
 
LVL 74

Accepted Solution

by:
sdstuber earned 440 total points
ID: 35032325
select USERNAME,PROGRAM, SID, SERIAL# from v$session where sid in ( select sid from v$mystat where rownum = 1)
0
 
LVL 1

Expert Comment

by:Gedmis_r
ID: 35034417
show user
0
 

Author Closing Comment

by:jl66
ID: 35036277
Thanks for everyone's tip.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article describes how to use the timestamp of existing data in a database to allow Tableau to calculate the prior work day instead of relying on case statements or if statements to calculate the days of the week.
When it comes to protecting Oracle Database servers and systems, there are a ton of myths out there. Here are the most common.
This video shows how to Export data from an Oracle database using the Original Export Utility.  The corresponding Import utility, which works the same way is referenced, but not demonstrated.
This video shows how to copy an entire tablespace from one database to another database using Transportable Tablespace functionality.

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question