alter session set time_zone='+00:00';
column src_db format a12
column source_commit format a25
column target_commit format a25
column totallag format 0.0
select src_db, extract_name, update_timestamp, source_commit, target_commit, totallag,
       CASE when trunc(to_number(substr((systimestamp at time zone 'UTC'-update_timestamp),1, instr(systimestamp at time zone 'UTC'-update_timestamp,' ')))) * 1440
           + to_number(substr((systimestamp at time zone 'UTC'-update_timestamp), instr((systimestamp at time zone 'UTC'-update_timestamp),' ')+1,2)) * 60
           + to_number(substr((systimestamp at time zone 'UTC'-update_timestamp), instr((systimestamp at time zone 'UTC'-update_timestamp),' ')+4,2) ) > 5 THEN '*' end ATTN
  from ggadmin.ggs_heartbeat order by update_timestamp
/
