When this code is executed in SQL Developer against Oracle 11g I get an error,
begin
dbms_scheduler.create_job(
job_name => 'comuni_34',
job_type => 'plsql_block',
job_action => 'begin com_auth_api.expire_old_passwords; end;',
start_date => to_date('2009-jan-01 01:15:00', 'yyyy-mon-dd hh24:mi:ss'),
repeat_interval => 'freq=daily',
enabled => true,
comments => 'Expire old passwords'
);
end;
This is the error,
Error starting at line 4 in command:
begin
dbms_scheduler.create_job(
job_name => 'comuni_34',
job_type => 'plsql_block',
job_action => 'begin com_auth_api.expire_old_passwords; end;',
start_date => to_date('2009-jan-01 01:15:00', 'yyyy-mon-dd hh24:mi:ss'),
repeat_interval => 'freq=daily',
enabled => true,
comments => 'Expire old passwords'
);
end;
Error report:
ORA-01870: the intervals or datetimes are not mutually comparable
ORA-06512: at "SYS.DBMS_ISCHED", line 99
ORA-06512: at "SYS.DBMS_SCHEDULER", line 268
ORA-06512: at line 2
01870. 00000 - "the intervals or datetimes are not mutually comparable"
*Cause: The intervals or datetimes are not mutually comparable.
*Action: Specify a pair of intervals or datetimes that are mutually
comparable.
A Google search did not help as it just listed loads of useless Oracle error code sites.
Maybe the source to SYS.DBMS_ISCHED/SYS.DBMS_SCHEDULER can explain this.
Update: A different job that uses '2010-apr-20 01:15:00' instead of '2009-jan-01 01:15:00' just worked maybe the problem is that dates that are too far in the past are not handled correctly.
Update: Using '2009-apr-01 01:15:00' instead of '2009-jan-01 01:15:00' just worked. However '2009-mar-01 01:15:00' did not work so there is limit one how far back a job can be started. Since I have solved my problem I cannot accept an answer that is a repeat of my solution but if someone wants to explain this further I will consider accepting that.