Thursday, 20 June 2013

Convert Interval to Seconds

  SELECT *  
    FROM DBA_SCHEDULER_JOB_RUN_DETAILS  
   WHERE OWNER = 'SCOTT'  
     AND ACTUAL_START_DATE >= (SYSDATE - 4)  
     AND (  
          EXTRACT(DAY    FROM RUN_DURATION) * 86400 +  
          EXTRACT(HOUR   FROM RUN_DURATION) * 3600 +  
          EXTRACT(MINUTE FROM RUN_DURATION) *  60 +  
          EXTRACT(SECOND FROM RUN_DURATION)  
          ) > 1.5  
ORDER BY ACTUAL_START_DATE;