例如,我有一个包含3条消息的异常高级队列。如果我尝试将它们出列,它可以正常工作,但在我的应用程序中,我需要通过MSGID删除其中一些。我尝试使用SQL命令,但它延迟很多,然后我得到超时。
高级队列:
CREATE_QUEUE_TABLE (
queue_table => 'AQUSER.event_message_queue_qt',
queue_payload_type => 'AQUSER.EventMessageType',
sort_list => 'ENQ_TIME, PRIORITY');
CREATE_QUEUE (
queue_name => 'AQUSER.event_message_queue',
queue_table => 'AQUSER.event_message_queue_qt',
max_retries=> 10,
retry_delay=> 600);
CREATE_QUEUE (
queue_name => 'AQUSER.event_message_queue_ex_q',
queue_table => 'AQUSER.event_message_queue_qt',
queue_type => DBMS_AQADM.EXCEPTION_QUEUE);
尝试通过MSGID删除:
select * from event_message_queue_qt
where Q_NAME = 'event_message_queue_ex_q'
and MSGID = '6AA2E0C9A14ABA97E053119A14333514'
答案 0 :(得分:0)
高级队列表被其他用户锁定,但我没有得到关于它的好消息。
我运行以下命令来弄明白:
select
(select username from v$session where sid=a.sid) blocker,
a.sid,
' is blocking ',
(select username from v$session where sid=b.sid) blockee,
b.sid
from v$lock a, v$lock b
where a.block = 1
and b.request > 0
and a.id1 = b.id1
and a.id2 = b.id2;