Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Scheduler - Event based job - Source queue issue - ORA-27373

merciergDec 12 2007 — edited Dec 14 2007
Hi all,

I'm trying to create an event based job with the following source from this thread
1556219
but i get an errror ORA-27373: unknown or illegal event source queue

I check if the queue exists and it does.
Any helps is appreciated to understand what i'm doing wrong.

I'm using version 10g and granting SCHEDULER_ADMIN to <user_name>
-- create a table for output
CREATE TABLE job_output (a TIMESTAMP WITH TIME ZONE, b VARCHAR2(30));

-- add an event queue subscriber for this user's messages
EXEC dbms_scheduler.add_event_queue_subscriber('myagent')

-- create the first job and have it raise an event whenever it completes
-- (succeeds, fails or stops)

BEGIN
   DBMS_SCHEDULER.create_job
      ('first_job',
       job_action           => 'insert into job_output values(systimestamp, ''first job runs'');',
       job_type             => 'plsql_block',
       enabled              => FALSE,
       repeat_interval      => 'freq=secondly;interval=30'
      );
   DBMS_SCHEDULER.set_attribute ('first_job',
                                 'raise_events',
                                 DBMS_SCHEDULER.job_run_completed
                                );
END;
/

-- create a simple second job that runs after the first has completed

BEGIN
   DBMS_SCHEDULER.create_job
      ('second_job',
       job_type             => 'plsql_block',
       job_action           => 'insert into job_output values(systimestamp, ''second job runs'');',
       event_condition      => 'tab.user_data.object_name = ''FIRST_JOB''',
       queue_spec           => 'sys.scheduler$_event_queue,myagent',
       enabled              => TRUE
      );
END;
/

-- enable the first job so it starts running
EXEC dbms_scheduler.enable('first_job')
Thanks,
Grégory
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jan 11 2008
Added on Dec 12 2007
4 comments
2,366 views