oracle 启动时启动oracle出队
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/2542590/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Start oracle dequeue on startup
提问by Geln Yang
I got the following error of Oracle,
我收到以下 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?
但是每次重启数据库都会出现这个错误,有没有什么配置可以设置在数据库启动时启动dequeue?
thanks!
谢谢!
回答by Matthew Watson
What is the status of the queue in dba_queues
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.
我相信这应该在重新启动后持续存在,但我还没有测试过。
回答by alamar
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 boilerplateand it allows me to actually receive messages.
这都是样板文件,它允许我实际接收消息。