SQL works from SQL*Plus command line but not as a DBMS_JOB submitted job

Oracle 10g 10.2
Got a procedure which does not run correctly as an Oracle job but runs fine as a SQL script.
There are no Oracle errors (or any errors) of any kind when the job does not run fine – it just does not update any rows. But when run as a SQL script – the same way it is run as a job – then the rows are updated.
Any ideas?

Good stuff....
See my replies to some of the questions in italics
a) Different NLS settings => The job uses the NLS settings of the session that created it. If you create it with some tool like TOAD, you might have a different environment than with sql*plus. Runs good in TOAD and SQL*Plus using the command-line feature - just 'acts funky' when submitted.
b) Interval issue. Are you sure the job was running? Isn't still running? The job runs successfully - even logs a successful message in our logging table.
c) User/priviledge issue. Sometimes a job needs direct grants whereus a procedure can be called with priviledges granted through roles. Don't know - need to check this out.
d) Transaction handling / Error Handling. The job runs into some error, but the error is supressed, because of bad exception handling. What is the value in the BROKEN column, when you do: select * from user_jobs; I would think that, since the errors are logged into a side table, an error would be found there. However, no errors are found. The BROKEN column is 'N'.

Similar Messages

  • TS2972 home sharing will work from computer to apple tv but not the other way?

    home sharing will work from computer to apple tv but not the other way?

    Home sharing is one thing, physically copying is another thing.

  • Query runs from command line, but not from scheduler

    We use Control-M to schedule shell scripts to be run on a Solaris server. Some of the scripts have to access an Oracle database and in that case our security team will include the DB user and password in the script, then encrypt it and the sys admin team schedules the encrypted shell script with Control-M. That works fine, but we've been trying to have the DB user and password on a separate encrypted file so that we don't have to ask for file encryption every time it's necessary to modify a script (this is a test environment).
    We have the script at ~/system_name/scripts, the query at ~/system_name/sql and the encrypted file and key at ~/system_name/keys. The SQLPlus call in the script is:
    ${ORACLE_HOME}/bin/sqlplus "`decrypt -a 3des -k ./../keys/key.3des.system -i ./../keys/login.system`"@instance_name <<EOF
    @${DIR_SQL}/TEST_QUERY.SQL
    quit
    EOF
    The security analyst has tested is successfully from command line, but when we schedule it with Control-M the job abends and we get the following in the sysout:
    + decrypt -a 3des -k ./../keys/key.3des.system -i ./../keys/login.system
    decrypt: cannot open ./../keys/key.3des.system
    decrypt: invalid key.
    + /u00/app/oracle/product/11.1.0/db_1/bin/sqlplus @instance_name
    + 0<<
    @/sistemas/hmp/system_name/sql/TEST_QUERY.SQL
    quit
    SQL*Plus: Release 11.1.0.6.0 - Production on Mon May 3 09:41:55 2010
    Copyright (c) 1982, 2007, Oracle. All rights reserved.
    SP2-0310: unable to open file "instance_name.sql"
    Enter user-name: SP2-0306: Invalid option.
    Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER|SYSASM}]
    where <logon> ::= <username>[<password>][@<connect_identifier>] [edition=valu\
    e] | /
    SP2-0306: Invalid option.
    Usage: CONN[ECT] [logon] [AS {SYSDBA|SYSOPER|SYSASM}]
    where <logon> ::= <username>[<password>][@<connect_identifier>] [edition=valu\
    e] | /
    Enter password:
    ERROR:
    ORA-12545: Connect failed because target host or object does not exist
    SP2-0157: unable to CONNECT to ORACLE after 3 attempts, exiting SQL*Plus
    0000000080
    Any ideas?

    Looks like the command is being split in some way - the connection to sqlplus is being made before it completes the whole string
    It appears to be seeing the @instance_name as a script to execute rather than a db to connect to.
    Is the database on the same server as the script?
    If so, try setting your environment to the correct databsae, so that you can omit the @instance_name part of the syntax and see if it helps
    Also just noticed the failure to open the decrypt script. It would appear uyou are not using a full path name. Have you checked which directroy the scheduled job starts in? You may need to look at running some environment specific scripts first.
    Edited by: LindaA on 05-May-2010 07:43

  • Jar file runs from the command line, but not when I double click it

    Hello, I'm running windows xp. I've created an executable jar file and it runs fine from the command line when I type;
    java -jar wizard.jar
    but, when I double click it . . . nothing.
    Any ideas?

    nothing ? that's weird, windows XP should prompt you to select the program you want to use in order to open Jar files (and give you this silly piece of advice to search the web for the appropriate program)
    you might want to check what program (if any) got associated with .jar extensions :
    in Windows Explorer : Tools => Folder Options => File Types
    hth

  • Processbuilder works from command line but not on deployment server

    I need to deploy my code on a 10g oc4j Oracle server. When I ssh into the server and run the following code, it works:
    import java.util.*;
    import java.io.*;
    public class Launcher {
    public static void main(String args[]) throws IOException {
    String url = "http://www.ebay.com";
    String[] commands = {"/bin/sh", "-c", "/opt/sfw/bin/firefox ", url, "-width", "1600", "-height", "1200", ":5"};
    ProcessBuilder pb = new ProcessBuilder(commands);
    env.put( "DISPLAY", ":5" );
    Process process = pb.start();
    It launches firefox and I can see the process running when I use "ps -ef | grep firefox". Firefox runs in a virtual frame buffer since this is a headless server. Originally I had problems just getting this code working by itself, but now it works fine.
    However when I deploy the exact same code via Oracle application server, it doesn't do anything. Not only do no processes show up but I have added different output statements into this code and have verified that firefox never launches. However no error is ever thrown either, even when I just test for generic Exceptions. So any ideas on what I can do to get this running?

    Caffeine0001 wrote:
    sabre150 wrote:
    Solerous wrote:
    Also, I do handle the stdIn and stdOut in the code. I was trying to pair down the code in my inclusion of it here to just give the bear minimum for running it. Here is my code for handling it if you'd like to see it:
    InputStream is = process.getInputStream();
         InputStreamReader isr = new InputStreamReader(is);
         BufferedReader br = new BufferedReader(isr);
         String line;
         System.out.printf("Output of running %s is:",
         Arrays.toString(commands));
         while ((line = br.readLine()) != null) {
         System.out.println(line);
         }I don't see stderr being handled and your command array is still wrong.
    Edited by: sabre150 on Dec 10, 2008 4:48 PM
    If he were to call [ProcessBuilder.redirectErrorStream(true)|http://java.sun.com/j2se/1.5.0/docs/api/java/lang/ProcessBuilder.html#redirectErrorStream(boolean)] then all he has to handle is stdout.
    True, then that would be just one more important thing that the OP failed to post in his "*exact* same code" .

  • Imap works from cellular modem yahoo/sprint but not lan

    I've got a Yahoo email account that I can access from imap inconsistently. If I am on my home internet connection, mail.app can't connect - it either gets password unrecognized or connection rejected on port messages. However, the same computer, same Yahoo account, if I am online with my SprintPCS cellular data card, imap works 100% of the time.
    .Mac imap works on both connections.
    I suppose the obvious answer is that Yahoo is blocking non-Sprint access to its imap service, but I'm not aware of any deal between Yahoo and Sprint, so that doesn't make sense, though is possible.
    Does anyone have any suggestions on what I might look for on the home connection to check this out?

    Not sure what you mean. Does Yahoo provide IMAP access?
    Go to Apple Menu > System Preferences > Network, choose Network Port Configurations from the Show popup menu, and make sure that the configuration used to connect to Internet appears at the top of the list. Try also turning OFF all the network port configurations except the one needed to connect to Internet and see whether that helps — if it doesn’t, turn ON again the ones you want enabled.
    Also, Mac OS X 10.4.7 introduced connection issues in Mail as a result of (according to the documentation) “Mail now supports connecting to mail servers through a SOCKS proxy”. Problems caused by that can usually be fixed by going to System Preferences > Network, choosing the network port configuration used to connect to Internet from the Show popup menu and disabling SOCKS Proxy in the Proxies section if it’s enabled.
    You may set up different network “locations” to make it easier to switch between network settings, if necessary:
    Using network locations in Mac OS X

  • Not a valid month, but works from sql developer

    Hi,
    so this sample works from SQL DEV. :
    insert into aspa2_magaddendum (contractid, addendum_number, from_date, to_date) values(2, 0, '03.05.2012', '24.05.2012');
    but not from code using ODP.NET
                string date1 = "03.05.2012";
                string date2 = "24.05.2012";
                OracleConnection conn = new OracleConnection("Data Source=(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=127.0.0.1)(PORT=1521))(CONNECT_DATA=(SID=XE)));User Id=aspa2;Password=aspa2;");
                conn.Open();
                OracleCommand cmd = new OracleCommand();
                cmd.Connection = conn;
                cmd.Parameters.Add("date1", date1);
                cmd.Parameters.Add("date2", date2);
                cmd.CommandText = "insert into aspa2_magaddendum (contractid, addendum_number, from_date, to_date) values(2, 0, :date1, :date2)";
                cmd.ExecuteNonQuery();I get:
    ORA-1843: not a valid month message from exception
    Edited by: user2704811 on May 3, 2012 2:47 AM

    Looks like SQL DEV. session is a bit different from the one in code...
    From SQL DEV i get:
    select value from nls_session_parameters where parameter = 'NLS_DATE_FORMAT';
    "DD.MM.RR"
    and from the code I get:
    cmd.CommandText = "select value from nls_session_parameters where parameter = 'NLS_DATE_FORMAT'";
    string format = cmd.ExecuteScalar().ToString();
    "DD-MON-RR"

  • Run Sql command line is not openning.

    Hi !
    sql command line is not openning.(windows 2008 enterpise and oracel 11g express)
    please tel me is there any other way to open it, i have tried it from the phyical directory also.
    but oracel is working properlly.
    i wanted it load data from captured data to oracle database. (i was migrating).
    yours sincerely
    Edited by: 944768 on Aug 14, 2012 12:12 AM

    Open a command prompt (cmd), from there run:
    c:\> sqlplus user/passwordHow do you plan to "load data", based on what format? Sqlplus might not be the right tool for the job.
    Sql*loader is one option. Another option to help with migration is Oracle SQL Developer (separate, free tool).

  • File- Print not working from SQL Developer 1.2.1 Build MAIN-32.13

    File->Print not working from SQL Developer 1.2.1 Build MAIN-32.13.
    I downloaded sqldeveloper-1.2.1.3213.ZIP and extract to a local directory. From the extracted directory I ran ..\sqldeveloper\sqldeveloper.exe from Windows XP sp2. The program itself seems to run just fine but File-Print doesn't do anything. In Help-About, Java Platform is reported as 1.5.0_06 and Oracle IDE is 1.2.1.3213. I'm not sure where to look for what is causing the problem.
    Thanks

    I hadn't tried CTRL-P before but I did today. On the first attempt, I saw a small jump in the memory usage for sqldeveloper.exe as reported in Windows Task Manager. Otherwise, there was no change. A second CTRL-P in the same session produced a further bump but subsequent attempts in the same session produced no further change in CPU or Memory Usage.
    Using Task Manager to monitor this further, I tried File->Print again and saw that sqldeveloper would periodically climb to 1 or 2 percent CPU and consume a little more memory. After a minute or so, though, all activity stops again.
    I do not get a print dialog box from SQLDeveloper using either CTRL-P or File->Print

  • Need command to run sql script from sql prompt

    Hi,
    I am beginner in sql i need a command to run sql file from sql prompt.In notepad i have write 10 to 15 tables creation and saved as .sql i want to run this file from sql promp pls some one help.I am very great full to all users in this forum.

    You can also use the 'start' command.
    You may also want to look in the SQLPlus User Guide and Reference (for your release) at the set command for commands to set the number of lines per page, turn headings on or off, and so on:
    http://download.oracle.com/docs/cd/E11882_01/server.112/e10823/toc.htm
    HTH -- Mark D Powell --

  • Unable to run reports from the unix command line

    hi
    all of a sudden i am unable to run reports ( on App server 10g) either from the unix scripts or from the unix command line. But i can run them from the forms.
    Any one have any idead about this.
    Thank you

    thanks all for replying
    i have set the env variables for the session and it worked. Looks like i have to set the oracle_home and ld_library_path every time ( opening a new putty session) i call sqlldr.
    But in a whole i am trying to run sql loader from the forms. Right now we have Oracle app server 10g which forms 10g version. As oracle app server 10g didnt come with sqlldr, we are copied the sqlldr of database on to app server with different home. after this we can run sqlldr ( on app server ) from unix scripts but not from Forms. Then we opened a qurey with oracle about app server 10g not commig with sqlldr and its remedy . But they said that they dont have specific remedy for that and suggested the same what we did.
    So we came up with java package which does the same funtion as host command and trying to run sqlldr which is on the database( ie replacing the host command in the forms with the database funtion). By using that funtion i am able to run the sqlldr from sql plus but not from forms. I couldnt easily debug it as i wont through any error messages.
    Any one have any idea of this ...
    Thank you

  • Linux: Pipe to stdout displays on the command line, but does not redirect to file

    Hello all,
    Several years ago, I was given the task of making a LabVIEW application run from the Linux command line with arguments.
    Now I have the same task, and I naively thought, "Sure, no problem."  So, for my stdout output, I used something very similar to the following:
    It seems to work fine in a compiled application, as it always has, and the prescribed string appears on the command line window.  However, the person testing the functionality here remarked that he couldn't successfully redirect output to a file.
    For example:
    If my compiled binary is "LabVIEW_executable", let's say it is called in the following manner:
    /foo/bar> ./LabVIEW_executable >foo.txt
    Since the desired output appears on the command line, you'd intuitively think that it would also appear in foo.txt, but it does not.  After tinkering for a while and coming up with very little in the way of search results, I thought I'd ask here.
    Has anyone ever done this before?
    I am very grateful for any assistance.
    Regards,
    Jim

    Ahhh, thanks a lot!
    Whoops.  Looks like I made a novice mistake.
    Nice icon, by the way. 

  • Run App Engine through command line but have it show up in Process Monitor

    We are trying to run Application Engine through command line and have it show up in the Process Monitor.
    We have successfully ran the Application Engine through command line. We also can successfully run the Application Engine through PIA.
    Only when you run the AppEng through PIA it goes through the Process Scheduler and shows up in the Process Monitor.
    We would like to be able to do this through command line as well. Has anyone done this before?

    I'm not sure if it is (easily) doable.
    => Fire a process through the front end appl is nothing but insert few rows in process scheduler tables settings (PSPRCSRQST, PSPRCSQUE), then the process scheduler is taking information from there every x seconds and eventually run the command (on the process scheduler server) keeping an eye on the process result in the tables to post the result.
    => Fire psae through command line (or pssqr) bypass the process scheduler, you can run it from any client... so even without any clue about Process Scheduler server or even without Process Scheduler at all (cf. the very first AE running during an installation is VERSION without anything else than the client).
    So finally, your AE program has no clue where it should run outside the client you are fired the command from (i.e. on the batch server as it is running when you are fired the same AE through the front end application), nothing more about the process scheduler configuration file, and where the output files should be posted.
    Maybe not by running the AE from the command line, but by simulating the actions as it would be from the front end application, for instance by inserting in the tables whatever you want to run... but it sounds odd. Probably some developer might have done this before... but this should be reconsidered by Peopletools version/patch level (or through CI ?)
    Nicolas.
    added the last paragraph
    Edited by: N Gasparotto on May 21, 2010 2:46 PM

  • How do I get LR2 to "load from device" via command line?

    Hi,
    how do I get LR2 to "load from device" via command line?
    I've got XP to load LR2 when a "camera" (and only a camera) is connected but really cool would be if LR2 would also import the pictures.
    cu,
    Michael

    1. Make sure you are using IOS 7.
    2. Make sure your iPad is register in My Support Profile.
    https://supportprofile.apple.com/
    3. Try downloading again; it should be free.

  • How do I generate PDF and CHM files from the a command line in windows?

    I am trying to set up a PC to build some documents during the night. I was looking for a way to get framemaker to generate PDF and CHM files via a command line in windows? How is this done with FrameMaker 12
    Thanks for the help
    Alex

    Hi,
    The part with generate a PDF via a jsx seems to work OK, except when FrameMaker decides that it will not work anymore. I must say I am not impressed with the stabillity of FrameMaker 12, there is room for a lot of improvement!.
    I have given up on how to figure out how to get FrameMaker 12 to generate chm files via jsx scripts, any pointes are still very welcome.
    The route I have taken is I make a RoboHelp project for each chm files I need to generate. The only thing this RoboHelp project contains is a link to the actual FrameMaker project I want to generate a chm file.
    To make the chm I start RoboHelp with a script that
    1) Opens the desired project
    2) Sets the desired output chm files name
    3) Generates the chm file
    4) And finally quits RoboHelp
    Below is a copy of the jsx in case anyone can reuse anything.  And yes parameters are transfered via enviroments variable. I have later learned there is some way to read the parameters given at a command line but this seems to work so I stick to this for now.
    // Get parameters
    var RhProjName = $.getenv("RH_PROJ_NAME");
    var RhChmName = $.getenv("RH_CHM_NAME");
    var RhLogFileName = $.getenv("RH_LOGFILE_NAME");
    var RhLogFile = new File(RhLogFileName);
    RhLogFile.open("w", "TEXT");
    RhLogFile.writeln("RH_PROJ_NAME : ", RhProjName);
    RhLogFile.writeln("RH_CHM_NAME : ", RhChmName);
    doc = RoboHelp.openProject (RhProjName, 1);
    var sslmngr = RoboHelp.project.SSLManager;
    for(var i = 1; i<=sslmngr.count; i++){
      var ssl = sslmngr.item(i);
      if(ssl.name == 'Microsoft HTML Help') {
        // Set the output location and file name
        ssl.setSpecificProperty("DestinationProjectName", RhChmName);
        if (doc.saveAll(true) ) {
          RhLogFile.writeln("saveAll returned TRUE");
        } else {
          RhLogFile.writeln("saveAll returned FALSE");
        if ( ssl.generate() ) {
          RhLogFile.writeln("ssl.generate returned TRUE");
        } else {
          RhLogFile.writeln("ssl.generate returned FALSE");
      } else {
        // alert ("Found " + ssl.name + " dont do anything");
    doc.saveAll(true);
    RhLogFile.close();
    RoboHelp.closeProject();
    RoboHelp.quit();

Maybe you are looking for

  • Netflix on Touchpad?

    Does anyone know if there are plans to support Netflix on the Touchpad, either via the web browser or through a TP App?  Post relates to: HP TouchPad (WiFi)

  • Cancel pre order

    how do I cancel preorder

  • Will 10.6 drivers work the same with the Lion Operating System (10.7) Mouse

    Hi everyone i was hoping to know if 10.5 - 10.6 drivers work on 10.7 to use a mouse because i would really like the Razer Mamba and the 2012 edition has 10.5 - 10.6 drivers for it soo i was hoping that they would work with 10.7? Please respond quickl

  • Want to Save CS6 to CS5

    Hi, I have some files in Illustrator, Photoshop, and InDesign that I wish to be backwards compatible with CS5. I'm concerned more about my Illustrator files at the moment. I'm not sure how to save as a CS5 file or if there is an automatic way to make

  • LOST BT INTERNET SERVICES AFTER UPDATE

    There seem to be a few mails on this subject but no answers.Is there a solution?