Script to show Uptime of the Database


SET ECHO OFF
SET FEEDBACK ON
SET PAGES 80
SET LINES 132

REM
REM || Title : show_uptime.sql
REM ||
REM || Purpose : This script will Display database uptime in days and hours
REM ||
REM ||
REM || Release No : 1
REM ||
REM || Variables : None
REM ||
REM || Schema : sys
REM ||
REM ||


SELECT SYSDATE - logon_time "Days",
(SYSDATE - logon_time) * 24 "Hours"
FROM sys.v_$session
WHERE sid = 1
/

 

This script is provided for educational purposes only. The script has been tested and appears to work as intended. However, you should always test any script before relying on it. No responsibility will be accepted for Lost or damage that may occur from it's use.