oracle – 如何解析ORA-27475:“JOB”必须是程序或链

前端之家收集整理的这篇文章主要介绍了oracle – 如何解析ORA-27475:“JOB”必须是程序或链前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我有几个oracle程序:
create or replace procedure receive_sms (p_to_date in date) 
is
..
end;@H_502_2@ 
 

create or replace procedure send_sms (p_date in date) 
is
..
end;@H_502_2@ 
 

我想基于这些过程创建一个链,并为链和一些规则添加步骤:

BEGIN
  DBMS_SCHEDULER.CREATE_CHAIN (
   chain_name            =>  'mobile_archive_chain',rule_set_name         =>  NULL,evaluation_interval   =>  NULL,comments              =>  NULL);
END;
/

--- define three steps for this chain. Referenced programs must be enabled.
BEGIN
 DBMS_SCHEDULER.DEFINE_CHAIN_STEP('mobile_archive_chain','send','inforpilla.send_sms');
 DBMS_SCHEDULER.DEFINE_CHAIN_STEP('mobile_archive_chain','receive','inforpilla.receive_sms');
END;
/

--- define corresponding rules for the chain.
BEGIN
 DBMS_SCHEDULER.DEFINE_CHAIN_RULE ('mobile_archive_chain','TRUE','START send');
 DBMS_SCHEDULER.DEFINE_CHAIN_RULE ('mobile_archive_chain','send COMPLETED','Start receive');
 DBMS_SCHEDULER.DEFINE_CHAIN_RULE ('mobile_archive_chain','receive COMPLETED','END');
END;
/

--- enable the chain
BEGIN
 DBMS_SCHEDULER.ENABLE('mobile_archive_chain');
END;
/

--- create a chain job to start the chain daily at 1:00 p.m.
BEGIN
 DBMS_SCHEDULER.CREATE_JOB (
   job_name        => 'start_archive',job_type        => 'CHAIN',job_action      => 'mobile_archive_chain',repeat_interval => 'freq=daily;byhour=15;byminute=3;bysecond=0',enabled         => TRUE);
END;
/@H_502_2@ 
 

但是检查日志表我发现作业失败了ERROR代码:27475

SELECT * from USER_SCHEDULER_JOB_RUN_DETAILS ORDER BY LOG_DATE DESC@H_502_2@ 
 

建议我从过程中删除参数,但后来我得到了这些错误

CHAIN_LOG_ID="201095"
CHAIN_LOG_ID="201095",STEP_NAME="RECEIVE",ORA-27475: "TEST.RECEIVE_SMS" must be a PROGRAM OR CHAIN
CHAIN_LOG_ID="201095",STEP_NAME="SEND",ORA-27475: "TEST.SEND_SMS" must be a PROGRAM OR CHAIN@H_502_2@
你需要确定几件事:

>最好在OWNER.JOBNAME中指定完整的作业名称.看谁是工作的所有者

select * from dba_scheduler_jobs where lower(job_name)='start_archive';@H_502_2@ 
 

>如果start_date和repeat_interval保留为null,则作业将在计划启动后立即运行.
>作业以计划作业的人身份运行,如果要使用当前用户权限,则不应将作业调度为SYS!

参考文献: –

Oracle Community

Ask Tom

原文链接:https://www.f2er.com/oracle/205226.html

猜你在找的Oracle相关文章