Page 1 of 1

What is DB2 Restart Logic?

PostPosted: Thu Nov 26, 2009 1:10 pm
by prasadnaidu
Hai,

I have an issue that is i have 1000 records, while updating 551 record my job is abended. I have to update the next time from 551 record. I know the therotical scenario. But I want some what Implementation for that Logic. Can U any one help me.

Re: What is DB2 Restart Logic?

PostPosted: Thu Nov 26, 2009 6:42 pm
by swd
If your job abends on ROW (not record!) 551 and you want to restart from the same row, does this mean that you currently perform a COMMIT for every row because when your job abends it will perform a ROLLBACK and back out all the changes since the last COMMIT.

You could not perform a COMMIT until all 1000 rows are updated, then commit all changes on one go which would save adding any restart logic to the code. As it's only 1000 rows I'd be tempted to do that.

Re: What is DB2 Restart Logic?

PostPosted: Mon Nov 30, 2009 10:20 am
by prasadnaidu
Hi,

Actually I am setting a Check point for 100 rows. After 100 rows are updated i use th COMMIT option.
after updating 550 records my job is abended. what are the necessary steps i have to be taken care when i am restart the job the once again.

I want some implementation code for this one.
Plz some one help me.

Re: What is DB2 Restart Logic?

PostPosted: Mon Nov 30, 2009 10:32 am
by dick scherrer
Hello,

After 100 rows are updated i use th COMMIT option.
Why? It does not sound like this has been planned but rather just happened (read on).

what are the necessary steps i have to be taken care when i am restart the job the once again.
Without knowing this, it makes no sense to arbitrarily COMMIT. The restart process should be in place and understood before code is written that might want to use it. This is actually how/when a checkpoint is taken. When COMMIT/Restart is used, it is most often used at a logical unit of work (luw).

I want some implementation code for this one.
Not really a valid request. Someone may post something but it will be a complete guess as no one knows how your environment is configured. You need to talk with the people who support your environment and learn how this is handled on your system. There are many ways to implement restart/recovery and they all are site-specific.

Re: What is DB2 Restart Logic?

PostPosted: Mon Nov 30, 2009 7:10 pm
by swd
You also need to understand that if you commit every 100 rows, then row 500 will be the last row successfully committed. If your job abends on row 551 then you need to restart from row 501, not 551, as all updates from row 501 through to 551 will be rolled back.