0

I am using Oracle Advanced queues to enqueue messages and then dequeue them by using PLSQL callback notification in which I have registered a procedure. Whenever a message is queued, DBMS scheduler starts and it takes about 2 minutes to dequeue the message and finish the job. If in those two minutes I recompile the child procedure that register procedure uses then DBMS scheduler will not load the new state of the procedure. The issue is if DBMS scheduler is running and a child package is recompiled and mean while a new message is enqueue then the dequeue process will fail with “ORA-06508: PL/SQL: COULD NOT FIND PROGRAM UNIT BEING CALLED” exception and will move the message to exception queue. Since scheduler had to do one more task now so the instance will take longer to finish and if we keep submitting messages than scheduler will keep running and all messages will fail with same exception. Once the current instance of scheduler finishes its job it will then reload the new state of the package and the future message will be processed correctly.

One way to fix this is if I set the job_queue_processes to 0 before recompiling the package and then set it back to its initial value but I am not sure if this is the best approach The ideal solution will be to force the DBMS scheduler to load the new instance of the child procedure as soon as they are modified but I am unable to find a way to do it.

Vishaw
  • 1
  • 2

1 Answers1

0

If you are on at least Oracle 11gR2 (possibly earlier) you may be able to use Edition-Based Redefinition which

enables you to upgrade the database component of an application while it is in use, thereby minimizing or eliminating down time.

Edition-Based redefinition allows you to have multiple versions of schema objects (such as stored procedures, functions and packages) defined and used simultaneously, and to gracefully switch over from the old version to the new version.

Sentinel
  • 6,379
  • 1
  • 18
  • 23
  • Thanks for your reply but I cannot use Edition-Based-Redefinition. However there is another issues I am facing, If I enqueue messages to a queue for which I have stopped the dequeue then whenever I turn back on dequeue then the messages that were enqueued while the dequeue was off do not get processed but the messages that are enqueued after the dequeue was turned back on gets processed. Is this normal? – Vishaw Feb 26 '18 at 22:40