IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

which is the best method to restart the JOB in DB2?


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Gopalakrishnan V

Active User


Joined: 28 Jun 2010
Posts: 102
Location: chennai

PostPosted: Wed Apr 03, 2013 5:42 pm
Reply with quote

Hi,

I have a table which having millions of records, that needs to be updated via some process. If suppose any abend happens during update we need to restart from the record which cause abend, not from the first record.

Currenlty we using a restart file which is used to store the record which cause abend based on SQL code. But i hope it wont work when SOC7 or ASRA or any DB2 system problem, during that time we are not able to write the abend record into restart file.

I heard we can use temporary tables, but i am not sure about the performance issue since the table having high volume. Another method, cursor with hold option but i am not sure whether the cursor still open even after SOC7 or DB2 system prob.

Please suggest some method to restart the JCL from the record causing the abend.

Thanks in advance.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Wed Apr 03, 2013 5:52 pm
Reply with quote

Actually, you do not want to restart the JCL from the reord causing the abend but you want to restart the PROGRAM.

Do a commit every n records. Immediately before doing so insert, somewhere, the current record count. On restart bypass that many records.
Back to top
View user's profile Send private message
Gopalakrishnan V

Active User


Joined: 28 Jun 2010
Posts: 102
Location: chennai

PostPosted: Wed Apr 03, 2013 6:40 pm
Reply with quote

Hi Nic,

Quote:

Actually, you do not want to restart the JCL from the reord causing the abend but you want to restart the PROGRAM.



Yes. I want to restart the program.

Quote:

Do a commit every n records. Immediately before doing so insert, somewhere, the current record count. On restart bypass that many records.


If we update the table in sequence manner or all record then based on the count we can restart. But i don't think this method will work if we update the table based on where clause condition.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Apr 03, 2013 7:24 pm
Reply with quote

Quote:
But i hope it wont work when SOC7 or ASRA or any DB2 system problem, during that time we are not able to write the abend record into restart file.
VGK - What your current restart-logic is doing, how it works? Check-point-restart is not meant only for "user abends", as I infer from your post.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Wed Apr 03, 2013 9:58 pm
Reply with quote

The restart should happen from the last committed point and when even the commit is done you need to store the key data in file or table so on abend u will be able to restart from the next record
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Thu Apr 04, 2013 12:13 am
Reply with quote

Where is your update data coming from - you did not mention. Is it a sequential file, a VSAM file, another table or somewhere else?
Back to top
View user's profile Send private message
Gopalakrishnan V

Active User


Joined: 28 Jun 2010
Posts: 102
Location: chennai

PostPosted: Thu Apr 04, 2013 5:00 pm
Reply with quote

Hi Anuj,

Quote:

VGK - What your current restart-logic is doing, how it works? Check-point-restart is not meant only for "user abends", as I infer from your post.


Currently we are using a flat file which is used to store the record which cause abend based on SQL code while updating the table. But this method wont work when some DB2 system getting down or abnormal abend, because during that time cant able to write the record and system will hang on.
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Thu Apr 04, 2013 5:39 pm
Reply with quote

Quote:
Currently we are using a flat file which is used to store the record which cause abend based on SQL code while updating the table


Can you please rephrase?
Back to top
View user's profile Send private message
Gopalakrishnan V

Active User


Joined: 28 Jun 2010
Posts: 102
Location: chennai

PostPosted: Thu Apr 04, 2013 6:41 pm
Reply with quote

Hi Nic,

Quote:

Where is your update data coming from - you did not mention. Is it a sequential file, a VSAM file, another table or somewhere else?


The data coming from vsam file. But Is there any relation between the incoming data and restart process?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Fri Apr 05, 2013 12:04 am
Reply with quote

Read the second line of my first post - stands good for a sequential file but for a VSAM file (is it ESDS or KSDS?) you may have to adapt the solution to store the actual last record processed and on restart keep reading until you reach the record after that one and restart your updating from there.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Apr 05, 2013 2:02 am
Reply with quote

Hello,

Hopefully, there is already a restart/rerun/recovery proces in place on your system. If there is one, use it.

If not, this is probably not a task to be handled for only 1 process.

How long does the entire process take now?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Calling Java method from batch COBOL ... COBOL Programming 5
No new posts IMS Restart Failure IMS DB/DC 4
No new posts Restart logic by using cursor name in... DB2 1
No new posts Do we need to restart DB2 Z/OS for DA... DB2 0
No new posts Control-M restart instruction CA Products 2
Search our Forums:

Back to Top