TTITLE LEFT SKIP 1 "JOBS" SKIP 2
SET LINES 160 PAGES 100
CLEAR COLUMNS
COL job          FORM 999999
COL what         FORM a35 TRUNC
COL INterval     FORM a45
COL schema_user  FORM a15
COL failures     FORM 9999
ALTER SESSION SET nls_date_format='dd/mm/yyyy hh24:mi:ss';

SELECT  job,
        schema_user,
        lASt_date,
        next_date,
        INterval,
        broken,
        failures,
        what
FROM    dba_jobs
ORDER BY job;
TTITLE OFF

/*-- Script – List status of all submitted DBMS jobs --*/

SET pagesize 100
SET lINesize 120
ttitle -
  center  'Submitted DBMS Jobs' skip 2

COL job  format 99999  headINg 'job#'
COL subu format a10  headINg 'Submitter'     trunc
COL lsd  format a5   headINg 'LASt|Ok|Date'
COL lst  format a5   headINg 'LASt|Ok|Time'
COL nrd  format a5   headINg 'Next|Run|Date'
COL nrt  format a5   headINg 'Next|Run|Time'
COL fail format 999  headINg 'Errs'
COL ok   format a2   headINg 'Ok'


SELECT
  job,
  log_user                   subu,
  what                       proc,
  to_char(lASt_date,'MM/DD') lsd,
  substr(lASt_sec,1,5)       lst,
  to_char(next_date,'MM/DD') nrd,
  substr(next_sec,1,5)       nrt,
  failures                   fail,
  decode(broken,'Y','N','Y') ok
FROM
  sys.dba_jobs
  WHERE lASt<>'OK';

/*---- JOBS EM EXECUÇÃO ----*/
TTITLE LEFT SKIP 1 "JOBS EM EXECUÇÃO" SKIP 2
SET LINES 200 PAGES 100
CLEAR COLUMNS
COL job          FORM 9999
COL INterval     FORM a40
COL schema_user  FORM a15
COL failures     FORM 9999
ALTER SESSION SET nls_date_format='dd/mm/yyyy hh24:mi:ss';
SELECT  sid,
        job,
        lASt_date,
        lASt_sec,
        this_date,
        this_sec,
        failures,
        instance
FROM    dba_jobs_running
ORDER BY job;
TTITLE OFF

hostgator