This discussion is archived
3 Replies Latest reply: Sep 7, 2012 5:49 AM by user12011387 RSS

ORA-03001: unimplemented feature while run_job, job_type=>'CHAIN'

user12011387 Newbie
Currently Being Moderated
Hello,

I'm trying to run a chain manually with option run_job, to be able to run the job with use_current_session => TRUE.
I've read documentation, but I'm not able to understand the error message nor why it happens.

ERROR at line 1:
ORA-03001: unimplemented feature
ORA-06512: at "SYS.DBMS_ISCHED", line 185
ORA-06512: at "SYS.DBMS_SCHEDULER", line 486
ORA-06512: at line 2

Here is the code used.

-- Create Program
-- BEGIN
dbms_scheduler.create_program(
program_name => 'PROGRAM_TASK',
program_type => 'STORED_PROCEDURE',
program_action => 'my_shrink_prog',
number_of_arguments => 1,
enabled => FALSE,
comments => 'sample code that enable row movement');
END;
/

create or replace procedure my_shrink_prog( par in varchar2) authid current_user as
BEGIN
EXECUTE IMMEDIATE 'alter table ' || par || ' enable row movement';
END;
/

BEGIN
DBMS_SCHEDULER.define_program_argument (
program_name => 'PROGRAM_TASK',
argument_position => 1,
argument_type => 'VARCHAR2',
DEFAULT_VALUE => 'T1'
);
dbms_scheduler.enable('PROGRAM_TASK');
END;
/


BEGIN -- Create Chain with only one step (to simplify the test).

DBMS_SCHEDULER.CREATE_CHAIN (chain_name => 'MY_CHAIN2');

DBMS_SCHEDULER.DEFINE_CHAIN_STEP('MY_CHAIN2', 'STEP1', 'PROGRAM_TASK');

DBMS_SCHEDULER.DEFINE_CHAIN_RULE ('MY_CHAIN2', 'TRUE', 'START STEP1');
DBMS_SCHEDULER.DEFINE_CHAIN_RULE ('MY_CHAIN2', 'STEP1 COMPLETED', 'END');
DBMS_SCHEDULER.ENABLE ('MY_CHAIN2');
END;
/

-- Job that would run the chain

begin
dbms_scheduler.create_job(
job_name=>'CHAIN_JOB_1'
, auto_drop=>TRUE
     , job_type=>'CHAIN'
     , job_action=>'MY_CHAIN2'
     , repeat_interval=>'freq=daily;byhour=13;byminute=0;bysecond=0'
, enabled=>TRUE
);
end;
/

-- Now I try to run the CHAIN with run_job, before daily scheduled time (13:00 pm). In theory it should work, but fails.

begin
dbms_scheduler.run_job('CHAIN_JOB_1',TRUE);
end;
/

ERROR at line 1:
ORA-03001: unimplemented feature
ORA-06512: at "SYS.DBMS_ISCHED", line 185
ORA-06512: at "SYS.DBMS_SCHEDULER", line 486
ORA-06512: at line 2


__Note 1:_

- The scheduled job really works. At 13:00 pm the scheduled job starts and complete the chain steps as defined.

Many thanks in advance.
Regards Luis Gomez

Edited by: user12011387 on 07-sep-2012 4:14

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points