如何在oracle中执行作业? [英] How to execute the jobs in oracle?

查看:465
本文介绍了如何在oracle中执行作业?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一份简单的工作:

BEGIN
DBMS_SCHEDULER.CREATE_JOB (
job_name => 'offc.My_job1',
job_type => 'STORED_PROCEDURE',
job_action => 'offc.MYPROC',
start_date => sysdate,
repeat_interval => 'FREQ=SECONDLY;INTERVAL=5',
end_date => '02-Jan-2020 10:29:05 PM',
auto_drop => FALSE,
comments => 'My new job');
END;
/

现在,我尝试使用以下方式运行作业:

Now,I tried to run the job using:

EXEC DBMS_SCHEDULER.ENABLE(‘My_job1’);

我收到以下错误消息:

PLS-00103: Encountered the symbol "‘" when expecting one of the following:

   ( ) - + case mod new not null <an identifier>
   <a double-quoted delimited-identifier> <a bind variable>
   table continue avg count current exists max min prior sql
   stddev sum variance execute multiset the both leading
   trailing forall merge year month day hour minute second
   timezone_hour timezone_minute timezone_region timezone_abbr
   time timestamp interval date
   <a string literal with character set specification>

我也尝试过

 DBMS_SCHEDULER.enable (name => 'My_job1');

我收到以下错误消息:

ORA-00900: invalid SQL statement

他们两个都没有工作.为什么我的工作没有得到执行?

Both of them are not working.Why is not my job being runned?

推荐答案

我认为您再次面临单引号的问题.

I think you are again facing issue of the single quote.

EXEC DBMS_SCHEDULER.ENABLE(‘My_job1’);

oracle不支持在此引用.应该是'.

Here quotes is not supported by oracle. It should be ' .

EXEC DBMS_SCHEDULER.ENABLE('My_job1');

干杯!

这篇关于如何在oracle中执行作业?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆