Current Session ID (SID) v$session 
Author Message
 Current Session ID (SID) v$session
Help!!!

  I'm trying to find a way that I can identify my current session
(SID) in v$session.

I have tried joining v$session with user_users, but I can only ensure
my username is correct, but if I have multible sessions running from
different terminals and/or applications I will get multiple rows.
I need to be able to identify the unique SID, TERMINAL, APPLICATION
for the current session.

Any help is greatly appreciated.



Fri, 19 Jan 2001 03:00:00 GMT
 Current Session ID (SID) v$session

Quote:

>Help!!!

>  I'm trying to find a way that I can identify my current session
>(SID) in v$session.

>I have tried joining v$session with user_users, but I can only ensure
>my username is correct, but if I have multible sessions running from
>different terminals and/or applications I will get multiple rows.
>I need to be able to identify the unique SID, TERMINAL, APPLICATION
>for the current session.

>Any help is greatly appreciated.

Hi,

try this query:

SELECT *
  FROM v$session
 WHERE audsid = USERENV('SESSIONID');

HTH,
Peter

--
Peter Schneider



Fri, 19 Jan 2001 03:00:00 GMT
 Current Session ID (SID) v$session
Try this...

select audsid, sid, serial#, username
from v$session
where audsid = userenv('SESSIONID');

--
Thanks,
Biju Thomas

For Oracle Scripts, Tips and Links
http://www.geocities.com/SiliconValley/Peaks/4535/oracle_main.htm



Sat, 20 Jan 2001 03:00:00 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Session ID -- Again (How to implement single session login)

2. Query to tie Rollback to Session ID/Process ID

3. Linking Unix Process Id's back to Session Id's

4. v$session.sid

5. Session# and SID In a Trigger

6. How to get the Session ID of the Current Session?

7. how to find session id/serial no. of current session

8. Java programs running on a Windows NT session via a server session

9. dynamically created session and database : cannot avoid login prompt - fine with default session

10. Forcing an ALTER SESSION at session startup - How?

11. v$session, aborted sessions

12. Help: Can we alter session for other sessions


 
Powered by phpBB® Forum Software