Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: decipher statistic #13 from v$sesstat
A copy of this was sent to johnvue_at_gte.net
(if that email address didn't require changing)
On Sun, 07 Jun 1998 21:25:23 GMT, you wrote:
>When looking at v$sesstat or v$mystat,
>STATISTIC# 13 is "session connect time".
>
>If I do:
>
>select * from v$mystat where statistic#=13;
>
> SID STATISTIC# VALUE
>---------- ---------- ----------
> 8 13 335028213
>
>How do I get human readable information from this?
>
>I know there is LOGON_TIME in V$SESSION but Oracle 7.0 and 7.1
>don't have this field.
You can join to v$statname to turn 13 into 'session connect time'. If you are using 7.0 - 7.2 and want to turn this into the wall clock time that a session logged in you can use:
select s.sid, s.username,
to_char((sysdate-(hsecs - value )/(100*60*60*24)),'dd-mon-yy hh:mi:ss') cnt
from v$sesstat sess, v$session s, v$timer where statistic# = 13
and s.sid = sess.sid
Providing you have resource_limit/timed statistics = true. This only works before Oracle 7.3. From Oracle 7.3 onwards see V$SESSION.LOGON_TIME .
This particular statistic returns:
A number representing the time when the session connected to the server. Pre 7.3: The unit of measure is in 1/100'ths of a second and is the same as the value of V$TIMER at the time the session connected.
7.3 onwards: The unit of measure is now seconds. The time is a number of seconds since some epoch so can no longer be related to V$TIMER.
Thomas Kyte
tkyte_at_us.oracle.com
Oracle Government
Herndon VA
http://govt.us.oracle.com/ -- downloadable utilities
Anti-Anti Spam Msg: if you want an answer emailed to you, you have to make it easy to get email to you. Any bounced email will be treated the same way i treat SPAM-- I delete it. Received on Sun Jun 07 1998 - 20:06:19 CDT