このコードを Oracle 11g に対して SQL Developer で実行すると、エラーが発生します。
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 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.
Google 検索は役に立たない Oracle エラー コード サイトをたくさんリストアップしただけなので役に立ちませんでした。
おそらくSYS.DBMS_ISCHED/SYS.DBMS_SCHEDULERのソースでこれを説明できます。
更新: '2009-jan-01 01:15:00' の代わりに '2010-apr-20 01:15:00' を使用する別のジョブがうまくいったかもしれません。正しく処理されます。
更新: '2009-jan-01 01:15:00' の代わりに '2009-apr-01 01:15:00' を使用するとうまくいきました。ただし、「2009-mar-01 01:15:00」は機能しなかったため、ジョブをどれだけさかのぼって開始できるかという制限があります。私は自分の問題を解決したので、私の解決策の繰り返しである答えを受け入れることはできませんが、誰かがこれをさらに説明したい場合は、それを受け入れることを検討します.