Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: How to tell how long an instance has been running
In any version you can use
select logon_time
from v$session
where sid = 1
hth
connor
-- ============================== Connor McDonald http://www.oracledba.co.uk "Some days you're the pigeon, some days you're the statue..." "Mark D Powell" <mark.powell_at_eds.com> wrote in message news:178d2795.0106200958.7d34b01d_at_posting.google.com... > "Daniel A. Morgan" <dmorgan_at_exesolutions.com> wrote in message news:<3B304067.297121B9_at_exesolutions.com>...Received on Thu Jun 21 2001 - 15:06:58 CDT
> > Peter Shankey wrote:
> >
> > > Is there a v$ which tells how long a instances has been running in
both 7
> > > and 8?
> > >
> > > Thanks
> > > Pete
> >
> > v$instance.
> >
> > You can also run listener status to find out how long the listener has
been
> > up:
> >
> > lsnrctl status in ORACLE_HOME/bin
> >
> > Daniel A. Morgan
> > Here is the SQL for a version 7 database: > set echo off > rem > rem SQL*Plus script to display version 7 startup time > rem Note v$instance changed with version 8 > rem > rem 19990903 Mark D Powell To answer Oracle newspgroup post > rem > select sysdate - to_date(a. value,'J') + (b.value / 60 / 60 / 24) > from v$instance a, > v$instance b > where a.key = 'STARTUP TIME - JULIAN' > and b.key = 'STARTUP TIME - SECONDS' > / > > Obviously it is easier with ver 8+: > select startup_time, sysdate - startup_time as "Days Running" > from v$instance > / > > STARTUP_T Days Running > --------- ------------ > 15-JUN-01 4.90270833 > > -- Mark D Powell --