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

原创 2015年11月18日 10:03:51

问题描述:

在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

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


相关文章推荐

oracle 作业过程 解决没有自动执行的问题

创建作业就不说了,很简单,这里主要说的是没有按照规定时间自动执行的问题 解决方法: 1.运行作业 begin  dbms_job.run(1); //表示作业编号,可以通过select...

oracle定时任务、作业

创建一个简单的定时任务   1、创建表 create table a( a date ) 2、创建存储过程 create or replace procedure p_test as begi...
  • fjseryi
  • fjseryi
  • 2015年05月22日 09:20
  • 4537

ORA-00600 [17114] and ORA-03001

晚上吃完饭来到电脑前,刚一上线发现QQ上有人发过来消息,是之前刚认识的一名Oracle学习者,问候之后说遇到一个错误想让帮忙看下,随即让其把相关的错误信息发过来。发过来的alert日志中重要的信息如下...
  • amto001
  • amto001
  • 2012年12月14日 11:02
  • 908

ORA-16456错误,由于备库未mount而在主库执行切换,解决办法详解

如果对数据库进行主备库的切换需要的前提条件是: (1)备库必须mount状态下,主库open状态 (2)必须不能在最大保护模式下   我们有时做主备库的切换,结果忘记了把备库处于mount状态...

Oracle startup mount报错‘继续执行将不安全 ORA-03114: 未连接到ORACLE’的问题

Oracle startup mount报错‘继续执行将不安全 ORA-03114: 未连接到ORACLE’的问题

执行oracle中的job报错:ORA-12011:无法执行作业1存储过程执行DDL语句提示ORA-01031错误:权限不足

LZ在做一个job执行每天新增一个表的操作时,存储过程运行没问题,job也创建成功,但运行job时,却报错: ,后又用sys用户登陆创建了同样的存储过程和job,结果可以执行成功。当...

手动部署Oracle RAC EM报错 WARNING: Error during db connection : ORA-12514

OracleRAC version:11.2.0.2.7 手动执行部署RAC EM,抛出 WARNING:Error during db connection : ORA-12514: TNS...
  • dbaqidu
  • dbaqidu
  • 2012年08月23日 14:51
  • 1677

执行job时出现错误ORA-08102

昨天在做定期清理job的时候出现ORA-08102的错误 BAK.PKG_CLEAN.PROC_MS_CLEANfailed: ORA-08102: index key not found, obj...
内容举报
返回顶部
收藏助手
不良信息举报
您举报文章:手动执行作业 出现ora-03001 未实施的功能
举报原因:
原因补充:

(最多只允许输入30个字)