DBMS_SCHEDULER.run_chain() only works when connected to DB as sys

Database Version: 10.2.0.4.0
Hello,
I have a problem with DBMS_SCHEDULER.run_chain where the Chain to be run references an external Program.
The Chain runs correctly when run via SQLPLUS when you are connected to the database as SYS but fails to run when you are connected to the Database as the User who owns the Chain.
The complete steps to recreate the problem are below. Any thoughts or suggestions gratefully received.
Thanks,
Andy
STEP 1: Login with sys as sysdba and create a new user
CREATE USER chaintest IDENTIFIED BY password PROFILE DEFAULT ACCOUNT UNLOCK;
GRANT MGMT_USER TO chaintest;
GRANT CONNECT TO chaintest;
GRANT IMP_FULL_DATABASE TO chaintest;
GRANT SCHEDULER_ADMIN TO chaintest;
GRANT MANAGE SCHEDULER TO chaintest;
GRANT EXECUTE ANY CLASS TO chaintest;
GRANT CREATE ANY DIRECTORY TO chaintest;
GRANT CREATE ANY JOB TO chaintest;
GRANT CREATE TABLE TO chaintest;
GRANT EXECUTE ANY PROGRAM TO chaintest;
GRANT CREATE JOB TO chaintest;
GRANT CREATE EXTERNAL JOB TO chaintest;
STEP 2: Create a very simple batch file
Create a folder called c:\chaintest and create a text file in there whose entire contents
is "notepad.exe" followed by a carriage return. The idea is that if this batch file is
called a notepad Window will be opened so we can clearly see if the batch file has run.
STEP 3: Create a DBMS_SCHEDULER Program
BEGIN
DBMS_SCHEDULER.CREATE_PROGRAM (
program_name => 'CHAINTEST.CHAINTEST_PROGRAM',
program_type => 'EXECUTABLE',
program_action => 'C:\WINDOWS\SYSTEM32\CMD.EXE /q /c c:\chaintest\chaintest.bat',
number_of_arguments => 3,
enabled => false);
DBMS_SCHEDULER.define_program_argument(
program_name =>'CHAINTEST.CHAINTEST_PROGRAM',
argument_position => 1,
argument_type => 'VARCHAR2',
default_value => '/q');
DBMS_SCHEDULER.define_program_argument(
program_name =>'CHAINTEST.CHAINTEST_PROGRAM',
argument_position => 2,
argument_type => 'VARCHAR2',
default_value => '/c');
DBMS_SCHEDULER.define_program_argument(
program_name =>'CHAINTEST.CHAINTEST_PROGRAM',
argument_position => 3,
argument_type => 'VARCHAR2',
default_value => 'c:\chaintest\chaintest.bat');
DBMS_SCHEDULER.enable('CHAINTEST.CHAINTEST_PROGRAM');
END;
STEP 4: Create a chain
BEGIN
DBMS_SCHEDULER.CREATE_CHAIN (chain_name => 'CHAINTEST.CHAINTEST_CHAIN');
END;
STEP 5: Create the only Chain Step
BEGIN
DBMS_SCHEDULER.DEFINE_CHAIN_STEP(chain_name=>'CHAINTEST.CHAINTEST_CHAIN'
, step_name=>'STEPA'
, program_name=>'CHAINTEST.CHAINTEST_PROGRAM');
END;
STEP 6: Create Chain Rules
BEGIN
DBMS_SCHEDULER.DEFINE_CHAIN_RULE(
chain_name=>'CHAINTEST.CHAINTEST_CHAIN'
, condition=>'TRUE'
, action=>'START STEPA');
DBMS_SCHEDULER.DEFINE_CHAIN_RULE(
chain_name=>'CHAINTEST.CHAINTEST_CHAIN'
, condition=>'STEPA COMPLETED'
, action=>'END');
END;
STEP 7: Enable the Chain
BEGIN
DBMS_SCHEDULER.enable('CHAINTEST.CHAINTEST_CHAIN');
END;
STEP 8: Run the Chain whilst still connected as sys and observe that a Notepad window opens
confirming that the Batch file ran successfully.
BEGIN
DBMS_SCHEDULER.run_chain(
chain_name=>'CHAINTEST.CHAINTEST_CHAIN'
, start_steps=>NULL);
END;
STEP 9: Connect to the database as the CHAINTEST user and run the same command as in STEP 8 above.
Observe that even though you receive the message "PL/SQL procedure successfully completed." and do
not see any error messages that no Notepad Window is opened indicating that the Batch file was NOT run.
BEGIN
DBMS_SCHEDULER.run_chain(
chain_name=>'CHAINTEST.CHAINTEST_CHAIN'
, start_steps=>NULL);
END;

>
The Chain runs correctly when run via SQLPLUS when you are connected to the database as SYS but fails to run when you are connected to the Database as the User who owns the Chain.
>
Not true based on what you posted. The chain DOES RUN connected as SYS and when connected as the User who owns the chain.
You posted steps that show that SYS is the user that owns the program and thus the chain.
>
STEP 1: Login with sys as sysdba and create a new user
STEP 8: Run the Chain whilst still connected as sys and observe that a Notepad window opens
confirming that the Batch file ran successfully.
>
I don't see where you made any EXECUTE grant to user 'chaintest' that would allow that user to execute the program.
See the Usage Notes in the CREATE PROGRAM section of DBMS_SCHEDULER in the Database PL/SQL Packages and Types Reference
http://docs.oracle.com/cd/B28359_01/appdev.111/b28419/d_sched.htm#CIHEHDHA
>
For other users to use your programs, they must have EXECUTE privileges, therefore once a program has been created, you have to grant EXECUTE privileges on it.
>
Grant the EXECUTE privilege to user 'chaintest' and try it.

Similar Messages

  • Does Siri only work when connected to WiFi

    Does Siri only work when you are connected to a Wifi?  Mine does not seem to work through the 4G cell network.

    It works over WiFi or cellular.
    If you are using 4G cell network, are you using something like a Verizon MiFi 4510L to create a hotspot that your iPhone 4S is using?
    There are other issues with Siri that are going on - perhaps that is what you are seeing?

  • Time caspule only works when connected through my dLink router first

    I have a dlink router that was always my network router in my home. I hooked up a time capusle from the lan output of the dlink into the internet input port on the time capsule and it works fine. The time capsule and dlink are both wifi hostpots. When I connect my time capsule from my modem direct without the dlink the LED will not turn green. WHy is this and how do I remedy this.
    Thanks
    Colin

    The easiest way is to "hard reset" the Time Capsule and reconfigure it using AirPort Utility.
    Make sure it is connected to the modem first. Remember to power down the modem before changing its connections.
    To "hard reset" the TC: make sure it's powered up, then press and hold its tiny reset button and keep it depressed for five to ten seconds, long enough for its LED to flash amber rapidly. Release the reset button. Then, the LED will glow amber steadily for about a minute. Then, it will flash amber, slowly, about once every second or two, waiting for you to configure it with AirPort Utility.
    This will not affect your backups. You might need to re-select the TC's backup disk in Time Machine's Preferences, but your existing backups will not be lost.
    Manuals:
    4th gen (802.11n) TC:
    http://manuals.info.apple.com/MANUALS/1000/MA1575/en_US/time_capsule_4th_gen_set up.pdf
    5th gen (802.11ac) TC:
    http://manuals.info.apple.com/MANUALS/1000/MA1645/en_US/airport_time_capsule_802 11ac_setup.pdf

  • MY IPOD ONLY WORKS WHEN CONNECTED TO DOCK

    I DON'T KNOW WHY IT WORKS PERFECTLY FINE ON THE DOCK BUT OFF OF IT OTHERWISE DEAD I'VE TRIED THE 5 R'S CONNECTING IT TO MY COMP IS USELESS THE SCREEN STAYS BLACK ANY SUGGESTIONS?

    PLEASE IT'S DRIVING ME CRAZY WHY WONT IT RESET THE SCREEN JUST DISOLVES AWAY WHEN I TAKE IT OFF THE DOCL

  • IPod only works when connected to computer?

    When I plug in the iPod Nano to charge, then "eject the disk", I am able to use the Nano. The screen works and shows that it is fully charged. When I removed the USB cord from the Nano, the screen gets dim then after 2 or 3 seconds, fades to black and does not work. How do I fix this? I tried holding the 'select' key with the Menu key to do a restart and nothing happened at all. I have looked on these forums and read variations of this question, but no one has ever answered it!
    If the battery is dead and needs to be replaced, I will be VERY upset because this iPod has only been used twice ever.
    ALSO if the battery is dead, can I take it back to the store and will they replace it for FREE? I got this as a gift (in the package and everything) so I know that it has not been used before but obviously I do not have a receipt or anything like that. And I do not even know where an Apple store is in my area since they only seem to be in wealthy places.

    If this is a 2nd Generation Nano, and it has only been charged twice, I can guarantee that the battery is bad. Lithium ion batteries need "exercise" and should have at least 1 charge cycle monthly. You can be upset all you want but the lack of use is what did in the battery.
    You can send it to Apple and pay them to put in a new battery or try a 3rd party site, such as http://www.ipodjuice.com

  • APE only works when connected via ethernet

    I have a new AirPort Extreme that I am trying to add to my existing network (an older APE base station and 2 Express) and no matter how I try to configure it, I can't get it to work without being connected with an ethernet cable (either to my MacBook Pro or to the other APE base station).
    I also tried setting it up on its own with a new network and that wouldn't work either.
    If it isn't plugged in, and I try to change the configuration, i get this error:
    "AIRPORT UTILITY WAS UNABLE TO FIND YOUR BASE STATION AFTER RESTARTING.
    The settings for this base station have been successfully updated, but there was a problem re-joining the wireless network or finding the base station. You may need to select your network from the AirPort menu and try again."
    The amber light flashes, and it never shows up again. It doesn't matter if i unplug the APE, turn AirPort off and on, restart the utility, restart my mac... it won't ever show up unless I connect via ethernet, but as soon as i connect the ethernet cable, everything works fine.
    Does this mean that there is something wrong with the APE, or is there something I'm doing wrong with my setup (I've tried the assisted setup and manual setup following the instructions in the "Designing Air Port Extreme 802.11n Networks" pdf)?

    Yes. It's just the one APE that is a problem. The rest of the network is fine.
    If I connect the new APE to the older APE with an ethernet cable, I can see it in AirPort utility and use AirPort Disks connected to it, too; but as soon as I unplug the ethernet cable, it can't get back on to the network and it no longer shows up in AirPort utility.

  • Launching Oracle E-Business Suite forms only working when connecting on personal network using VPN

    Hi
    I am trying to open forms on client instance. Unable to open forms when on company's proxy network.
    But When I am connecting my personal network then I am able to open the forms.
    Please help

    Hi,
    If you can login to the EBS and cant launch forms, then I probably think it is due to bandwith issue.
    Please let us know whether the form does not respond or is it that you get any error message. If you receive get any error message, provide them here.
    Thanks &
    Best Regards,

  • My ipod nano only works when connected to charger

    i have a 5th gen nano and when i disconnect it from charger it won't stay on. I tried the 5 steps on trouble shooting and reset also still won't come on without charger connected

    Make sure the HOLD switch is in the off position. See Chapter 1, page 8, Disabling iPod nano Controls - iPod Nano 5th Gen. User Manual (direct PDF download)
    Also try restoring your iPod. Directions for doing so is also in the manual.

  • HT1355 i need to know why my facetime will only work when im connected to wifi.

    i need to know why facetime will only work when connected to wifi.

    Facetime in cellular will only work on the iPhone 4S and iPhone 5, and only if the carrier supports it.

  • Iphone 4: Home Button Not Working. The home button only works when it is connected to iTunes, once i disconnet it does not work, i have tried a restore to factory settings but it still is not working. Any suggestions?

    iphone 4: Home Button Not Working. The home button only works when it is connected to iTunes, once i disconnet it does not work, i have tried a restore to factory settings but it still is not working. Any suggestions?

    Apple, as I said, does not repair your iPhone. All hardware service issues are handled by replacing the unit. So they can't handle the home-button issue without also addressing the issue of the cracked screen, for which they'll almost certainly charge you. But you can make an appointment at an Apple Store or call Apple tech support and plead your case.
    Regards.

  • Is there anyway to have an 11 inch mac air connected to an external monitor with lid closed and still be able to see content. I have a wireless ketboard and mouse and have tried everything. Only works when plugged in.

    Is there anyway to have an 11 inch mac air connected to an external monitor with lid closed and still be able to see content. I have a wireless ketboard and mouse and have tried everything. Only works when plugged in.

    You are referring to a feature called Clamshell Mode, please read Clamshell Mode setup for instructions.
    BTW when posting when you use generalities such as "have tried everything" this tells us nothing. When posting please be specific and try to paint a complete picture. It just makes things easier for those trying to help you.

  • Nano: Only works when directly connected to USB despite being FULLY charged

    Hello all! This is my first topic/thread so I'm unsure if this is the correct spot to post this so please let me know. My issue concerns my Nano 8GB inability to play once fully disconnected from the USB/computer. This past week i noticed after having added some music that my battery indicator was on empty even after being charged for hours; i've never had charging problems with my unit before so I decide to reconnect it and let it charge overnight but to no avail. Once i remove the ipod from the computer the upper righ hand batt indicator was still showing empty; one day though the batt indicator actually had some life showing a sliver of "red" as to let me know there was some charge but a very low one so i decided on reconnecting it for another evening. Keep in mnd that despite the indicator showing empty i was able to play music/movies for a few days straight with no problems leading me to believe that its charging system was fine but that some type of glitch or software error was to blame for the indicator showing nothing.
    But suddenly while listening to music the next day the ipod stopped playing and showed me a warning screen "Connect To Power" via a yellow triangle exclamation symbol right next to the BIG BATTERY symbol u get in the middle of the screen, and then shut itself off. From this point on my Ipod has not regained its ability to play independently and is confined to being connected via USB @ all times if I want to enjoy any of its content. Basically it can't run on its own anymore, however when i plug it back to the USB all my music/movies are accesible through iTunes and play w/out problems. Even when I hit "safely remove hardware" and the ipod ends synchronizing with the computer but is still hooked up to the port it will work in my hand normally without issues as it always has. It even shows me the little battery indicator on the upper right side fully green w/ the usb symbol in the middle recognizing its still hooked up to the USB port while I listen to my media; but IT MUST BE CONNECTED via USB cable for it to do anything at all once its removed all bets are off and my ipod won't work.
    Also you know how after one "safely remove drive E" your Ipod basically SNOOZES if connected but not in use, well the screen that pops up is the Battery Life Screen where the BIG BATTERY symbol I saw in the WARNING Screen tells u how much u got left. Well guess what mine says whenever plugged into the USB port: CHARGED with the indicator nice and full of GREEN. But again once i remove that USB cable the ipod goes black, tells me I need to "connect to Power" and won't turn on or play music or even let me reset it; its like my Ipod has become a Phetus being kept alive by its Umbilical Cord.
    I don't know if I've explained myself clearly but honestly i've been trying to read up on this type of issue EVERYWHERE but I can't seem to find any other cases like this one. I mean if its the battery wouldn't the ipod be completely unable to work even while its plugged in to the computer? This is very bizarre
    an seek all the help & expertise u guys have to offer. If theres something you don't quite get please let me know and i'll try to break it down further. Thanks and i anxiously await your responses...
    RECAP
    Nano small battery indicator showed it was empty despite being fully charged
    Nano won't work unless plugged in via USB cable
    Will work perfectly through Itunes and independently but must be plugged in
    Battery Indicator Screen says battery fully charged
    Once unplugged Warning Screen pops up automatically, stating "Connect To Power"
    which shuts off the ipod.

    Yes, once I 'safely remove from drive' the ipod works normally I can listen to my media, change settings and even reset it by pressing MENU+center button. During resetting it goes straight onto the screen showing the Apple logo and then retuns back to automatically synchronizing with the computer (since its still plugged in to the usb port) and i can go into itunes and play my media via laptop. What type of servicing are you referring to? Should I try buying a new battery or sending it to apple so they can figure it out?
    Two things which happened yesterday which were sorta demoralizing:
    1 After unplugging my ipod from USBport the screen would automatically go black, right after I would hit the PLAY button and would get the "Connect To Power" Warning screen but under very Low Backlight before shutting itself down again. You could hardly see it, but now it doesn't pop up at all or give me any type of warning just a BLACK screen, so the only way of getting the unit to do anything is via usb connection.
    2. Also the day before I had fooled my ipod into being connected to the usb even though I was pulling the usb cable very slowly from underneath its adapter; sorta letting it touch the adapter but not really hooked up to it. Well I managed to get the cable off and my Ipod to work for less than 10 seconds but I was able to scroll down the Main and Playlist menus without any lag or lack of Backlight before it went out. I tried it once more and it didn't work plus I don;t see what the benefits of doing so would be @ this point. But having said that does anyone think it could be a simple battery issue or is this harddrive related? Again the Ipod only work swhen connected to my usb & tells me its fully charged, but once unplugged it goes completely blank...

  • Built-in microphone only works when phone is connected to iPod nano cable

    Hi, I got an iPhone yesterday but the microphone doesn't work properly. I have figured out that the built-in microphone will only work when I connect the dock cable from a second generation iPod nano. The cable that comes with the iPhone does not work. The supplied handsfree earbuds work correctly at all times.
    The strangest part of the problem is that the iPod dock cable doesn't have to be connected to my computer!
    I'll state the problem again. Let's say I make a phone call. The person on the other end cannot hear anything I say, but I can hear them. Then I plug in the dock cable from a second generation iPod nano, and the other person can then hear me. Unplug the cable and they can not hear me.
    I have tried restoring the iPhone three times, turned it on and off, and inserted and removed the headphone plug many times. These actions do nothing. *The only way I can talk on my phone is if I insert the dock connector from my old iPod!*

    Take it back.....

  • IMessage in my iPhone 4 stopped working over 3G and now its only working when i connect my iPhone to Wifi!!! please help

    as mentioned in the subject. i was enjoying sending msgs using iMessage using 3G internet connection but since yesterday my iMessage stopped working and now its only working when i connect my iPhone to Wifi !!!
    without WiFi it show my Message Not Delivered in Red !!
    and this issue not only with me.. even with my freind. so please help to find a solution

    I know why. It happened to me before. Try typing random stuff, eg aaasjddjfndirinfekdnkedindor , into the text box, then delete everything using the x-arrow on the keyboard. It should work now. If not, repeat the process again and again. It's because it needs to send the signal to the other recipient(without him really knowing it, this is to check that he can see when you are typing, you know, the "…" bubble), then check that you have 3G at good speed, then enables iMessage. It works for me this way...hope it does for you too (:

  • My Airport Time Capsule only works when I turn off and turn on, but I think this may end up with the unit. What can this happening and how to solve?

    Time Capsule Airport
    Hello to all, good day, sorry my english google, but it is the tool I have at the moment. I'm having trouble with my Time Capsule Airport, I made all the settings according to the manual, but there has been a connection problem with my iMac. When I finish my work I turn off the imac and then again when they return to work and care, it can not connect to Time Capsule Airport, making it impossible to remove the files and make back up by Time Machine only works when I turn off and turn on the Airport Time Capsule , but I think this may end up with the unit. What can this happening and how to solve? Thank you.
    Olá a todos, bom dia, desculpe meu inglês google, mas é a ferramenta que tenho no momento. Estou tendo dificuldades com a minha Airport Time Capsule, fiz todas as configurações de acordo com o manual, mas tem existido um problema de conexão com meu iMac. Quando termino meus trabalhos desligo o imac e depois quando retorno pra trabalhar novamente e ligo, ele não se conecta a Airport Time Capsule, impossibilitando retirar os arquivos e fazer o back-up pelo Time Machine, só funciona quando desligo e ligo a Airport Time Capsule, mas acho que isso pode acabar com o aparelho. O que pode esta acontecendo e como resolver? Obrigado.

    This is easier to do with pictures perhaps.. since we do not share a common language and machine translation leaves a lot to be desired.
    In the airport utility bring up your Time Capsule.
    Simply post the screenshots here.
    So here is mine.
    Click on the Edit button and give us the Internet and Wireless and Network tab..
    eg.
    Please also make sure you are set to ipv6 in your wireless or ethernet .. whichever is used.. and do tell which.
    This is wifi in your computer.
    The following are important..
    DO not use long names with spaces and non-alphanumeric names.
    Use short names, no spaces and pure alphanumeric.
    eg TC name. TCgen5
    Wireless name TCwifi
    Use WPA2 Personal security with 10-20 character pure alphanumeric password.
    read apple instructions to help with TM and TC.. they did finally admit it has issues in Mavericks.
    OS X Mavericks: Time Machine problems
    Mount the TC manually in finder.
    AFP://TCgen5.local
    When asked for the password .. that is the disk access password and save it in the keychain.
    Reset Time Machine
    See A4 here. http://pondini.org/TM/Troubleshooting.html

Maybe you are looking for