Find the Database uptime in terms of Days, Hours and Minutes.


Find the Database uptime in terms of Days, Hours and Minutes.


col instance_name for a15
col “Instance Up Time” for a30
SELECT instance_name,
floor(((sysdate-startup_time)*24*60*60)/3600/24) || ‘ DAYS ‘
|| floor ((floor(((sysdate-startup_time)*24*60*60)) –
floor(((sysdate-startup_time)*24*60*60)/3600/24)*24*60*60)/3600) || ‘ Hours ‘
|| floor(floor ((floor(((sysdate-startup_time)*24*60*60))
– floor(((sysdate-startup_time)*24*60*60)/3600/24)*24*60*60) –
( floor ((floor(((sysdate-startup_time)*24*60*60)) –
floor(((sysdate-startup_time)*24*60*60)/3600/24)*24*60*60)/3600))*60*60)/60) || ‘ MINUTES ‘ “Instance Up Time”
FROM v$instance;
  • September 5, 2015 | 22 views
  • Comments