Solved

How to tell who you are in sql session

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Not able to drop or recreate an Oracle stored procedure 1 30
Sql Stored Procedure field variable 17 31
run sql script from putty 4 35
Email Header Detail 12 55
I remember the day when someone asked me to create a user for an application developement. The user should be able to create views and materialized views and, so, I used the following syntax: (CODE) This way, I guessed, I would ensure that use…
Checking the Alert Log in AWS RDS Oracle can be a pain through their user interface.  I made a script to download the Alert Log, look for errors, and email me the trace files.  In this article I'll describe what I did and share my script.
Video by: Steve
Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
This video explains what a user managed backup is and shows how to take one, providing a couple of simple example scripts.

770 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