DBMS_SCHEDULER.CREATE_JOB Oracle

时间:2013-09-18 14:11:15

标签: oracle plsql plsqldeveloper dbms-scheduler

我添加了DBMS_SCHEDULER.CREATE_JOB

SYS.DBMS_SCHEDULER.CREATE_JOB
(
   job_name        => 'CHECK'
  ,start_date      => TO_TIMESTAMP_TZ('2000/12/26 01:00:00.000000 +00:00','yyyy/mm/dd hh24:mi:ss.ff tzh:tzm')
  ,repeat_interval => 'FREQ=DAILY;BYMINUTE=05'
  ,end_date        => NULL
  ,job_class       => 'DEFAULT_JOB_CLASS'
  ,job_type        => 'PLSQL_BLOCK'
  ,job_action      => 'begin check.Checkname() end;'
  ,enabled         => TRUE
  ,comments        => ''
);

DBA_SCHEDULER_JOBS我正在获取工作详情,但其位于SCHEDULED州。

它没有运行。当我厌倦了手动运行这个工作时,它会抛出一些错误。

有人可以帮我解决这个问题吗?

1 个答案:

答案 0 :(得分:1)

但那是对的!

使用start_daterepeat_interval设置,您每天都会在01:05处运行一次作业。

JOB_NAME START_DATE                             REPEAT_INTERVAL        STATE     NEXT_RUN_DATE
-------- -------------------------------------- ---------------------- --------- -------------------------------------- 
LOGGER2  26-DEC-00 01.00.00.000000000 AM +00:00 FREQ=DAILY;BYMINUTE=05 SCHEDULED 19-SEP-13 01.05.00.600000000 AM +00:00

如果您想每5分钟运行一次作业,请使用:

start_date => systimestamp,
repeat_interval => 'FREQ=MINUTELY;INTERVAL=5'

JOB_NAME START_DATE                             REPEAT_INTERVAL          STATE     NEXT_RUN_DATE
-------- -------------------------------------- ------------------------ --------- -------------------------------------- 
LOGGER3  18-SEP-13 06.53.53.532906000 PM +00:00 FREQ=MINUTELY;INTERVAL=5 SCHEDULED 18-SEP-13 06.58.53.500000000 PM +00:00