Oracle: enable, disable and removing jobs

Request on getting all the jobs disabled and enabled prior to kicking off data loading fast and easy.

--enable job


BEGIN
  FOR J IN (SELECT * FROM user_jobs)
  LOOP
    dbms_job.broken( J.job, FALSE);
  END LOOP;
END;


--although this is ddl, commit will enable another session seeing the changes. Just for my specific need on my request. You may not need it.commit;

--disable job

BEGIN
  FOR J IN (SELECT * FROM user_jobs)
  LOOP
    dbms_job.broken( J.job, TRUE);
  END LOOP;
END;


--remove jobs

BEGIN
  FOR J IN (SELECT * FROM user_jobs)
  LOOP
    dbms_job.remove( J.job);
  END LOOP;
END;


No comments:

Post a Comment