Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: How to tell how long an instance has been running

Re: How to tell how long an instance has been running

From: Mark D Powell <mark.powell_at_eds.com>
Date: 20 Jun 2001 10:58:38 -0700
Message-ID: <178d2795.0106200958.7d34b01d@posting.google.com>

"Daniel A. Morgan" <dmorgan_at_exesolutions.com> wrote in message news:<3B304067.297121B9_at_exesolutions.com>...
> 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

Received on Wed Jun 20 2001 - 12:58:38 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US