Page 1 of 1

Re-startability in Server Job?

Posted: Thu Apr 05, 2007 12:31 pm
by vnspn
Hi,

We have a Job that reads a huge number of records from a flat file and loads it into a table.

I know that restartability option is only available in Job Sequence using the Checkpoint option. Is there a method to make the individual Job re-startable? That is, if the Job gets failed at a certain point, then re-start the Job from the record it had failed (by skipping all the records that has been already read in the previous run)?

Thanks.

Posted: Thu Apr 05, 2007 12:40 pm
by chulett
Sure. The fact that your source is a flat file simplifies this and I'm assuming you are doing commits over the course of this load.

A Job Parameter that is the 'number of records to skip' - i.e. the number successfully loaded to this point. Then it's just a constraint:

Code: Select all

@INROWNUM > #RecordsToSkip#
Default the value of the job parameter to 0.

It gets more complicated if you want to automate this, but that's it in a nutshell for your situation.

Posted: Thu Apr 05, 2007 1:05 pm
by vnspn
Ok, the first time when I run, I can pass the value for the Job Parameter 'RecordsToSkip' to be '0'. But when there is a failure, how will the required value be passed to this parameter. Thats what do u mean by saying "automate"? But this needs manual effort to pass the required value. By the way, can I see the exact row number that has caused the failure in the logs?

We are thinking of something, where the job is just re-started, it should start picking up records from the point it had left in the previous run?

Posted: Thu Apr 05, 2007 1:10 pm
by chulett
vnspn wrote:We are thinking of something, where the job is just re-started, it should start picking up records from the point it had left in the previous run?
That would be the 'automated' part.

Stop and think about how it would need to work. Outline the steps needed to accomplish that. Then implement them in your DataStage job and/or job control.

Otherwise, yes - your operators will need to determine where it left off (last commit point?) and then pass in that value when they restart the job.

Posted: Thu Apr 05, 2007 1:11 pm
by ray.wurlod
Your design has to keep track of, and record in some persistent form, where it successfully ended. A restart can then pick up this value as the new start point. There are many possible variations on how you might achieve this; use the logic of the above sentence to design one that suits your particular requirements.