You can definitely do all of this as long as know what's failure. For example, you can execute SQL*Loader, but than you need to find out whether SQL*Loader processing succeeded (not the program, but the actual load) and if that processing is recoverable!!! There is a big difference between "server not available" and "file cannot be loaded" because of bad data. So you don't want to retry in the last case. You may want to abort the job and notify yourself about that condition The general idea is to create single script type job with default job error-handling disable and take care of such error handling yourself. Example: RETRY_LOAD: // run SQL*Loader Dim( proc_id, number ) RunAndWait("sqlloader.exe [command line parms]", "", 0, proc_id ) // check error log Dim(count, number) FileSearch("my sql loader log file", "TNS error", count) If( count, RETRY_LOAD, CHECK_STATUS ) CHECK_STATUS: FileSearch("my sql loader log file", "bad data", count) If( count, ABORT, CHECK_STATUS2 ) CHECK_STATUS: FileSearch("my sql loader log file", "out of space", count) If( count, ABORT, CONTINUE1 ) CONTINUE1: // email this file to ... MailSend( ...... and so on..... ABORT: : Hello, : We have bought scheduler and I am looking at converting our exiting jobs that : run on Windows NT queue to it. : The problem is that I want to run a few things within a job. eg At the moment : a DOS batch file could run a few programs and all be classed as a job. : Eg I want to look for a text file, if it is present run Oracle SQL*Loader to : load it into an Oracle database, then email the results to admin : What I want to be able to do is recover the job if it falls over at any : point. : EG If the SQL*Loader falls over because Oracle is not up then the job should : continue until either Oracle is up or manual intervention happens. : Similarly, if the SQL*Load succeeds but another part fails (eg email or a SQL : script) then it should retry until success or manual intervention. : Should I create a job for each process or a large job with them all in ? : They are a mixture of looking for files, running sql statements and copying : files. : Many Thanks
|