?
Solved

How to tell who you are in sql session

Posted on 2011-03-03
5
Medium Priority
?
437 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 23

Assisted Solution

by:wdosanjos
wdosanjos earned 120 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 41

Assisted Solution

by:Sharath
Sharath earned 120 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 1760 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 Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

Question has a verified solution.

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

Occasionally there is a need to clean table columns, especially if you have inherited legacy data. There are obviously many ways to accomplish that, including elaborate UPDATE queries with anywhere from one to numerous REPLACE functions (even within…
From implementing a password expiration date, to datatype conversions and file export options, these are some useful settings I've found in Jasper Server.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
This video explains at a high level about the four available data types in Oracle and how dates can be manipulated by the user to get data into and out of the database.
Suggested Courses

762 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