This content has been marked as final. Show 5 replies
i want to drop a broken job but it is taking long time why?
i am using below syntax:
Why do you think the job is broken? You are setting broken to FALSE.
See the BROKEN procedure in the doc
Example BEGIN DBMS_JOB.REMOVE(14144); COMMIT; END;
If you set job as broken while it is running, Oracle resets the job's status to normal after the job completes. Therefore, only execute this procedure for jobs that are not running.
In user_jobs i am able to see job status is broken. So the job is not picked up, so i am trying to drop it up and planning to create new one. Still it is not allowing me to drop as well as unable to mark the broken status as 'N'.
And you think BROKEN='N' means the job is broken?
Like I showed you, you need to remove the job; it is already broken.
you can drop the job and recreate it. To drop the job :-
To create a job
BEGIN DBMS_SCHEDULER.drop_job (job_name => 'job_name); END;
BEGIN DBMS_SCHEDULER.create_job ( job_name => 'job_name', job_type => 'PLSQL_BLOCK', job_action => 'BEGIN your_procedure; END;', start_date => SYSTIMESTAMP, repeat_interval => 'freq=hourly; byminute=0; bysecond=0;', end_date => NULL, enabled => TRUE, comments => 'any_comment_you_want.'); END; /