2

Unable to find the replacement for DBMS_JOB.Broken command to make the job broken. Please assist me for the same. Command used in my code is

dbms_job.broken(oracle_job_num, true);

Have done the changes for the below commands which was used in our code.

DBMS_JOB.SUBMIT -> DBMS_SCHEDULER.CREATE_JOB
DBMS_JOB.REMOVE -> DBMS_SCHEDULER.DROP_JOB
Venkatesh R
  • 515
  • 1
  • 10
  • 27

2 Answers2

0

I don’t think there is a specific api to mark a job as broken in dbms_scheduler but there is one to enable it again:

DBMS_SCHEDULER.enable(name=>'test_job');

There is an api to change after how many failures a job will be disabled:

DBMS_SCHEDULER.set_attribute (name=>'test_job', attribute=>'max_failures',value=>3);
doberkofler
  • 9,511
  • 18
  • 74
  • 126
0

Use DBMS_SCHEDULER.DISABLE('JOB_NAME') and DBMS_SCHEDULER.ENABLE('JOBNAME') instead of DBMS_JOB.BROKEN(ORACLE_JOB_NUM, TRUE) and DBMS_JOB.BROKEN(ORACLE_JOB_NUM, FALSE). The "broken" and "enabled" functionality are not exactly the same, because DBMS_JOBS automatically breaks jobs after 16 failures, whereas DBMS_SCHEDULER does not. But if you're just using BROKEN to manually disable and enable, then the behavior should be close enough.

Jon Heller
  • 34,999
  • 6
  • 74
  • 132