关闭

手动执行作业 出现ora-03001 未实施的功能

1547人阅读 评论(0) 收藏 举报
分类:

问题描述:

在pl/sql工具下手动执行带 chain的作业

如:begin dbms_scheduler.run_job(job_name => 'job_test'); end;

出现错误:

ora-03001 未实施的功能


注:但在pl/sql工具可视化作业管理下手动执行作业竟然是成功

问题分析:说明创建的作业应该是没有问题能够正常执行,问题可能出现在dbms_scheduler.run_job的调用上,于是去查官方文档如下:

RUN_JOB Procedure

This procedure runs a job immediately.

Syntax

DBMS_SCHEDULER.RUN_JOB (
   job_name                IN VARCHAR2,
   use_current_session     IN BOOLEAN DEFAULT TRUE);

Parameters

Table 93-48 RUN_JOB Procedure Parameters

Parameter Description

job_name

The name of the job being run

use_current_session

This specifies whether the job run should occur in the same session as the one that the procedure was invoked from.

When use_current_session is set to TRUE:

  • You can test a job and see any possible errors on the command line.

  • run_countlast_start_datelast_run_duration, and failure_count are not updated.

  • RUN_JOB can be run in parallel with a regularly scheduled job run.

When use_current_session is set to FALSE:

  • You need to check the job log to find error information.

  • run_countlast_start_datelast_run_duration, and failure_count are updated.

  • RUN_JOB fails if a regularly scheduled job is running.

Usage Notes

The job does not have to be enabled. If the job is disabled, the following validity checks are performed before running it:

  • The job points to a valid job class.The job owner has EXECUTE privileges on the job class.If a program or chain is referenced, the program/chain exists.If a program or chain is referenced, the job owner has privileges to execute the program/chain.All argument values have been set (or have defaults).The job owner has the CREATE EXTERNAL JOB privilege if this is an external job.

The job can be run in two different modes. One is in the current user session. In this case, the call to RUN_JOB will block until it has completed the job. Any errors that occur during the execution of the job will be returned as errors to the RUN_JOB procedure. The other option is to run the job immediately like a regular job. In this case, RUN_JOB returns immediately and the job will be picked up by the coordinator and passed on to a job slave for execution. The Scheduler views and logs must be queried for the outcome of the job.

Multiple user sessions can use RUN_JOB in their sessions simultaneously when use_current_session is set to TRUE.

When using RUN_JOB with jobs that point to chains, use_current_session must be FALSE.

RUN_JOB requires that you be the owner of the job or have ALTER privileges on that job. You can also run a job if you have the CREATE ANY JOB privilege.

那个画红色的语句是重点,说明job调用chains,必需把use_current_session设置为false

附上官方链接:dbms_scheduler包说明

语句修改为:

如:begin dbms_scheduler.run_job(job_name => 'job_test',use_current_session => false); end; 这样的调用都会记录以下信息:

run_countlast_start_datelast_run_duration, and failure_count

运行次数,最后开始时间,最后运行持续时间和失败次数。


0
0

查看评论
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
    个人资料
    • 访问:31666次
    • 积分:624
    • 等级:
    • 排名:千里之外
    • 原创:32篇
    • 转载:10篇
    • 译文:0篇
    • 评论:0条
    文章分类