Dequeue from multi consumer queue table

Hi,
Even after all consumers I created have dequeued the messages (in REMOVE mode), they just didn't go from the queue table. Although my application works fine (the messages could no longer be dequeued again), I am afraid this will affect performance when messages piled up in Q table.
I tried maunally delete the records in Q table. But the question is "is there an automatic way to handle this?"
Thx for any feedback!

Make sure that the init.ora parameter AQ_TM_PROCESSES is set to 1 or more. This is the parameter that controls the number of processes available to clean up the queue after the messages have been dequeued or the message has expired.

Similar Messages

  • Dequeue from multi consumer queue without consumer_name

    Are there any way to efficient emptying a multiconsumer queue where mesages by sender are taged with consumer_name, and there are multiple consumers?

    Christian,
    I have the same question. Have you got any answer or found out any good solution?
    Thx!

  • Multi-consumer queue table does not empty

    Hello,
    I must be missing something pretty trivial here but I have setup queue with a queue table where multiple_consumers = true. When I dequeue a message from the queue it is received, but the message is still left in the queue table. When I do a second dequeue I get a end-of-fetch error.
    Currently, there is only one subscriber and the subscriber is specified as the recipient of the message.
    How do I get the messages removed from the queue table?
    DECLARE
        queue_options       DBMS_AQ.ENQUEUE_OPTIONS_T;
        message_properties  DBMS_AQ.MESSAGE_PROPERTIES_T;
        recipients          DBMS_AQ.AQ$_RECIPIENT_LIST_T;
        message_id          RAW(16);
        my_message          MYRESP_T;
    BEGIN
        recipients(1) := sys.aq$_agent('MY_SUBSCRIBER',null,null);
        message_properties.recipient_list := recipients;
        my_message := MYRESP_T('99293','ORCL','TEST');
        DBMS_AQ.ENQUEUE(
            queue_name => 'RESP_Q',
            enqueue_options => queue_options,
            message_properties => message_properties,
            payload => my_message,
            msgid => message_id);
        COMMIT;
    END;
    DECLARE
            r_dequeue_options    DBMS_AQ.DEQUEUE_OPTIONS_T;
            r_message_properties DBMS_AQ.MESSAGE_PROPERTIES_T;
            v_message_handle     RAW(16);
            o_payload                 MYRESP_T;
            v_dynamic_sql           VARCHAR2(4000);
            BEGIN
                r_dequeue_options.wait := DBMS_AQ.NO_WAIT;
                r_dequeue_options.dequeue_mode := DBMS_AQ.REMOVE;
                r_dequeue_options.navigation := DBMS_AQ.FIRST_MESSAGE;
                r_dequeue_options.consumer_name := 'MY_SUBSCRIBER';
                DBMS_AQ.DEQUEUE(
                    queue_name         => 'RESP_Q',
                    dequeue_options    => r_dequeue_options,
                    message_properties => r_message_properties,
                    payload            => o_payload,
                    msgid              => v_message_handle
              commit;
            END;Thanks in advance

    Presumably the message gets left on the Q with a state of PROCESSED? If so then that suggests you have aq_tm_processes explicitly set to 0 (zero) in your spfile/pfile - these background processes clear messages which have been PROCESSED.
    If this is not the case can you post the state of the messages and some more information like version and AQ related parameters?
    Thanks
    Paul

  • Retry counts on multi consumer queues in Java

    Is there a way to get the retry count of a message that has been dequeued from a multiconsumer queue? I believe we were able to access the retry count of a message on a single consumer queue, but when dequeuing from a multiconsumer queue, the retry count field is not filled with a value.
    Can this be done?

    Is there a way to get the retry count of a message that has been dequeued from a multiconsumer queue? I believe we were able to access the retry count of a message on a single consumer queue, but when dequeuing from a multiconsumer queue, the retry count field is not filled with a value.
    Can this be done?

  • How to send message to a multi-consumer queue using pl/sql

    How to send message to a multi-consumer queue using pl/sql ? Thanks.
    I tried following, but got an message: no receipient specified.
    DBMS_AQ.ENQUEUE(
    queue_name => 'aqadm.multi_queue',
    enqueue_options => queue_options,
    message_properties => message_properties,
    payload => my_message,
    msgid => message_id);
    COMMIT;
    END;
    /

    Here's two way to enqueue/publish new message into multi-consumer queue.
    (1) Use explicitly declared recipient list
    - Specify "Recipients" by setting recipient_list to messge_properties, before ENQUEUE().
    DECLARE
    recipients DBMS_AQ.aq$_recipient_list_t;
    BEGIN
    recipients(1) := sys.aq$_agent('RECIPIENTNAME',NULL,NULL);
    message_properties.recipient_list := recipients ;
    (2)Or, declare subscriber list permanently. Then you need not to specify recipient list each time you call ENQUEUE().
    begin
    dbms_aqadm.add_subscriber(
    queue_name=>'YOURQUEUE',
    subscriber=> sys.aq$_agent('RECIPIENTNAME', null, null)
    end;
    You can add 1024 local subscriber include maximum 32 remote-queue-consumer to one queue.

  • Internal Error ORA-0600 when creating multiple consumer queue table

    Hi,
    I tried to create a multiple consumer queue table with the following statements:
    exec DBMS_AQADM.GRANT_TYPE_ACCESS ('system');
    create type Change_History_Trigger_Data as object(Col1 VARCHAR2(255), Col2 VARCHAR2(128), Col3 VARCHAR2(255), Col4 TIMESTAMP, Col5 VARCHAR2(64), Col6 VARCHAR2(64), Col7 NUMBER(8));
    Works fine till this stage. But the following statement produces an ORA-0600 internal error message.
    EXEC DBMS_AQADM.CREATE_QUEUE_TABLE ('change_history_queue_tbl','Change_History_Trigger_Data', 'tablespace my_tblspace','ENQ_TIME',TRUE,DBMS_AQADM.TRANSACTIONAL);
    ERROR at line 1:
    ORA-00600: internal error code, arguments: [kcbgtcr_4], [14392], [0], [1], [], [], [], []
    ORA-06512: at "SYS.DBMS_AQADM_SYS", line 2224
    ORA-06512: at "SYS.DBMS_AQADM", line 58
    ORA-06512: at line 1
    I tried creating the same queue table with Multiple consumer = FALSE, and it works fine. But not with multiple consumer = TRUE
    I'm running on Oracle9i Enterprise Edition Release 9.2.0.6.0
    Any possible solutions?

    Problem solved.
    The queue name was too long. Found a post with the same problem.
    Re: Create Queue Table ORA-00600 while dbms_aqadm.create_queue_table
    thanks anyway

  • PL/SQL Callback registered on multi consumer queue takes 6 seconds to call

    Registered a PL/SQL callback procedure on multi consumer Queue. if I enqueue message into queue, it takes 6 seconds to call PL/SQL callback procedure.
    Why does it takes 6 seconds ?
    I believe Queue submits DBMS Job to execute the Callback. I am not sure why it is taking 6 seconds to execute the callback.
    are there any configarable parameters to set which allows callbacks to be executed more frequently?

    You can try to change jobqueue_interval=1      
    This is a scan rate interval (seconds) of job queue parameter.
    it is 5 sec by default.
    Regards,
    Sergey

  • Notify when message arrives in multi-consumer queue in Oracle 8i

    Hi,
    Is there any way by which we can get notified whenever a new message arrives in the multi-consumer queue ?
    Thanks,
    Shailesh

    Probably a better shot of an answer in the AQ forum.
    Advanced Queueing

  • Dequeue   elements from an  apply - queue table

    hi Everyone?
    I'm tried dequeue elements from a queue table. This one, is associated to an apply streams process. I'd wrote this procedure to test a manual dequeue, but this error message appears :
    ORA-25228: timeout or end-of-fetch during message dequeue from STADMIN.Q_APP_SELECTS_FROM_CRM
    The queue is not empty
    Help me please... thank you
    The Procedure code is:
    create or replace procedure str_clean_queue (cola in varchar2, tabla in varchar2, comando in varchar2) is
    next_trans EXCEPTION;
    pragma exception_init (next_trans, -25235);
    no_messages EXCEPTION;
    pragma exception_init (no_messages, -25228);
    dequeueOpt dbms_aq.dequeue_options_t;
    message_properties dbms_aq.message_properties_t;
    message SYS.ANYDATA;
    msgid raw(16);
    newMess boolean;
    lcr SYS.LCR$_ROW_RECORD;
    a number :=0;
    begin
    dequeueOpt.CONSUMER_NAME := 'APP_SELECTS_FROM_CRM';
    dequeueOpt.DEQUEUE_MODE := DBMS_AQ.LOCKED;
    dequeueOpt.NAVIGATION := DBMS_AQ.FIRST_MESSAGE;
    dequeueOpt.VISIBILITY := DBMS_AQ.IMMEDIATE;
    dequeueOpt.WAIT :=10;
    dequeueOpt.MSGID := null;
    newMess:=True;
    while (newMess) loop
    begin
    DBMS_AQ.DEQUEUE (
    queue_name => 'STADMIN.'|| cola,
    dequeue_options => dequeueOpt,
    message_properties => message_properties,
    payload => message,
    msgid => msgid);
    -- analizamos lo que llego en el payload
    lcr := DBMS_STREAMS.CONVERT_ANYDATA_TO_LCR_ROW(message);
    if (lcr.get_command_type = comando AND
    lcr.get_object_name = tabla AND
    lcr.get_object_owner = 'DBADMIN') then
    -- hacer desaparecer el lcr de la cola
    dequeueOpt.DEQUEUE_MODE := DBMS_AQ.REMOVE;
    dequeueOpt.MSGID := msgid;
    DBMS_AQ.DEQUEUE (
    queue_name => 'STADMIN.'|| cola,
    dequeue_options => dequeueOpt,
    message_properties => message_properties,
    payload => message,
    msgid => msgid);
    a:=a+1;
    end if;
    dbms_output.put_line(a);
    exception
    WHEN next_trans THEN
    dequeueOpt.navigation := DBMS_AQ.NEXT_TRANSACTION;
    WHEN no_messages THEN
    dbms_output.put_line(sqlerrm);
    newMess := FALSE;
    end;
    end loop;
    end str_clean_queue;

    Hello,
    as you wrote you already have a code snippet with DBMS_AQ.DEQUEUE of an exception queue.
    Wrap this DEQUEUE in an infinite loop (LOOP ... END LOOP). In order to have this procedure as an autonomous session
    you can start it as a database job:
    DECLARE
       v_jobno NUMBER(6);
    BEGIN
        DBMS_JOB.SUBMIT( v_jobno,
                        'BEGIN <your module>; END;',
                        SYSDATE, NULL );
        COMMIT;
    END;
    /Kind regards,
    WoG

  • Dequeue from an exception queue

    Hi,
    I am very new to oracle AQ and trying dequeuing of message from an exception queue. I have created a procedure for dequeuing a message from exception queue and is working fine. I have to execute this procedure manually each time a message is moved to the exception queue. Is there any mechanism to call this procedure automatically each time the message is moved to exception queue? Please help.
    Thanks in Advance
    Lokesh

    Hello,
    as you wrote you already have a code snippet with DBMS_AQ.DEQUEUE of an exception queue.
    Wrap this DEQUEUE in an infinite loop (LOOP ... END LOOP). In order to have this procedure as an autonomous session
    you can start it as a database job:
    DECLARE
       v_jobno NUMBER(6);
    BEGIN
        DBMS_JOB.SUBMIT( v_jobno,
                        'BEGIN <your module>; END;',
                        SYSDATE, NULL );
        COMMIT;
    END;
    /Kind regards,
    WoG

  • Messages are in READY state in QUEUE TABLE but in AQ$ QUEUE TABLE messages are in PROCESSED State

    HI All,
       We create a brand new oracle multi-consumer queue. We have en-queued the messages into the queue and are processed successfully.
       But when we checked the STATE Column  of the messages in the queue table it was showing as "0". But it is showing as "PROCESSED" in the
       AQ$<QUEUE_TABLE> msg_state column.
      We are unable to figure out why there is a mismatch. Can any one help us ?
    Regards,
    Hari P.

    Hello,
    the column value AQ$<QUEUE_TABLE>.MSG_STATE = 'PROCESSED' corresponds to column value <QUEUE_TABLE>.STATE = 2
    (see definition of view AQ$<QUEUE_TABLE for the DECODE statement).
    In your case you see a value of STATE = 0 instead of STATE = 2. Is this correct ? The value 0 corresponds to a state "READY" (the delay
    is gone and the message is ready for dequeuing).
    The AQ documentation says: "After the specified delay, the message is in the READY state and available for dequeuing."
    Normally, you cannot see the processed data in your AQ because the enqueued data will be deleted after
    successful dequeuing. You wrote that they were processed successfully.
    Kind regards,
    WoG

  • Note:304522.1 How to Move Queue Tables without using export import

    Trying to use the pkg available in Metalink "Note:304522.1 How to Move Queue Tables without using export import"
    Using the 10.1.0.x and upwards Package, I'm getting the following error on a single consumer queue table with an xmltype payload:
    SQL> exec move_aqt.move('XFORM_TEST_INT','INTERFACE_XML_QUEUE','SMALLBLOCK');
    BEGIN move_aqt.move('XFORM_TEST_INT','INTERFACE_XML_QUEUE','SMALLBLOCK'); END;
    ERROR at line 1:
    ORA-20000: ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at "SYS.MOVE_AQT", line 652
    ORA-06512: at line 1
    We've tried in multiple environments, always with the same results.
    Trace file shows:
    *** 2006-11-08 10:06:47.154
    *** SERVICE NAME:(SYS$USERS) 2006-11-08 10:06:47.147
    *** SESSION ID:(379.954) 2006-11-08 10:06:47.147
    qtable move procedure starting execution at 08-11-2006 10:06:47 for queue table XFORM_TEST_INT.INTERFACE_XML_QUEUE
    qtable move procedure experienced an exception at 08-11-2006 10:06:47
    qtable move error message ORA-06502: PL/SQL: numeric or value error
    qtable move procedure ended execution at 08-11-2006 10:06:47
    Can anyone help with this? Has anyone used this before successfully (or not successfully). We urgently need this working today to test moving our queue table into a tablespace with a smaller block size for performance reasons in production.
    Thanks for the help!
    Tony

    Thank you,
    Yes we've done that. They've confirmed a problem with the links/scripts on the note. The 10.1 and up version was not really 10.1 and up.
    As they would not have a new version available in time for the move we needed to perform, we switched our approach to using dbms_redefinition instead.
    Thanks for the reply,
    Tony

  • Muti Consumer Queue creation

    Hi everyone,
    While creating multi consumer queue, I have encountered with below error:
    SQL> Begin
    2 DBMS_AQADM.Create_Queue_Table(Queue_Table => 'qtbl_NearTime',
    3 Queue_Payload_Type => 'NearTime',
    4 Sort_List => Null,
    5 Multiple_Consumers => True,
    6 Storage_Clause => 'TABLESPACE USERS');
    7 end;
    8 /
    Begin
    DBMS_AQADM.Create_Queue_Table(Queue_Table => 'qtbl_NearTime',
    Queue_Payload_Type => 'NearTime',
    Sort_List => Null,
    Multiple_Consumers => True,
    Storage_Clause => 'TABLESPACE USERS');
    end;
    ORA-08103: object no longer exists
    ORA-06512: at "SYS.DBMS_AQADM_SYS", line 2224
    ORA-06512: at "SYS.DBMS_AQADM", line 58
    ORA-06512: at line 2
    I am working with Oracle 9i. Please advice.
    Many thanks in advance.
    Prabha

    You'll have better-er luck in the AQ forum.
    Advanced Queueing

  • Select from a queue table with SYS.AQ$_JMS_MAP_MESSAGE type

    We are using the SYS.AQ$_JMS_MAP_MESSAGE type for our queue so that we can access the queue using plsql as well as java (via jms). The queue table that gets created contains a column user_data that is of the above type. This type has two columns BYTES_RAW and BYTES_LOB which I assume contains the data. Is there a way in sql (or in plsql) to get access to the data. Also, we are retaining the messages after they have been consumed (from an audit standpoint) and might need access to the data.
    Thank you
    Navin

    yes, i understand how to describe something...
    my question is how to get a list of properties.
    this data type has get functions that take the name of a property. now how do i know that property name to get it?

  • Consuming queue from multiple processes

    We have a program designed to consume a queue with consumer name set to "consumer". Here's how it dequeues messages:
    dequeue_options.consumer_name := 'Consumer';
    dequeue_options.navigation := DBMS_AQ.FIRST_MESSAGE;
    dequeue_options.WAIT := 10;
    DBMS_AQ.DEQUEUE(queue_name => 'ourschema.our_que',
    dequeue_options => dequeue_options,
    message_properties => message_properties,
    payload => message,
    msgid => message_handle);
    If we run one instance of this program this dequeue operation above uses 10 CPU seconds over the duration of our load test. If we run two instances of the program (which consumes the same queue as the same consumer) then the dequeue operation above uses 160 CPU seconds. We need the second instance to remove a single point of failure but the 16 fold increase in load on our database is not acceptable for a dequeue operation.
    Why is it so expensive to have two processes dequeuing from our_queue using the same consumer name?
    thanks
    Dale

    We managed to solve the problem.
    We had initiated a transaction to bracket the dequeue and a subsequent insert. Removing the transaction seems to have removed the performance hit from the second process.

Maybe you are looking for

  • Loop at Conditions within internal table

    I have not been ABAPing long so primarily have been using keyword help... I am trying to loop round an itab and only select and process unique keys from within the table! However the table I am using to obtain the records has multiple records with th

  • Hissing from high volume

    how do i get rid of hissing as if the volume is turned up high? and still keep the volume audible? what filter? thanks

  • Multiple Apple TV devices - Label on Remote app?

    I have several Apple TV devices on my home network & I use Apple Remote app on my iPhone. Is there any way of labelling the different Apple TV devices listed in Remote app since I am having to do guess work to find the one that works on the Apple TV

  • Applications do not open.

    any kind of applications (except for maps or itunes which are already there) do not open. whenever I click one of them, it seems to start for just a second and then closes up in that second. what should I do?

  • Album artwork problem--can anyone help?

    I have a wierd thing happening with my album artwork. All of the artwork is correct in ITunes, and the artwork appears correct when I hold my Itouch lengthwise. However, when I hold my Itouch vertically (i.e. with the button at the bottom) the album