Think Foward Logo Tested on Oracle 8.0 Tested on Oracle 8i Tested on Oracle 9i Tested on Oracle 10g

SQL Script

Database Uptime

Updated: 27-Mar-2002
Version: 2.0

Description

Simple Script to display the database uptime i.e. How long the database has been running

Parameters

None

SQL Source

REM Copyright (C) Think Forward.com 1998- 2005. All rights reserved. 
col host_name form a10 heading "Host" col instance_name form a8 heading "Instance" newline col stime form a40 Heading "Database Started At" newline col uptime form a60 heading "Uptime" newline set heading off select 'Hostname : ' || host_name ,'Instance Name : ' || instance_name ,'Started At : ' || to_char(startup_time,'DD-MON-YYYY HH24:MI:SS') stime ,'Uptime : ' || floor(sysdate - startup_time) || ' days(s) ' || trunc( 24*((sysdate-startup_time) - trunc(sysdate-startup_time))) || ' hour(s) ' || mod(trunc(1440*((sysdate-startup_time) - trunc(sysdate-startup_time))), 60) ||' minute(s) ' || mod(trunc(86400*((sysdate-startup_time) - trunc(sysdate-startup_time))), 60) ||' seconds' uptime from v$instance /

Related Links

Oracle 7: (SQL Script) Database Uptime

Return to Index of SQL Scripts


Site Map

General Information : Home | Company Profile | Contact Us | Legal
Database Support : Proactive Support | Pay Per Incident Support
Expert Services : High Availability | Creative Solutions | Training
Build Services : Oracle Installations | Revive your Oracle Setup | Low Cost Development
Free Oracle Resources: DBA Scripts | Oracle Links