DBAsupport.com Forums - Powered by vBulletin
Results 1 to 4 of 4

Thread: Identify which session I'm in if I have multiple sessions open

  1. #1
    Join Date
    Aug 2000
    Posts
    462
    How can I determine programmatically which session I'm in if I have multiple sessions open? When I query v$session, how can I pick my current session?
    Oracle DBA and Developer

  2. #2
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    select sid
    from v$session
    where audsid=userenv('sessionid')
    /
    this shows your current SID

  3. #3
    Join Date
    Mar 2001
    Posts
    52
    TRY THIS AND YOU CAN SEE THE STATUS AND THE PROGRAMS YOU ARE IN

    SELECT * FROM v$session
    where OSUSER='YOURNAME';

    Donna

  4. #4
    Join Date
    Aug 2000
    Posts
    462
    Pando: Thanks - works great. I found a different way also - select distinct(sid) from v$mystat;

    Donna - I was looking for something to identify just my current session even if I have multiple sessions from the same machine. Thanks for the input though.

    BTW - OSUSER includes the DOMAIN on NT - FYI
    Oracle DBA and Developer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width