View previous topic :: View next topic
|
Author |
Message |
Rahul_kumar Warnings : 2 New User
Joined: 24 Jun 2006 Posts: 50
|
|
|
|
Hi,
I have 4 jobs which updates the same table based on the branch number and account number.The account and branch numbers updated are different for all the 4 jobs.I am getting deadlock issue -913 every now and then as the jobs run parallely.I do not want the jobs to be scheduled sequentially as it would consume a lot of time causing the batch cycle to be delayed.The commit frequency is already very less and can't be reduced further.
Can anyone please suggest what can be done to avoid deadlock.
Thanks in advance!
Rahul |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Quote: |
The account and branch numbers updated are different for all the 4 jobs |
that my be true,
but the issue is that there are overlapping ranges.
otherwise, you would not have the -913.
unless of course that branch no, account number is not the primary index. |
|
Back to top |
|
|
Rahul_kumar Warnings : 2 New User
Joined: 24 Jun 2006 Posts: 50
|
|
|
|
Hi,
The branch and account nos are the primary index.
So,in case of overlapping ranges what should be done.
Is it something to do with the DB2 locks,I don't have much idea how I can check the lock on the table through BMC tools. |
|
Back to top |
|
|
sushanth bobby
Senior Member
Joined: 29 Jul 2008 Posts: 1020 Location: India
|
|
|
|
Rahul,
Quote: |
I have 4 jobs which updates the same table based on the branch number and account number.The account and branch numbers updated are different for all the 4 jobs |
Where is the input coming for this four jobs like,
1. Four different input datasets which four jobs use...
2. Inputs are coming from a different table
Post the full error message
Thanks,
Sushanth |
|
Back to top |
|
|
Rahul_kumar Warnings : 2 New User
Joined: 24 Jun 2006 Posts: 50
|
|
|
|
Hi,
The source is also 4 table for 4 jobs.Actually,these 4 jobs are existing jobs and we did'nt face contention during that time but recently we added few columns to the target table and now it gives deadlock frequently. |
|
Back to top |
|
|
gylbharat
Active Member
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
How many indexes do you have on the target table? And are the new columns part of index? |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
an easy way to look at this:
your updated table has a primary index.
if the table is reorg'd sufficiently, the data in the table is relatively well sequenced,
so that,
if you designed you 4 update processes to only update 1/4 of the table, you won't have any contention.
introduction of new columns, and luck in the past, have contributed to the bad mix.
find out which columns comprise the primary index,
divide the values that would/could populate these columns into 4 groups,
and insure that each of the 'trigger tables' are only populated by values that adhere to its quarter of the base table ranges.
this is obviously not being done now. you need to modify the 4 trigger table population process. |
|
Back to top |
|
|
Rahul_kumar Warnings : 2 New User
Joined: 24 Jun 2006 Posts: 50
|
|
|
|
Hi Dick,
Many Thanks!
I will try and keep you posted about the same. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
Rahul_kumar,
glad we were able to shed some light on the issue.
another thing to keep in mind is what Dick Scherrer has often mentioned,
and what I consider a golden rule with db2:
if you have 2 (or more) programs that are responsible for issuing locks
(updates etc...)
on the same db2 tables, make sure the sequence is the same in both modules. |
|
Back to top |
|
|
|