Print Page

Thursday, January 8, 2009

monitoring and cleaning internal queue

Sometime it is required to remove persistence data within B2B. This script will be very useful for cleaning any event stuck in internal B2B queues.

1) this script to find count of messages in queue.

SELECT a.queue_table, a.name, b.waiting, b.ready, b.expired FROM
dba_queues a, v$aq b WHERE a.qid = b.qid AND owner = 'B2B';

2)cleaning messages from specific queue table. in case, you are using inbound AQ, queue table is 'IP_QTAB'.

declare po dbms_aqadm.aq$_purge_options_t;
begin
po.block := FALSE;
dbms_aqadm.purge_queue_table(
queue_table => 'EVENT_QTAB',
purge_condition => NULL,
purge_options => po);
end;

No comments: