How to get connect time and logon time?


Is there any way to accurately determine both connect time & time of logon
through server views.  I know of v$sessstat (statistic 13 - connect time)
but dont know the units.
 

v$timer gives "Time in hundredths of a second"

How do you put it all together????



Ans:
The same thing will work for the connect time of  a session, which is in Julian date format

select    to_char(startupdate.startupdate,'ddmmyyyy hh24:mi:ss') startupdate_database
         ,nvl(trunc(sysdate) - trunc(startupdate.startupdate),1) nr_days_running
from     (select  to_date(v1.value,'J') + v2.value/(24*3600) startupdate
          from    v$instance v1
                 ,v$instance v2
          where   v1.key like '%JULIAN%'
            and   v2.key like '%SECONDS%'
         ) startupdate
;
 
 

Hosted by www.Geocities.ws

1