Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: Instance up time
An easier method is:
select logon_time from v$session where SID = 1 ;
SID = 1 is pmon and it will reflect the startup time of the database.
I have used the following to get the startup time from v$instance: (This snippet of code is from a report I use.) SELECT 'System Statistics for ORACLE database ' || name || ' started '
|| TO_CHAR(TO_DATE(a.value,'J'),'dd-Mon-yyyy') || ' at ' || TO_CHAR(TRUNC(SYSDATE)+(b.value/86400),'hh24:mi:ss')FROM v$instance a, v$instance b, v$database c WHERE b.key LIKE 'STARTUP TIME - S%'
AND a.key LIKE 'STARTUP TIME - J%' ;
The "b.value" is in seconds and I divide by 86400 (number of seconds in
a day) to get a fraction that is added to the starting date.
HTH
James
In article <Ofa1qulz#GA.352_at_cpmsnbbsa03>,
"peasland" <peasland_at_email.msn.com> wrote:
> I am trying to figure out how long an instance has been running. In
Oracle8,
> this is pretty easy since the V$INSTANCE view has a column called
> 'startup_time'. This is different in Oracle7. If I query the
V$INSTANCE
> view, I get the following information:
>
> SQL> select * from v$instance;
>
> KEY
VALUE
> ----------------------------------------------------------------
Sent via Deja.com http://www.deja.com/
Share what you know. Learn what you don't.
Received on Thu Jul 15 1999 - 07:57:33 CDT
![]() |
![]() |