Strange Error : ORA-06512: at "SYS.DBMS_SCHEDULER" - job does not exist
605203Feb 18 2009 — edited Feb 20 2009connect user1/pwd
create or replace procedure job_wait_test is
begin
null;
end;
/
create or replace procedure test is
begin
for j in 1..10 loop
submit_background_job('job_wait_test');
end loop;
end;
/
Note:
procedure submit_background_job:-
======================
dbms_scheduler.create_job
(job_name => job_name, --generating unique job name.
job_class => 'class1' ,
job_type => 'plsql_block',
job_action => 'begin ' || job_code||'; end; commit;',
start_date => null,
repeat_interval => null,
enabled => true,
auto_drop => true
);
dbms_scheduler.set_attribute
(name => job_name,
attribute => 'restartable',
value => TRUE); -- default true; LINE NO 255 HERE THE ERROR occurs
-- OCCURS(ORA-06512: at "submit_background_job", line 255)
show errors;
grant execute on test to user2;
connect user2/pwd
set serveroutput on;
exec test;
Run exe command multiple times, you will see the following error.
07:52:07 SQL> exec test;
BEGIN test; END;
*
ERROR at line 1:
ORA-27476: "B_773616" does not exist
ORA-06512: at "SYS.DBMS_ISCHED", line 2792
ORA-06512: at "SYS.DBMS_SCHEDULER", line 1895
ORA-06512: at "submit_background_job", line 255
ORA-06512: at "TEST", line 5
ORA-06512: at line 1
This above error i am getting from line 255 of submit_background_job, but not always some times.
To reproduce you need to run the exec test; multiple times