V$session interpretation
DBAsupport.com Forums - Powered by vBulletin
Results 1 to 10 of 10

Thread: V$session interpretation

  1. #1
    Join Date
    Oct 2001
    Location
    Calcutta , India
    Posts
    78

    V$session interpretation

    what is the difference between sid and audsid columns in V$SESSION table ?

    Regards

    Deba

  2. #2
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    sid values are reused - tend to be small numbers - this is the FK that is used in other sys tables.

    audsid is not reused in the life of the database - grows monotonically to large vaues - don't think it is used elsewhere.
    Last edited by DaPi; 07-10-2003 at 08:49 AM.

  3. #3
    Join Date
    Jan 2002
    Location
    Up s**t creek
    Posts
    1,525
    This document might help to explain it a bit further

    http://support.oracle.co.uk/metalink...&p_id=122230.1

    HTH
    Jim
    Oracle Certified Professional
    "Build your reputation by helping other people build theirs."

    "Sarcasm may be the lowest form of wit but its still funny"

    Click HERE to vist my website!

  4. #4
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    Thanks for the link Jim - I never knew AUDSID could be zero like that.

  5. #5
    Join Date
    Sep 2000
    Location
    Chennai, India
    Posts
    865
    sid - session identifier

    audsid - auditing session id

    audsid is 0 for connect internal. The values of audsid is from a sequence.

    HTH.

  6. #6
    Join Date
    Jan 2000
    Location
    Chester, England.
    Posts
    818
    monotonically
    ??????

    Thats a good one.

  7. #7
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    monotonic Mathematics. Designating sequences, the successive members of which either consistently increase or decrease but do not oscillate in relative value. Each member of a monotone increasing sequence is greater than or equal to the preceding member; each member of a monotone decreasing sequence is less than or equal to the preceding member.

    So actually I was a bit off beam since monotonic seems to include equality. But that's not how I remember it . . . . .

  8. #8
    Join Date
    Oct 2001
    Location
    Calcutta , India
    Posts
    78
    Thanks for the reply. But It is not clear from the point of view of usability. Which one sould be used and where ?

    select * from v$session where audsid = userenv('sessionid');
    returns a row

    But
    select * from v$session where audsid = userenv('sessionid');
    does not return any row.

    So it implies that sid column has different meaning to Oracle. So in which cases sid column can be used ?

    reagrds

    Deba

  9. #9
    Join Date
    Nov 2002
    Location
    Geneva Switzerland
    Posts
    3,142
    userenv('sessionid') returns the AUDSID. v$session can then show which SID that corresponds to. I've just posted this elsewhere, it will show how the two are used:
    Code:
    select n.name, s.value
    from  v$statname n, v$sesstat s, v$session a
    where n.statistic# = s.statistic#
    and   value > 0 
    and   s.sid = a.sid
    and   a.audsid = userenv('sessionid')
    order by n.class, n.name
    /

  10. #10
    Join Date
    Oct 2001
    Location
    Calcutta , India
    Posts
    78
    many many thanks everyone

    Reagrds

    Deba

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