How Can i Implement Checkpoint restart in DB2?



IBM's flagship relational database management system

How Can i Implement Checkpoint restart in DB2?

Postby akishore » Mon Nov 09, 2009 12:38 pm

Hi,
How can I implement checkpoint restart logic in DB2. The one similar in IMS?
I have an issue here - A Job that is doing database update got failed. But while restarting, I have given wrong GDG base and it has updated with yesterday's data. Luckely I have found it while checking the data.
Can someone help me to fix this? I need the Job to be abended if we use a wrong input file(GDG/Flat).
I dont have much experience in DB2. Can someone please help me?
akishore
 
Posts: 2
Joined: Mon Nov 09, 2009 12:29 pm
Has thanked: 0 time
Been thanked: 0 time

Re: How Can i Implement Checkpoint restart in DB2?

 

Re: How Can i Implement Checkpoint restart in DB2?

Postby swd » Mon Nov 09, 2009 6:47 pm

The way I read this is that this is not a DB2 problem, but an application problem. If your application lets you process the same file twice, this is not DB2's fault. It sounds like you need some sort of method to check if a file has already been processed, and if it has you can make your program end with an error.

A common way of doing this, that I have seen, is a file 'run number' or file 'sequence number' that is in a file header record. When the file has been processed this number is stored somewhere (on a DB2 table). If the file is processed again it checks the file run number and if it is less than or equal to the one stored on the DB2 table, then the file has already been processed, so you can end you program with an error. If the file run number is +1 greater than the number stored on the DB2 table, then it's OK to process the file.
User avatar
swd
 
Posts: 109
Joined: Wed Feb 18, 2009 9:18 pm
Location: UK
Has thanked: 0 time
Been thanked: 0 time

Re: How Can i Implement Checkpoint restart in DB2?

Postby dick scherrer » Tue Nov 10, 2009 12:35 am

Hello,

Implementing checkpoint will not help with this situation as this situation was caused by someone making a mistake. . . Checkpoint/restart is sometimes used to continue an abended run (not prevent setup errors). More and more this is not used because of the speed of the new cpus and dasd. Part of any restart/recovery/rerun is making sure that the proper data is in the database and the proper input(s) are used.

Nothing i know of can completely prevent people from making mistakes. Using something like Steve mentioned could help for syncronizing normal runs.
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: How Can i Implement Checkpoint restart in DB2?

Postby akishore » Thu Nov 12, 2009 8:17 pm

Hi Thanks For the Help - I have used a VSAM file to store the latest file count. The issue has been solved now.
akishore
 
Posts: 2
Joined: Mon Nov 09, 2009 12:29 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DB2

 


  • Related topics
    Replies
    Views
    Last post