开发者

Start oracle dequeue on startup

开发者 https://www.devze.com 2022-12-25 15:16 出处:网络
I got the following error of Oracle, ORA-25226: dequeue failed, queue string.string is not enabled for dequeue

I got the following error of Oracle,

ORA-25226: dequeue failed, queue string.string is not enabled for dequeue

And the following is the Cause and Action for it from the official document:

Cause: The queue has not been enabled for dequeue.
Action: Enable the queue using START_QUEUE.
开发者_开发知识库

But this error occurs every time when restart the database, is there any configuration to set to start the dequeue on database startup?

thanks!


What is the status of the queue in dba_queues

select owner,name,enqueue_enabled,dequeue_enabled from dba_queues;

If the queue is disabled, then start it with

begin
 dbms_aqadm.start_queue(queue_name => '<OWNER.QUEUE_NAME>');
end; /

I believe this should persist across restarts, I haven't tested though.


In my case it was caused by the lack of

DECLARE 
   subscriber          sys.aq$_agent; 
BEGIN 
   subscriber := sys.aq$_agent('subscriber1', '<OWNER.QUEUE_NAME>', null); 
   DBMS_AQADM.ADD_SUBSCRIBER(
      queue_name         => '<OWNER.QUEUE_NAME>', 
      subscriber         =>  subscriber); 
END;

It's all boilerplate and it allows me to actually receive messages.

0

精彩评论

暂无评论...
验证码 换一张
取 消