col instance_name for a20
col “Instance Up Time” for a50
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  ' 
FROM v$instance;