1

我有以下甲骨文工作。

dbms_scheduler.create_job
                   (job_name                 => m_job_name,
                    job_type                 => 'PLSQL_BLOCK',
                    job_action               =>    'begin Pkg_Shell.PR_WF_PROC('
                                                || p_seq_request
                                                || '); end;',
                    number_of_arguments      => 0,
                    start_date               => sysdate,               
                    repeat_interval          => null,
                    end_date                 => null,                                       
                    job_class                => 'DEFAULT_JOB_CLASS',
                    enabled                  => false,
                    auto_drop                => true,
                    comments                 => null
                   );

上述作业不会自动删除。该作业将只运行一次。当我浏览各个网站时,它说

For auto drop,This flag if TRUE, causes a job to be automatically dropped after it has completed or has been automatically disabled. A job is considered completed if:
1.Its end date (or the end date of the job schedule) has passed.
2.It has run max_runs number of times. max_runs must be set with SET_ATTRIBUTE.
3.It is not a repeating job and has run once.

我的工作只会运行一次。为什么我的工作在某些情况下不会自动掉线。? 我们找不到它什么时候没有被丢弃。结束这个如果我想提到像 sysdate + 2 小时这样的 end_date 怎么提?如果我想设置 max_runs 或 max_fails 如何在我的工作中使用它。? 这两个设置或以上任何设置都可以解决我的问题吗?

4

1 回答 1

1

这么长时间后,我发现以下链接帮助我解决了我的问题。我使用 max_runs 设置为 1 。

dbms_scheduler.set_attribute(m_job_name,'max_runs',1);

https://community.oracle.com/thread/936850

https://community.oracle.com/message/2458833#2458833

于 2014-08-22T11:10:54.967 回答