我拥有Oracle数据库11g企业版11.2.0.1.0版 - 在Windows 2008 R2上运行的64位生产版,它以某种方式获得了2016年设定日期的预定作业的下次运行日期。对于我们创建的工作,我是能够简单地重置START_DATE,从而导致NEXT_RUN_DATE重置。对于与Oracle自动统计信息收集相关的作业,我无法获得DMS_SCHEDULER.SET_ATTRIBUTE来更改其START_DATE值。
我尝试按照Oracle文档ID 1450173.1重置每周窗口的日期,使用SQL如下所示,它实际上重置了我在DBA_SCHEDULER_WINDOWS中看到但没有更改DBA_SCHEDULER_JOBS的值
BEGIN
DBMS_SCHEDULER.SET_ATTRIBUTE (
name => '"SYS"."MONDAY_WINDOW"',
attribute => 'START_DATE',
value => '10-JUN-15 10.00.00.000000000 PM US/CENTRAL');
END;
/
我看到这个问题的职位名称是:
RSE$CLEAN_RECOVERABLE_SCRIPT
ORA$AUTOTASK_CLEAN
PURGE_LOG
SM$CLEAN_AUTO_SPLIT_MERGE
BSLN_MAINTAIN_STATS_JOB
MGMT_STATS_CONFIG_JOB
其中一些缺少计划名称,但如果我为具有计划名称的计划尝试DBMS_SCHEDULER.SET_ATTRIBUTE,则会出现以下错误:
BEGIN
DBMS_SCHEDULER.SET_ATTRIBUTE (
name => '"SYS"."BSLN_MAINTAIN_STATS_SCHED"',
attribute => 'START_DATE',
value => '10-JUN-15 12.00.00.000000000 AM -05:00');
END;
Error report -
ORA-27476: "SYS.BSLN_MAINTAIN_STATS_SCHED" does not exist
ORA-06512: at "SYS.DBMS_ISCHED", line 4398
ORA-06512: at "SYS.DBMS_SCHEDULER", line 2892
ORA-06512: at line 2
27476. 00000 - "\"%s\".\"%s\" does not exist"
*Cause: A database object was specified that does not exist.
*Action: Reissue the command using an object that exists or create a new
object and then reissue this command.
我确实尝试过简单地执行作业,但也会引发错误:
exec dbms_scheduler.run_job('"SYS"."BSLN_MAINTAIN_STATS_JOB"', false)
Error report -
ORA-27476: "SYS.BSLN_MAINTAIN_STATS_JOB" does not exist
ORA-06512: at "SYS.DBMS_ISCHED", line 185
ORA-06512: at "SYS.DBMS_SCHEDULER", line 486
ORA-06512: at line 1
27476. 00000 - "\"%s\".\"%s\" does not exist"
*Cause: A database object was specified that does not exist.
*Action: Reissue the command using an object that exists or create a new
object and then reissue this command.
尝试运行成功运行的DBMS_AUTO_TASK_IMMEDIATE.GATHER_OPTIMIZER_STATS,但DBA_SCHEDULER_JOBS中的NEXT_RUN_DATE值没有变化
我还尝试使用DBMS_AUTO_TASK_ADMIN.ENABLE和DBMS_AUTO_TASK_ADMIN.DISABLE来进行“自动优化器统计信息收集”,以查看是否可能会触发日期重置的某些方式,但事实并非如此。我有人向我建议,重启Oracle可能会导致自Windows启动日期成功重置以来日期重置,并且DBA_SCHEDULER_JOBS中的那些可能在某种程度上在内存中但重启没有改变。
所以我的最终问题是那些START_DATE甚至NEXT_RUN_DATE如何被重置?