Can not run a completed DBMS_SCHEDULER
job by remove the END_DATE
Hello, everyone!
I am using oracle 12cR1,now I have a problem in DBMS_SCHEDULER
jobs.
First, I created an repeated oracle DBMS_SCHEDULER
jobs with END_DATE
was set,
after the set END_DATE
, the job completed successfully, and the enabled state of job changed to disabled automatically.
According to the running log of the job, the Operation was COMPLETED
, while Additional info was REASON="End time reached"
That was expected.
Then I wanted to run the job again, I removed the END_DATE
field by
SYS.DBMS_SCHEDULER.SET_ATTRIBUTE('JOB_XXX', 'END_DATE', '');
and set the job enable by
SYS.DBMS_SCHEDULER.ENABLE(name => 'JOB_XXX');
I can see the job was enabled again and END_DATE was empty.
But The Job run again only once, and stopped, the running log of was COMPLETED
, while Additional info was REASON="End time reached"
again.
BEGIN
sys.dbms_scheduler.CREATE_JOB(
JOB_NAME => 'JOB_3358',
job_type => 'STORED_PROCEDURE',
JOB_ACTION => 'TEST_JOB',
START_DATE => to_date('2019-05-05 13:35:00','yyyy-mm-dd hh24:mi:ss'),
REPEAT_INTERVAL => 'FREQ= SECONDLY;INTERVAL=30',
END_DATE => to_date('2019-05-05 13:38:00','yyyy-mm-dd hh24:mi:ss'),
auto_drop => FALSE,
COMMENTS => NULL);
END;
/
begin
sys.dbms_scheduler.enable(name => 'JOB_3358');
end;
/
What I expected was that the job will run according to REPEAT_INTERVAL
again,
and as end_date
was empty, it should never stop.
Is there any mistake in removing END_DATE
, or is this the oracle's bug?
Thanks in advance, and best Regards!
DBMS_SCHEDULER.set_attribute_null (name=>'JOB_3358', attribute=>'end_date')
– Zephaniah