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

Thread: identify current session

Hybrid View

  1. #1
    Join Date
    Jan 2003
    Location
    india
    Posts
    175

    identify current session

    how can i get sid, serial# of my current session
    from v$session (or any related view) ?

    thank you!

    -Raja

  2. #2
    Join Date
    Jun 2001
    Location
    California
    Posts
    124
    v$mystat

  3. #3
    Join Date
    Sep 2002
    Location
    England
    Posts
    7,334
    and the sys_context

  4. #4
    Join Date
    Dec 2000
    Location
    Ljubljana, Slovenia
    Posts
    4,439
    Originally posted by davey23uk
    and the sys_context
    If you mean the provided namspace USERENV, then I'm affraid there is no such parameter in there that would return SID or serial# for the session. Note that parameter SESSIONID in that namespace returns auditing session identifier, which is something totaly different from SID in V$SESSION and simmilar views.

    As mentioned before, V$MYSTAT is the correct view to obtain your current SID.

    SELECT sid FROM v$mystat WHERE ROWNUM = 1;
    Jurij Modic
    ASCII a stupid question, get a stupid ANSI
    24 hours in a day .... 24 beer in a case .... coincidence?

  5. #5
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    better use rownum < 2, rownum = 1 doesnt work very well with cursor_sharing = FORCE or SIMILAR

  6. #6
    Join Date
    Jan 2003
    Location
    india
    Posts
    175
    thank you everybody!

    -Raja

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