SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
how to get a job to run when Oracle Database i

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
how to get a job to run when Oracle Database i
Author Message
Dominic Klein



Joined: 23 Nov 2001
Posts: 132

Post how to get a job to run when Oracle Database is up Reply with quote

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

Mon Mar 04, 2002 12:44 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 7948

Post Re: how to get a job to run when Oracle Database i Reply with quote

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

Mon Mar 04, 2002 1:50 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.