Oracle dbms job

From Ittichai Chammavanijakul's Wiki
Jump to: navigation, search
SQL> col WHAT format a30
SQL> col INTERVAL format a20
SQL> select job, what, broken, interval, next_date, this_date, last_date from user_jobs;
       JOB WHAT                           BROKEN INTERVAL             NEXT_DATE              THIS_DATE              LAST_DATE            
---------- ------------------------------ ------ -------------------- ---------------------- ---------------------- ----------------------
       190 dbms_refresh.refresh('"J1"');  N      sysdate +2/24        18-AUG-13 02.16.03 PM                         18-AUG-13 12.16.03 PM
                                                                                                           
       191 dbms_refresh.refresh('"J2"');  N      sysdate +4/24        18-AUG-13 10.30.00 AM  18-AUG-13 10.30.06 AM  17-AUG-13 09.50.28 PM  

-- If THIS_DATE is not NULL, job is currently running

-- Disable Job
SQL> exec dbms_job.broken (191, true);
SQL> commit;

-- Change Interval     
SQL> exec dbms_job.interval(191, 'sysdate + 6/24');
SQL> commit;

-- Change NextDate
SQL> exec dbms_job.next_datel(191, to_date('18-AUG-13 10.30.00 AM','DD-MON-YY HH:MI:00 AM'));
SQL> commit;


Reference: http://www.pafumi.net/dbms_job.htm