AQ on RAC: Callback does not dequeue (sometimes)

Hi,
We've got the following problem on 11.2.0.3:
RAC consists of 2 instances.
The Queue Table is defined with primary instance set to 1.
On instance 1 parameter job_queue_processes is set to 10 - on instance 2 it is set to 0!
Queues defined on this Queue Table are dequeued via callback functions.
Normally every incoming messages should be dequeued automatically by the defined callback functions. But in our setup this does not seem to work: messages are regularly hanging with status READY and need a manual dequeue.
What's wrong with this setup? Why does this not work?
Thanks for any input,
Stephan

Hi,
You need to check if there is any inconsistency.
select count(*) from sys.aq_srvntfn_table n where n.user_data.msg_id in
(select n.user_data.msg_id msgid from sys.aq_srvntfn_table n minus select msgid from APP_SCHEMANAME.APP_QUEUE_TABLENAME)
and n.user_data.queue_name = '"APP_SCHEMANAME"."APP_QUEUENAME"';
Note : in 10.1 onwards, where the schema and queue name can be mixed case, that the query to identify the mismatch needs to reference the n.user_data.queue_name correctly by enclosing the APP_SCHEMANAME and APP_QUEUENAME in double quotes
If above returns any row:
ACTION PLAN:
This shows messages are in the notification queue but not in the user-created application queue.
For those msgids returned, manually dequeue these messages by specifying the message id from the notification queue : AQ_SRVNTFN_TABLE_Q (in versions below 11.2) or AQ_SRVNTFN_TABLE_Q_<N> (in versions starting 11.2). In doing this, we are removing the message in the notification queue which is not in the Application queue. This should allow the notification activity to move on. e.g.
set serveroutput on
declare
enqueue_options dbms_aq.enqueue_options_t;
message_properties dbms_aq.message_properties_t;
dequeue_options dbms_aq.dequeue_options_t;
message_handle raw(16);
mes aq$_srvntfn_message;
begin
  dequeue_options.wait := dbms_aq.no_wait;
  dequeue_options.consumer_name := '<consumer_name>'
  dequeue_options.msgid := '<msg id>';    -- <<< supply mesage id
  dbms_aq.dequeue(queue_name => 'AQ_SRVNTFN_TABLE_Q',   -- <<< as appropriate
  dequeue_options => dequeue_options,
  message_properties => message_properties,
  payload => mes,
  msgid => message_handle);
  dbms_output.put_line('removed: ' || message_handle);
  commit;
end;
It may be required to kill off the register driver jobs to restart the mechanism correctly after the queues have been reconciled and the above query returns 0 rows indicating queues are consistent. It  is also recommended to restart the database after this process has been completed before enqueueing further messages into the user-created application queue.
Note : you may need to specify a consumer_name in the above if the related queue is a multi consumer queue
Thanks,
Reena

Similar Messages

  • Registered callback does not dequeue messages in order

    PROCEDURE notifycb(
    CONTEXT IN RAW,
    reginfo IN SYS.aq$_reg_info,
    descr IN SYS.aq$_descriptor,
    payload IN RAW,
    payloadl IN NUMBER )
    AS
    no_messages EXCEPTION;
    PRAGMA exception_init( no_messages, -25228 );
    dequeue_options dbms_aq.dequeue_options_t;
    message_properties dbms_aq.message_properties_t;
    msgid RAW( 16 );
    message XMLTYPE;
    BEGIN
    dequeue_options.consumer_name := descr.consumer_name;
    dequeue_options.msgid := descr.msg_id;
    dbms_aq.dequeue(
    descr.queue_name,
    dequeue_options, message_properties,
    message, msgid );
    INSERT INTO xmltest
    ( create_ts, enqueue_time, xml )
    VALUES
    ( systimestamp, message_properties.enqueue_time, message );
    EXCEPTION
    WHEN no_messages
    THEN NULL;
    END;
    BEGIN
    dbms_aq.REGISTER(
    SYS.aq$_reg_info_list(
    SYS.aq$_reg_info(
    'Q_TEST:QUEUE_SUBSCRIBER',
    dbms_aq.namespace_aq,
    'plsql://QUEUE_OWNER.NOTIFYCB?PR=1',
    HEXTORAW( 'FF' )
    , 1 );
    END;
    DECLARE
    v_enqueue_options dbms_aq.enqueue_options_t;
    v_message_properties dbms_aq.message_properties_t;
    v_message_handle RAW( 16 );
    xml XMLTYPE;
    BEGIN
    FOR x IN 1 .. 10 LOOP
    SELECT XMLELEMENT( "x", x ) INTO xml FROM dual;
    dbms_aq.enqueue(
    queue_name => 'QUEUE_OWNER.Q_TEST',
    enqueue_options => v_enqueue_options,
    message_properties => v_message_properties,
    payload => xml,
    msgid => v_message_handle );
    END LOOP;
    COMMIT;
    END;
    select * from xmltest
    order by create_ts;
    16-JUN-08 04.04.27.065311000 PM 06/16/2008 08:04:20 PM <x>4</x>
    16-JUN-08 04.04.27.078027000 PM 06/16/2008 08:04:20 PM <x>3</x>
    16-JUN-08 04.04.27.155730000 PM 06/16/2008 08:04:20 PM <x>5</x>
    16-JUN-08 04.04.27.268137000 PM 06/16/2008 08:04:20 PM <x>6</x>
    16-JUN-08 04.04.27.357706000 PM 06/16/2008 08:04:20 PM <x>7</x>
    16-JUN-08 04.04.27.479633000 PM 06/16/2008 08:04:20 PM <x>8</x>
    16-JUN-08 04.04.27.577086000 PM 06/16/2008 08:04:20 PM <x>9</x>
    16-JUN-08 04.04.27.612511000 PM 06/16/2008 08:04:20 PM <x>10</x>
    16-JUN-08 04.04.27.979631000 PM 06/16/2008 08:04:20 PM <x>2</x>
    16-JUN-08 04.04.28.084615000 PM 06/16/2008 08:04:20 PM <x>1</x>

    The solution I found is to use a loop to dequeue messages in order, rather than by the supplied msgid, and to use DBMS_LOCK to prevent the callbacks from processing messages in parallel.
    create or replace PROCEDURE notifycb(
    context IN RAW,
    reginfo IN SYS.aq$_reg_info,
    descr IN SYS.aq$_descriptor,
    payload IN RAW,
    payloadl IN NUMBER )
    AS
    no_messages EXCEPTION;
    PRAGMA exception_init( no_messages, -25228 );
    dequeue_options dbms_aq.dequeue_options_t;
    message_properties dbms_aq.message_properties_t;
    msgid RAW( 16 );
    message XMLTYPE;
    lockhandle VARCHAR2(128) := NULL;
    lockstatus NUMBER;
    BEGIN
    dequeue_options.consumer_name := descr.consumer_name;
    dequeue_options.wait := dbms_aq.no_wait;
    dbms_lock.allocate_unique( 'NOTIFYCB_LOCK', lockhandle );
    lockstatus := dbms_lock.request( lockhandle, DBMS_LOCK.X_MODE, release_on_commit => TRUE );
    IF lockstatus != 0 AND lockstatus != 4
    THEN
    RETURN;
    END IF;
    BEGIN
    LOOP
    dbms_aq.dequeue(
    descr.queue_name,
    dequeue_options, message_properties,
    message, msgid );
    INSERT INTO xmltest
    ( create_ts, enqueue_time, xml )
    VALUES
    ( systimestamp, message_properties.enqueue_time, message );
    END LOOP;
    EXCEPTION
    WHEN no_messages
    THEN NULL;
    END;
    COMMIT;
    END;

  • The green button, top left corner of a pop-up screen on MACbook, it's supposed to enlarge the pop-up to full MAC screen size, correct?  Mine does not.  Sometimes it makes the pop-up screen SMALLER.  Appreciate someone solving this for me.

    the green button, top left corner of a pop-up screen on MACbook, it's supposed to enlarge the pop-up to full MAC screen size, correct?  Mine does not.  Sometimes it makes the pop-up screen SMALLER.  Appreciate someone solving this for me.

    Are you talking about the green '+' button in the top left corner? That technically doesn't enlarge it. It switches the window from the default window size to the custom size you made. You can enlarge the window by moving your mouse to the bottom right corner of the window, and dragging until you get the size you want.
              MacBook

  • Satellite A300 - keyboard does not work sometimes

    Hi,
    the boot my Toshiba Satellite A300 Notebook the keyboard does not work sometimes?
    After a reboot everything is ok!
    Does anyone know why the keyboard does not work sometimes?
    greetings

    Hello
    Do you notice the same behavior with external keyboard? So you can check if the problem is related to internal keyboard/mainboard or something else.
    But its not easy to say something about these sometimes issues But if the keyboard would be really defective I dont see a big problem. Exchange is not so complicated and keyboards are not expensive. ;)

  • App.launchURL does not open sometimes

    Hello everyone
    I need help with this problem, for some reason, in certain circumstances, Adobe Reader 8.1.3 with the button that runs the javascript:
    app.launchURL("http://...", true);
    is not open, no error throws to JS console, or anything ... you can press the button as many times as you want, it does not open.
    The odd thing is that sometimes works and sometimes not, with different instances of the same form PDF.
    PDFs forms are designed with Livecycle Designer ES 8.1 and saved as (Adobe dinamyc XML Form) finally the form are  passed  by ReaderExtensions (before delivery to user), so the user can fill in Reader.
    This happens only in the client's computer.
    Context where this occurs (corporate intranet):
    - Windows XP
    - Acrobat Reader 8.1.3
    - OfficeScan Antivirus
    It is possible that some other program or antivirus is blocking the opening of the new window may be why it happens randomly?
    Thx in advance

    Thats what I would suspect.
    Paul

  • Queue with callback function not dequeuing

    Hi,
    I would like to ask you for help or for a hint regarding our problem with the queue:
    A trigger is enqueuing to a queue. This works fine, but the callback function is never called. The queue already worked for a while, but since i changed something at the procedure called by the callback it does not work anymore.
    I already have tried the following:
    -Stopping and restarting
    -Dropping and recreating (with the scheduler having no jobs anymore)
    -Dropping, restarting the database and recreating
    None of these worked. Where do I fail, when considering that the queue with the same scripts worked already? I post the script for creating the queue and adding the subscriber:
    CREATE OR REPLACE TYPE pat_history_queue_payload_type AS OBJECT
    ( TSTAMP VARCHAR2(22 CHAR),
    TYP VARCHAR2(10 CHAR),
    DELTA_MENGE NUMBER,
    ORIGIN VARCHAR2(1 CHAR),
    TEXT VARCHAR2(1000 CHAR),
    QL_TSTAMP VARCHAR2(22 CHAR)
    BEGIN
    DBMS_AQADM.CREATE_QUEUE_TABLE (
    queue_table => 'pat_history_queue_table',
    queue_payload_type => 'pat_history_queue_payload_type',
    multiple_consumers => TRUE
    END;
    BEGIN
    DBMS_AQADM.CREATE_QUEUE (
    queue_name => 'pat_history_queue',
    queue_table => 'pat_history_queue_table',
    max_retries => 10
    DBMS_AQADM.START_QUEUE (
    queue_name => 'pat_history_queue'
    END;
    BEGIN
    DBMS_AQADM.ADD_SUBSCRIBER (
    queue_name => 'pat_history_queue',
    subscriber => SYS.AQ$_AGENT(
    'pat_history_queue_subscriber',
    NULL,
    NULL )
    DBMS_AQ.REGISTER (
    SYS.AQ$_REG_INFO_LIST(
    SYS.AQ$_REG_INFO(
    'pat_history_queue:pat_history_queue_subscriber',
    DBMS_AQ.NAMESPACE_AQ,
    'plsql://PAT.HISTORY_QUEUE_DISTRIBUTION.CALLBACK',
    HEXTORAW('FF')
    1
    END;
    The function CALLBACK which is called by the queue, is never called, I checked that with log messages. Also the package that contains the function is compiled ok.
    Thanks.
    Roland

    Hi,
    Does the subscription show up correct in sys.reg$ ?
    Regards,
    Harry
    http://dbaharrison.blogspot.com/

  • Problems with Tomcat Server : Does not respond (Sometimes) - Plz Need Help

    I have a web application running on Tomcat 4.1.31. (SUN/Solaris)
    Clients access through iPlanet Web Proxy (SUN/Solaris).
    Theres a class that build a generic form (it return html codes) then it's affected in the JSP page :
    MyClass class = new MyClass();
    <%= class.getHtmlCode() %>
    the size of the form is variable (100Ko to 1,5Mo)
    When i m using the proxy, sometimes the server does not respond when he do the affectation <%= class.getHtmlCode() %>.
    If i call the page without proxy it work.
    The problem seem not depending of the size of the form. Without proxy it always work. And with proxy sometimes the server does not work.
    Please need help

    Originally Posted by scum
    Hey All,
    Need some help with ZDM7 PXE preboot services.
    Currently running a netware 6.5 server in VLAN1
    PXE client sitting in VLAN2.
    DHCP Server is running on VLAN3
    IPHelper is running
    DTS.ini, PDHCP.ini and TFTP.ini are unmodified.
    I have had networks put an IPHelper in place and my client successfully picks up an IP address. The screen displays the "BOOT SERVER IP" correctly and the clients IP details are correct.
    I watch the top of the screen where the Timeout counts down and eventually gives this error.
    "Error: The server did not respond as requested in time
    ZENworks shutting down...
    Press any key to continue..."
    This happens on every machine i have tested. If i hold down the Ctrl+Alt keys, then the imaging menu appears, i can select maintenance and the client will pull down the initrd, etc.. fine.
    if i disable the IPHelper, move the client to the same VLAN as the server, then the whole process works perfectly.
    not sure where to go from here.
    help please ;)
    leon
    Hi Leon,
    If you are getting the ZENworks menu when holding down the Ctrl-Alt keys, PXE/PDHCP seems to be doing the right thing. Routing issues also don't seem the case as you can pull down the first PXE boot files....
    The server running PXE, I assume it also runs the TFTP and Imaging services?
    These services are also running a recent version of Zen 7 (IR3/IR4)? A little more info on these components and what server they are on would be good :)
    Cheers,
    Willem

  • EXCHANGE ACCOUNT ON MAC MAIL DOES NOT POPULATE SOMETIMES.  WHY??

    Since installing Mountain Lion on our computers (2) my exchange account for email does not populate everytime.  Sometimes it does and sometimes it does not. Why does this happen?  If I reboot or close mail and reopen it sometimes will populate.  But not always???  Why?

    Are you certain it is not a limitation with your SMTP-server? OR the receiving end of your larger-than-10MB message?
    Try and send a big one to yourself. If it doesn't work, try a free SMTP server.

  • Satellite U305-S7432 freezes and does not respond sometimes using Win XP

    Hello.
    I have a Satellite U305-S7432 notebook.
    Originally it came with Vista but I reformatted with XP Pro. I have installed all updates up to service pack 3.
    My problem is that sometimes when I try to restart the computer it simply freezes and does not respond at all to any input. I notice that this happens if I close and later open the lid (meaning that the computer goes input standby mode and comes back).
    Please note that the standby mode works perfectly fine and the computer leaves standby fine but afterwards when I try to restart, the computer will simply hang instead of restarting.
    If it never enters standby mode, the restart takes place as expected.
    I have installed all drivers and there are no question marks in Device Manager. I updated to the latest chipset driver from Intel (for the mobile 965) as well. Lastly, I also tried adding /forceresetreg to my boot.ini (as suggested by: http://support.microsoft.com/kb/822624) but to no avail.
    Any ideas?

    This is a Toshiba US notebook series and you should check the Toshiba US driver page for available drivers:
    http://www.csd.toshiba.com/cgi-bin/tais/su/su_sc_home.jsp
    If you will not find the XP drivers at this page then you could try to install some single drivers for Sat U300 from the Toshiba European page but Im not quite sure if such XP drivers will run on you Sat U305. But its worth a try!
    Good luck

  • ITunes 7.0.2 does not play sometimes

    Hello,
    Today I had a problem with iTunes 7.0.2 after security update nr. 8:
    iTunes opens but if I want to play anything (Podcast, mp3, aac, ...) the play symbol moves to the "Pause" sign but it does not play - the clock stays at 0:00 and does not move.
    Opening the file with Quicktime from finder "plays" but no audio signal is produced.
    After logout and login, the clock starts but there is also no audio signal produced from iTunes.
    After doing the "Windows" solution (rebooting again) all seems to be OK (iTunes works again) but I have a bad feeling about this. Has anyone similar problems or can point to the failure reason?
    MacBook Pro 2,33 Ghz   Mac OS X (10.4.8)   2 GB RAM

    Same Problem with 4GB HP Ipod mini. Summary tab doesn't show up after connecting thru USB. Same on another PC I have with latest iTunes 7. I can copy and delete to the IPOD through My Computer. Another video iPod works fine....Anyone know where to ship for service?

  • CSCui26960 - jabberLocalConfig.xml does not exist sometimes - 1

            Last August this bug had a fix targeted for 9.6  Then the 9.6 bug fixes came out in October and this was not in there.  But the BUG ID still says it is fixed but no workaround provided or version where it is fixed.
    This is an increasing issue for our HCS customers.  What's the story?  When is it fixed?  Is there a aworkaround?

    I am not looking at 9.2.6 information.
    I am in the 9.6 EFT and they gave us the XLS of bugs fixed in 9.6  This bug was not on it.  So I went back to the bug tool and saw that on Nov 20th they removed the information on the "Fixed In" section.  Now it does not show anything.
    Can you please get somone to update that bug ID so I can show it to my customer?  right now they are furious that it was set to be fixed and is now empty.

  • Red track button and mouse does not work sometimes on start up and after stand by mode

    i recently downgraded my t61p from vista basic to xp pro.  all the drivers were installed but my mouse doesn't seem to work consistently.  if i turn it on, sometimes it doesnt move -- i then have to hit standby and see if it works after that..  sometimes it does
    also, if leave my computer on for a while -- it doesnt properly work then either
    any suggestions?  i've tried re-installing the drivers but doesnt do much.  
    any help is much appreciated.  thanks.  

    Hello,
    have you installed all recent windows updates like SP3?
    What kind of mouse are u using?The normal ultranav on your TP or a third party mouse? Bluetooth or cable?
    Some bluetooth mice are disconnecting after some time, also your USB port, when on battery can switch off to save energy.
    Greets
    Message Edited by Agotthelf on 09-06-2008 10:23 AM
    Follow @LenovoForums on Twitter! Try the forum search, before first posting: Forum Search Option
    Please insert your type, model (not S/N) number and used OS in your posts.
    I´m a volunteer here using New X1 Carbon, ThinkPad Yoga, Yoga 11s, Yoga 13, T430s,T510, X220t, IdeaCentre B540.
    TIP: If your computer runs satisfactorily now, it may not be necessary to update the system.
     English Community       Deutsche Community       Comunidad en Español

  • Why key creator callback does not run?

    Hi, I'm completely new to berkeley db. I encounter a problem: I created a secondary database, however it's empty all the time. I finally realized that the key creator callback function passed in the "associate" function seemed not been called.
    What might be the reason?
    Thanks in advance.

    The callback is called in two situations:
    * if the secondary is empty and the DB_CREATE flag is passed to DB->associate, the callback is called repeatedly to populate the secondary; or
    * when the primary is updated after a DB->associate call, the callback is called (possibly several times per update) to keep the secondary consistent with the primary.
    If this is not occurring, please give more detail of what you are doing (when you call DB->associate, what kinds of operations you are performing on the primary, and what the callback is doing to generate secondary keys).
    Regards,
    Michael.

  • The touchscreen does not response sometime

    1)Get no response from the touchscreen when I tried to use it on the plane, I couldn't even shut it down.
    2)Many times on land, no response or false functioning on touchscreen, even after restart.

    The only time that I have had a problem with the touch screen not responding is when I have done a number of things in a short period of time or that appear to be interacting with the wireless features. For example, sometimes when I am in email and I am deleting a bunch of messages, after deleting a list of them the phone will stop responding and no matter how much I hit delete on the next message nothing happens. I have just taken that to mean that the software is just still doing something in the background and I may have maxed out the internal memory capability for that moment. It generally takes a few seconds and then the phone will start responding again.
    Also, every once in awhile in Google maps using Edge, sometimes I am asking it to do something else before the prior request has completed and it is like it is still trying to catch up with the last thing I requested. However, I haven't taken either of those instances to mean anything different than when I've maxxed out the internal RAM on my computer momentarily by being impatient and trying to do to many things concurrently or when I've tried to move to a new Internet site before the last one has completely loaded so that I have had to do a refresh. Unless I am missing some greater technical problem neither of those have struck me as anything out of the ordinary from what you experience periodically on a normal computer.
    Message was edited by: redxk8

  • PDF does not deliver sometimes with Mac mail even though it shows in my sent mailbox

    Sometime when I attach a PDF I'm mail on my MacBook Pro the email delivers without the PDF even though it shows in my sent mail.
    This happens with 2 different mail boxes, one being pop3 and the other mail for exchange..
    I had to eventually install outlook which I've never had a problem
    I prefer not to use any Microsoft products

    HI,
    The PDF, which is probably being sent as an attachment, maybe larger than the Outgoing Mail server will allow.
    9:09 PM      Saturday; May 4, 2013
      iMac 2.5Ghz 5i 2011 (Mountain Lion 10.8.3)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
     Couple of iPhones and an iPad
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

Maybe you are looking for