what is the difference between sid and audsid columns in V$SESSION table ?
Regards
Deba
Printable View
what is the difference between sid and audsid columns in V$SESSION table ?
Regards
Deba
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.
This document might help to explain it a bit further
http://support.oracle.co.uk/metalink...&p_id=122230.1
HTH
Thanks for the link Jim - I never knew AUDSID could be zero like that.
sid - session identifier
audsid - auditing session id
audsid is 0 for connect internal. The values of audsid is from a sequence.
HTH.
??????Quote:
monotonically
Thats a good one.:confused:
mon·o·ton·ic 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 . . . . .
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
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
/
many many thanks everyone
Reagrds
Deba