Can't Seem to Get my Event Based Job To Execute

What makes this slightly different than other posts on this topic is that we want to use our own queue/payload object rather than the built-in SCHEDULER$_EVENT_QUEUE. There are many reasons for this. What follows in under 11gR2 (11.2.0.3)
So, the following code blocks are just for a proof of concept piece intended to create a simple job and to have it fired based on the arrival of a message in a queue. (Something we have a requirement to do) The issue that I just can't seem to resolve is that, for some reason, the scheduler object never triggers the job. I can't find any trace or alert log entries to help me diagnose. What I do know is that the queue itself is fine (dequeues and enqueues work normally). The object payload type is fine (All of these tested from the EVENT_JOB_MGR package provided below).
Here's the PL/SQL Type that is the payload object of the queue and is also referenced in the package:
CREATE OR REPLACE TYPE RUN_MSG AS OBJECT
  STATUS VARCHAR2(255)
Here are the queue and queue table:
BEGIN
  DBMS_AQADM.CREATE_QUEUE_TABLE
    QUEUE_TABLE           =>        'JUPSHAW.EVENT_JOB_QT'
   ,QUEUE_PAYLOAD_TYPE    =>        'JUPSHAW.RUN_MSG'
   ,COMPATIBLE            =>        '10.0.0'
   ,STORAGE_CLAUSE        =>        '
                                     TABLESPACE RISKDM_DATA'
   ,SORT_LIST             =>        'ENQ_TIME'
   ,MULTIPLE_CONSUMERS    =>         TRUE
   ,MESSAGE_GROUPING      =>         0
   ,SECURE                =>         FALSE
End;
BEGIN
  DBMS_AQADM.CREATE_QUEUE
    QUEUE_NAME          =>   'JUPSHAW.EVENT_JOB_Q'
   ,QUEUE_TABLE         =>   'JUPSHAW.EVENT_JOB_QT'
   ,QUEUE_TYPE          =>   SYS.DBMS_AQADM.NORMAL_QUEUE
   ,MAX_RETRIES         =>   0
   ,RETRY_DELAY         =>   0
   ,RETENTION_TIME      =>   -1
END;
DECLARE
  aSubscriber sys.aq$_agent;
BEGIN
  aSubscriber := sys.aq$_agent('SCHEDULER$_EVENT_AGENT',
                              0);
  dbms_aqadm.add_subscriber
     ( queue_name     => 'EVENT_JOB_Q'
      ,subscriber     => aSubscriber);
END;
BEGIN
  SYS.DBMS_AQADM.START_QUEUE
    QUEUE_NAME => 'JUPSHAW.EVENT_JOB_Q'
   ,ENQUEUE => TRUE
   ,DEQUEUE => TRUE
END;
(I think the scheduler automatically added itself as a subscriber (see above) after the queue itself was created)
So, here's the simple package:
CREATE OR REPLACE PACKAGE EVENT_JOB_MGR
AS
    PROCEDURE DEQUEUE_JOB_STATUS_MSG;
    PROCEDURE ENQUEUE_JOB_STATUS_MSG;
    PROCEDURE RECORD_DEQUEUED_STATUS( a_RunMsg  RUN_MSG );
END EVENT_JOB_MGR;
CREATE OR REPLACE PACKAGE BODY EVENT_JOB_MGR
AS
    PROCEDURE RECORD_DEQUEUED_STATUS( a_RunMsg  RUN_MSG )
    IS
        ls_Status       VARCHAR2(32);
    BEGIN
        ls_Status := a_RunMsg.STATUS;
        INSERT INTO DEQUEUE_RECORD
        ( STATUS )
        VALUES
        ( ls_Status );
        COMMIT;    
    END;       
    PROCEDURE DEQUEUE_JOB_STATUS_MSG
    IS
        l_DeQOptions    DBMS_AQ.DEQUEUE_OPTIONS_T;
        l_MsgProps      DBMS_AQ.MESSAGE_PROPERTIES_T;
        l_DeQMsgID      RAW(16);
        l_RunMsg        RUN_MSG;                
    BEGIN
        l_DeQOptions.CONSUMER_NAME := 'EVENT_JOB';
        DBMS_AQ.DEQUEUE(    queue_name          =>  'EVENT_JOB_Q',
                              dequeue_options     =>  l_DeQOptions,
                              message_properties  =>  l_MsgProps,
                              payload             =>  l_RunMsg,
                              msgid               =>  l_DeQMsgID );
        COMMIT;                             
        RECORD_DEQUEUED_STATUS( l_RunMsg );                              
    END;
    PROCEDURE ENQUEUE_JOB_STATUS_MSG
    IS
        l_EnQOptions    DBMS_AQ.ENQUEUE_OPTIONS_T;
        l_MsgProps      DBMS_AQ.MESSAGE_PROPERTIES_T;
        l_EnQMsgID      RAW(16);
        l_RunMsg        RUN_MSG;               
    BEGIN   
        l_RunMsg := RUN_MSG('Success');
        DBMS_AQ.ENQUEUE(  QUEUE_NAME          =>  'EVENT_JOB_Q',
                            ENQUEUE_OPTIONS     =>  l_EnQOptions,
                            MESSAGE_PROPERTIES  =>  l_MsgProps,
                            PAYLOAD             =>  l_RunMsg,
                            MSGID               =>  l_EnQMsgID);
    END;
END EVENT_JOB_MGR;
-- Finally the program, schedule and job
BEGIN
    DBMS_SCHEDULER.CREATE_PROGRAM(
        PROGRAM_NAME          => 'EVENT_JOB_PROG',
        PROGRAM_ACTION        => 'EVENT_JOB_MGR.RECORD_DEQUEUED_STATUS',
        PROGRAM_TYPE          => 'STORED_PROCEDURE',
        NUMBER_OF_ARGUMENTS   => 1,
        ENABLED               => FALSE );
    DBMS_SCHEDULER.DEFINE_METADATA_ARGUMENT (
        program_name        => 'EVENT_JOB_PROG',
        argument_position   => 1,
        metadata_attribute  => 'EVENT_MESSAGE' );  
    DBMS_SCHEDULER.ENABLE( NAME => 'EVENT_JOB_PROG');        
EXCEPTION
  WHEN OTHERS THEN RAISE ;       
END;
COMMIT
BEGIN
  DBMS_SCHEDULER.CREATE_EVENT_SCHEDULE (
   schedule_name     =>  'EVENT_JOB_SCHED',
   start_date        =>  SYSTIMESTAMP,
   event_condition   =>  'TAB.USER_DATA.STATUS = ''SUCCESS''',
   queue_spec        =>  'EVENT_JOB_Q');
END;
BEGIN
  DBMS_SCHEDULER.CREATE_JOB (
   job_name            =>  'EVENT_JOB',
   program_name        =>  'EVENT_JOB_PROG',
   schedule_name       =>  'EVENT_JOB_SCHED',
   enabled             =>  TRUE,
   comments            =>  'Start if you get a success message');
END;
I call the ENQUEUE_JOB_STATUS_MSG method to stick a message on the queue. I can confirm that it can be dequeued and logged using the DEQUEUE_JOB_STATUS_MSG method in the package. However, nothing seems to happen (at all) as far as the scheduler job when a message is put on the queue. I am thinking it should dequeue the message with status set to SUCCESS and then, kick off the job.
Can anyone see why the above wouldn't work? Been stuck here for a couple of days.
Thanks,
-Joe

Try to create job that react on event directly not using schedule.
BEGIN
    dbms_scheduler.create_job(job_name => 'EVENT_JOB',
                              program_name =>  'EVENT_JOB_PROG',
                              event_condition => 'TAB.USER_DATA.STATUS = ''SUCCESS''',
                              queue_spec => 'EVENT_JOB_Q',
                              enabled => true,
                              auto_drop => FALSE);
END;
Check if your schedule EVENT_JOB_SCHED is enabled

Similar Messages

  • I can't seem to get calendar events created on my iphone to syc to the icloud calendar

    I am using an iPhone 4 and all of a sudden, I can't get my calendar events on my phone to up sync to the icloud.  Contacts work great from phone to cloud..but events don't work at all.
    Help!

    First check that all your settings are correct, that calendar syncing is checked on all devices (system preferences > iCloud on a mac and settings > iCloud on a iPhone, iPad or iPod).
    Make sure the calendars you are using are in your 'iCloud' account and not an 'On My Mac', 'On My Phone' or other non iCloud account (you can do this by clicking/tapping the calendar button in the top left corner of the application ), non iCloud calendars will not sync.
    If you are sure that everything is set up correctly and your calendars are in the iCloud account, you might try unchecking calendar syncing in the iCloud settings, restarting your device and then re-enabling calendar syncing settings.

  • I just purchased a Brother MFC-9340CDW all in one printer.  It shows up on a list of compatable airprint devices but I can't seem to get it to work.  Any suggestions?

    I just purchased a Brother MFC-9340CDW all in one printer.  It shows up on a list of compatable airprint devices but I can't seem to get it to work.  Any suggestions?

    Hi,
    It won't work with airplay, here is how I got it to work with OSX 10.9.4 fully patched;
    you will need to use the serial cable to start the process:
    In-brief Version:
    0) Go grab the firmware update tool, the driver, and the scanner software
    1) Turn off the firewall and antivirus (if you use it ??)
    2) Update the firmware using the serial line
    3) Reserve a static IP outside the DHCP range (using the MAC address of the printer) on your WAP server
    4) Configure the printer to use a static IP through the front panel
    5) Configure the printer WIFI with your SSID and net key through the front panel
    6) Install the CUPS driver on your computer through the printer settings by specifying the static IP
    7) Install the Scanner driver then go into the Control Center and add you computer and printer configuration
    I generally use this kind of set up so that the printer comes back at the same place after a power failure in
    the event that it has a crappy driver.
    For those of you who need a little more help:
    0) Turn off anti-virus and firewall software (it did seem to matter)
    1) Go to the Brother Center and download 1) The firmware update tool, 2) the driver, 3) the scanner software
    2) Go to the front panel on the printer: tools -> all settings -> network -> tcp/ip -> WLAN ; find the MAC address and write it down
    3) Plug the printer in using the serial cable, it will auto detect and you will be able to talk to it.
    4) Install the firmware update tool by double clicking on the dmg you downloaded
    5) Update the firmware and the subfirmware (NOTE: this is a bit finicky -- you may have to unplug and replug it in a couple of times before it starts to talk with the device, after it starts the update process it frequently gives up in the middle, DO NOT unplug the device at this point, just select "retry" from the dialog and it will continue -- it will take about 15 mins or so.
    6) Once the firmware is installed, go to your WAP server and look at the DHCP IP range; typically something like 10.0.1.2 to 10.0.1.200
    7) If there is a capability to reserve an IP on your WAP server pick an IP outside the range in 6 (e.g. 10.0.1.201) and use the MAC address (from step 2) for the reservation... its fine if you don't reserve it -- this is an extra precaution -- just make sure you pick an IP outside the DHCP range
    8) Go to the front panel on the printer: tools -> all settings -> network -> tcp/ip -> WLAN ; then set the IP address:
         boot method: static
         IP address: the address you chose in 7)
         mask: 255.255.255.0
         gateway: the IP of your router -- typically 10.0.1.1
    8) Go to the front panel on the printer: tools -> wireless -> setup wizard -> let it find your network, select it, and enter your key.
    9) Reboot the printer and check it connects to your wireless network
    10) Go to the front panel on the printer, tools -> all settings -> print reports -> network configuration ; print the report and check the IP and MAC
    are what you think they should be.
    11) Go to your computer, bring up a terminal (applications->utilities->terminal)
    12) Ping your printer to make sure its up and accessible -- type: "ping 10.0.1.201" (or whatever IP you used in step 7) and check you get a response -- not a timeout -- if it works disconnect the serial line and delete the (serial line) printer from the list of printers  -- you won't need it anymore -- if not you screwed up somewhere along the line
    13) Now the printer is on the wireless network, install the driver by double clicking the dmg. Then go to system preferences->printers & scanners
         click +
         in the add menu click IP
         enter your IP (from step 7)
         make sure the Protocol is IPP
         Name the printer and set its location
         Go to Use field, in the pull down menu select "Select Software"
         Go through the list and find the Brother MFC-9340CDW CUPS driver -- if its not there you screwed up installing it so go do it again.
    14) Go back to the printer page -- select the printer, select Open Print Queue, then select Settings -- check the Driver Version is 4.1.0 -- if
    it says 2 you are using the airplay version which seems to be buggered -- so you need to try again.
    15) Go open a word document and print it -- smile you are nearly there
    16) Install the scanner software by double clicking the dmg
    17) Open the Control Center, under the Model: select Other
         Click +
         Select your printer
         Enter your computer name in the display name and click ok
    18) Go into adobe Acrobat File->Create->PDF from Scanner (or whatever software you are scanning with)
    19) Select "Brother TWAIN" from the scanner list -- if its not there you screwed up the scanner software installation -- go do it again
    20) Put a document in the top of the printer and press scan -- wammo !
    21) Turn back on your firewall (and antivirus if you have it -- why I can't imagine but what the ****)
    22) Go ping the printer and make sure its still reachable (see step 12) -- if not you need to figure out what your antivirus is screwing up because the firewall is no problem
    23) try printing and scanning again...
    24) rejoice... your done.

  • I can't seem to get the iTS to update the description of my podcast, nor refresh to show new episodes?

    I recently launched a podcast series (http://itunes.apple.com/ca/podcast/notes-from-northwest-passage/id449063851) but its still showing an older description text with some typos and an incorrect link in it, as I registered it with a pre-edited file so it would be in line for review while I finalized the details, and now I can't seem to get it to refresh and show the new texts at all, even though I edited the description texts in the xml file well over 2-3 weeks ago.
    I've tried redoing this file several times.  It always validates but changes never get picked up by the iTunes store.I can manually subscribe to the feed using iTunes' advanced menu, with no problems. The feed is at:
    http://a4.g.akamai.net/7/4/66750/v1/smb2.download.akamai.com/66750/http/podcasts /archaeology2011/arcticarchaeology2011_eng.xml
    I recently (about 3-4 days ago) tried redirecting the feed to a new version of the xml file stored in a new folder, just to see if that would somehow jolt it back into reading it, but again after 3-4 days it hasn't done anything.
    It's also not showing any of the most recent episodes even though they have all been there about a week, so the store should have picked them up by now, no?
    Any suggestions?

    If you look at the feed, and look at the entry 'The end to an exciting field season in Aulavik National Park' you will see the line:
    <pubDateFri, 29 Jul 2011 04:00:00 GMT</pubDate>
    You have not closed the 'pubdate' tag - there should be a '>' as the 9th character. Because the tag has been left open, it invalidates everything which follows it, and thus the entire feed. iTunes therefore cannot read it, which is why the Store has not updated. Add the '>' and republish, and all should be well.
    It's always worth checking your feed by subscribing manually, from the 'Advanced' menu, or by clicking the 'subscribe free' button on the Store page (both do the same thing) - if you can subscribe to the feed it should be OK.

  • I am using an iPad and iPhone and have exchange as my email. Both will only collect mails when I am in the wifi of the office, and not when I am out and about. I can't seem to get a fix for it.

    I am using an iPad and iPhone and have exchange as my email. Both will only collect mails when I am in the wifi of the office, and not when I am out and about. I can't seem to get a fix for it.

    This - https://support.mozilla.org/en-US/kb/how-make-web-links-open-firefox-default - didn't work?

  • I can't seem to get my iMac (late 2009 model) into automatic sleep mode.  If I manually put it into sleep I don't have any issues.  I used to solve the issue by running "PleaseSleep" application but that doesn't work anymore since Lion.

    I can't seem to get my iMac (late 2009 model) into automatic sleep mode.  If I manually put it into sleep I don't have any issues.
    I used to solve the issue by running "PleaseSleep" application but that doesn't work anymore since Lion. I now want to fix the underlying problem.
    I'm not running any weird background processes and in my energy saver settings I've tagged "put the hard disk to sleep when possible:, "allow power button to put computer to sleep" and "automatically reduce brigthness". All pretty standard.
    Is there anyone who can give me some pointers ?

    Today I solved the same problem for my iMac running Snow Leopard. See https://discussions.apple.com/thread/3008791#15947706. The method may help you, too.
    For me it was the DynDNS Updater preventing my iMac from automatically entering sleep mode.
    To my knowledge the cause of this sleep problem can only be a peripheral device or a process. So I suggest to first unplug all peripherals and test whether that's the cause. If not, I suggest to terminate one process after another and to test automatic entering of sleep mode after each. Start with user processes; continue with system process if necessary.
    At least that's the way I found the offending process. Fortunately, I was able to change the configuration of that process to allow again automatic entering of sleep mode.
    Good luck!

  • HT3500 I have a MacBook Pro and an HP ENVY 110 SERIES All-In-One .  I can't seem to get a network set up or either one to locate or connect to the other one.

    I've spent hours, actually probably days, trying to do this but it's not working. I've had the ENVY since Nov
    and have not been able to print - much less do anything else with it.
    My internet is CLEAR wireless. I use the little USB 4G Mobil Modem. This new HP ENVY is also wireless.
    I know I can't be online and print at the same time unless I get a router.
    I also know that I can go offline and change the network pref  to "airport" so I can print. Meaning I'll have to change
    back and forth but for my uses,  that's ok..at least for right now.
    What I can't seem to get set-up correctly is my own local network.
    I'm pretty sure it's suppose to be done using "Airport".
    Obviously, I'm doing something wrong in establishing my network.
    The printer is listed on my printer preferences and shown as  "offline"  "default". I assume that means the ENVY
    is my default printer.  Great! At least my Pro knows it's suppose to connect to the ENVY once everything's set-up correctly.
    Now, if someone could just tell me exactly, step-by-step what to do to get that done....
    I'd be soooo very happy!
    Thank you!
    Ricki

    Well... no help was found here.. so I abandoned the wireless- ness of my printer.  I bought a
    small 10 port hub because only 2 USB ports really isn't enough with wireless mouse, wireless internet
    and any kind of printer.   I also bought a long USB cable.  I now print--wired since this can be done
    as an alternative to wireless with this printer.   Because I don't want a cable "hanging around"
    when the printer is not in use, I simple disconnect it and reconnect when I want to print.
    It's a temporary solution others may find helpful as well. Apparently there's been a lot of
    confusion and problems getting this printer set up wirelessly with our MacBooks.
    Shame on HP for not helping us out!

  • I have an ipod touch and it is locked and i can't seem to get into it. what can i do to unlock it?

    i have an ipod touch and it is locked and i can't seem to get into it. what can i do to unlock it?

    You have to input your Apple ID in the prompt when it pops up

  • I have powerpoint for Mac on my imac.  I can't seem to get the active text box function to work like it did on my PC.  How can I insert an active textbox into a presentation that will allow me to type while presenting?

    I have powerpoint for Mac on my imac.  I can't seem to get the active text box function to work like it did on my PC.  How can I insert an active textbox into a presentation that will allow me to type while presenting?

    I've gotten a little further on this. The dynamic select is
    working fine. It's the "a href" code that isn't. I'm wondering if
    someone can look at this line and tell me if it's okay to build the
    query string this way. The storeid comes through fine but I'm still
    not getting the employeeid value to pass. Here's line that's not
    working:
    td><a href="registerStoreCust.php?storeid=<?php echo
    $row_storeRS['storeid']; echo "&employeeid="; echo
    $_GET['employeeLM']; ?>">Register
    Customer</a></td>

  • I can't seem to get GB to recognize my Behringer X1222 USB Mixer. It will record, but shouldn't I be able to see and/or select which input channel(s) that I will record from? Can I record more than one channel at a time, and record multi tracks?

    I can't seem to get GarageBand to recognize my Behringer X1222 USB Mixer. It will record, but only on the generic "USB Input, without seeing or letting me select the input channel from the mixer. Can't find any drivers from Behringer. How do I getGB to "see" the mixer? Thanks, I'm a newbie to Macs in genreal, and recording...

    viiram wrote:
    It will record, but only on the generic "USB Input, without seeing or letting me select the input channel from the mixer.
    the x1222 includes a 2 channel audio interface, 2 channels are all you can get from it.
    the most you can do is record to 2 tracks at a time; skim this tute to see how:
    http://www.bulletsandbones.com/GB/Tutorials.html#allaboutrecording2tracks
    (Let the page FULLY load. The link to your answer is at the top of your screen)

  • On my ipod touch, i can't seem to get the imessage app.. I have updated my itunes and even restored the ipod to factory settings with the latest update. Maybe the ipod is too old? Help

    On my ipod touch, i can't seem to get the imessage app.. I have updated my itunes and even restored the ipod to factory settings with the latest update. Maybe the ipod is too old? Is that even a thing? Is there another app I can download to have access to my contacts with imessage?

    That comes with iOS 5 (Settings>General>About>Version) and only the 3G abd later iPods can go to iOS 5 or later
    Identifying iPod models

  • HT201365 Just dowloaded the new ios 7, and i can't seem to get any apps to download in the app store. It doesn't have the meter bar anymore and all it does is have a Blue circle spin and spin for over 5 or 10 min. without nothing happening! Help !!!

    Just downloaded the new ios 7, and I can't seem to get any apps to download in the app store. It doesn't have the meter bar anymore and all it does is have a blue circle spin and spin for over 5 min. without nothing happening! Help!!!

    Hi,
    This is how App Store app shows now when an app is downloading. If you cannot download anything, go to Settings > iTunes & App Store, remove your Apple ID, and set it again. That should work.
    Hope that helps.

  • HT4623 I can't seem to get my keypad shortcuts to work on my iphone 4 after the ios6 update.  Anyone have a fix for this??  Apple???

    I can't seem to get my keypad shortcuts to work on my iphone 4 after the IOS 6 update.  Anyone have a resolution for this???  Apple???

    Unless Verizon has a special provision in this regard that ATT has never had, Apple handles all iPhone repairs and exchanges under Apple's warranty.
    There is a setting when capturing photos - Automatic, On, or Off for the flash when capturing photos.
    If there is no flash when set to On or Automatic in a dark setting and no change after the standard troubleshooting steps which in order are:
    Power your iPhone off and on.
    An iPhone reset.
    Restoring your iPhone with iTunes from the backup.
    Restoring your iPhone with iTunes as a new iPhone or not from the backup.
    Your iPhone has a hardware problem. You can call AppleCare or make an appointment at an Apple store if there is one nearby.

  • I can't seem to get my iPod touch (4th Gen) to play photo slideshows or videos through my TV.  Is this a design flaw?  Or is it me?  My old iPod used to do it no problem, but now I can't even find any video out options in the settings.

    I can't seem to get my iPod touch (4th Gen) to play photo slideshows or videos through my TV.  Is this a design flaw?  Or is it me?  My old iPod used to do it no problem, but now I can't even find any video out options in the settings.

    This cable And Im using a cable that has a headphone jack on one end and RCA cables on the other. does not work for iPod touches. See:
    http://support.apple.com/kb/HT1454

  • Hi, I can't seem to get my ipod 32gb 4th gen to sync with itunes. It's brand new, but everytime I plug it in it says can't access Itunes store and nothing else happens. I enabled my firewall to allow itunes but it still can't access it. Please help.

    Hi, I can't seem to get my ipod 32gb 4th gen to sync with itunes. It's brand new, but everytime I plug it in it says can't access Itunes store and nothing else happens. I enabled my firewall to allow itunes but it still can't access the store. Please help.

    If you look at the feed, and look at the entry 'The end to an exciting field season in Aulavik National Park' you will see the line:
    <pubDateFri, 29 Jul 2011 04:00:00 GMT</pubDate>
    You have not closed the 'pubdate' tag - there should be a '>' as the 9th character. Because the tag has been left open, it invalidates everything which follows it, and thus the entire feed. iTunes therefore cannot read it, which is why the Store has not updated. Add the '>' and republish, and all should be well.
    It's always worth checking your feed by subscribing manually, from the 'Advanced' menu, or by clicking the 'subscribe free' button on the Store page (both do the same thing) - if you can subscribe to the feed it should be OK.

Maybe you are looking for