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

Thread: How can i know my 'sid, serial#' ??

  1. #1
    Join Date
    May 2003
    Posts
    5

    How can i know my 'sid, serial#' ??

    I am running 2 SQL Plus to connect to DB using the same DB user.
    When i query v$session, i found the 'sid, serial#' information for the 2 SQL Plus sessions. But how can i know which 'sid, serial#' belongs to which SQL Plus ? Any SQL command i can use to check the 'sid, serial#' of the current SQL Plus session ?

    Thanks,
    Andrew

  2. #2
    Join Date
    Jun 2000
    Location
    Madrid, Spain
    Posts
    7,447
    select sid, serial# from v$session where audsid = userenv('SESSIONID');

  3. #3
    Join Date
    Apr 2003
    Location
    South Carolina
    Posts
    148
    Here's a little script that will give you information on the
    Sql connection you are currently running:
    ***********************************************************
    col a form a70 fold_after 1

    set heading off feedback off

    select 'Sid, Serial#, Aud sid : '|| s.sid||' , '||s.serial#||' , '||s.audsid a,
    'DB User / OS User : '||s.username||' / '||s.osuser a,
    'Machine - Terminal : '||s.machine||' - '||s.terminal a,
    'OS Process Ids : '||s.process||' (Client) '||p.spid||' (Server)' a,
    'Client Program Name : '||s.program a
    from v$process p,
    v$session s
    where p.addr = s.paddr
    and s.audsid = userenv('SESSIONID')
    /
    ***********************************************************

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