alter session set nls_date_format = 'dd/mm/yyyy hh24:mi:ss'
/
set head off
SELECT '************************************'||chr(10)||
       ' Maquina   : '||host_name||chr(10)||
       ' Banco     : '||instance_name||chr(10)||
       ' Versao    : '||version||chr(10)||
       ' Aberto em : '||startup_time||chr(10)||
       ' Usuario   : '||sys_context('USERENV','SESSION_USER')||chr(10)||
       '************************************'
FROM v$instance
/
set head on

SET VERIFY OFF SERVEROUT ON FEEDBACK OFF UNDERLINE '~' LINES 142

col st1 format a14 heading "Startup Time"
col st2 format a14 heading "System Date"
col st3 format a12 heading "Running Time"
col st4 format a12 heading "Running Secs" noprint
col blocked format a7

SELECT
  inst_id, instance_name,
  to_char( startup_time, 'dd/mm/yy hh24"h"mi' ) st1,
  to_char( sysdate, 'dd/mm/yy hh24"h"mi' ) st2,
  lpad( to_char( trunc(sysdate,'YEAR') + (sysdate-startup_time-1),
        decode( trunc( sysdate-startup_time, 0 ), 0, '"0d "hh24"h"mi', 'fmddd"d "fmhh24"h"mi' ) ), 12, ' ' ) st3,
  to_char( (sysdate-startup_time)*24*60*60, '999g999g990' ) st4
  ,status
  ,database_status
  --,blocked
  ,logins
  ,archiver
FROM gv$instance
ORDER BY INST_ID        
/
PROMPT
SET FEEDBACK 6 UNDERLINE '-'

hostgator