What is DB2 Restart Logic?



IBM's flagship relational database management system

What is DB2 Restart Logic?

Postby prasadnaidu » Thu Nov 26, 2009 1:10 pm

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.
prasadnaidu
 
Posts: 14
Joined: Fri Aug 14, 2009 10:25 pm
Has thanked: 0 time
Been thanked: 0 time

Re: What is DB2 Restart Logic?

 

Re: What is DB2 Restart Logic?

Postby swd » Thu Nov 26, 2009 6:42 pm

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.
User avatar
swd
 
Posts: 109
Joined: Wed Feb 18, 2009 9:18 pm
Location: UK
Has thanked: 0 time
Been thanked: 0 time

Re: What is DB2 Restart Logic?

Postby prasadnaidu » Mon Nov 30, 2009 10:20 am

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.
prasadnaidu
 
Posts: 14
Joined: Fri Aug 14, 2009 10:25 pm
Has thanked: 0 time
Been thanked: 0 time

Re: What is DB2 Restart Logic?

Postby dick scherrer » Mon Nov 30, 2009 10:32 am

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.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: What is DB2 Restart Logic?

Postby swd » Mon Nov 30, 2009 7:10 pm

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.
User avatar
swd
 
Posts: 109
Joined: Wed Feb 18, 2009 9:18 pm
Location: UK
Has thanked: 0 time
Been thanked: 0 time


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post