Solved

How to tell who you are in sql session

Posted on 2011-03-03
5
422 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 73

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

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

Have you ever had to make fundamental changes to a table in Oracle, but haven't been able to get any downtime?  I'm talking things like: * Dropping columns * Shrinking allocated space * Removing chained blocks and restoring the PCTFREE * Re-or…
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…
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
This video shows how to configure and send email from and Oracle database using both UTL_SMTP and UTL_MAIL, as well as comparing UTL_SMTP to a manual SMTP conversation with a mail server.

747 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now