在一天中的特定时间创建计划

时间:2014-10-24 13:54:54

标签: oracle oracle11g

我需要一个时间表,每天08:35和09:46运行。

我现在如何制作一个在几个小时运行的产品,它是这样的:

dbms_scheduler.create_job(job_name        => 'YOUR_JOB',
                          job_type        => 'PLSQL_BLOCK', 
                          job_action      => 'integration_export;',
                          start_date      => systimestamp,
                          repeat_interval => 'freq=hourly; byhour=8,10,12,14,16,18; byminute=0; bysecond=0;',
                      enabled         => true,
                      auto_drop       => false,
                      comments        => 'some comment about the job');

但是,如果我添加条款minutely,那么它会在那几分钟的所有这些时间运行。 我怎么能做到这一点?

1 个答案:

答案 0 :(得分:0)

start_date作为日期本身与确切时间08:45。使用日期函数和格式。做两个工作,一个是8:45,另一个是09:46。

start_date = to_date(to_char(trunc(sysdate) <add your time part with proper format>

抱歉,没有数据库访问权限验证。但是,逻辑是,start_date只有日期部分动态变化,保持时间部分不变应该有效。

相关问题