By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,610 Members | 1,672 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,610 IT Pros & Developers. It's quick & easy.

how to detect a deadlock and how to clear it when it occours?

P: n/a
hi,

can any one help me in detecting a deadlock and to clear the deadlock
when it occours?

how to monitor the databases for deadlocks?

Jan 31 '07 #1
Share this Question
Share on Google+
3 Replies


P: n/a
"kavin" <ka*************@gmail.comwrote in message
news:11**********************@j27g2000cwj.googlegr oups.com...
hi,

can any one help me in detecting a deadlock and to clear the deadlock
when it occours?

how to monitor the databases for deadlocks?
By default, deadlocks (-911 RC 2) are detected and resolved (by DB2
cancelling one of the applications) every 10 seconds. You can set up a
deadlock event monitor to monitor them. If the database was created in
version 8.2 or later then a deadlock event monitor was created by default.

An infinite lock wait can be detected and resolved by running the following
parm to change the db config:
db2 update db cfg using locktimeout 30 for db-name

This will resolve a lock wait after 30 seconds and then cancel the
transaction (-911 RC 68).
Feb 1 '07 #2

P: n/a
DB2 has an automatic process that checks for deadlocks. It "perks" up every
10 secs. by default.
If a deadlock is detected, one member will be rolled back and the other will
proceed. Unless you want a 7 day dissertation, do not ask how DB2 chooses.

If you are running DB2 V8 and up then when you create a db, by default an
event monitor called DB2 DETAILDEADLOCK with an auto start option is
created.
This means that if deadlocks are encountered and resolved, they have been
identified and detailed in the output files of the event monitor. On my
Windoze home box, they are in:
d:\instname\node0000\SQL0001\db2event

Those files need to be formatted for intelligent reading and you use the
db2evmon tool to do so.

HTH' Pierre.

--
Pierre Saint-Jacques
SES Consultants Inc.
514-737-4515
"kavin" <ka*************@gmail.coma écrit dans le message de news:
11**********************@j27g2000cwj.googlegroups. com...
hi,

can any one help me in detecting a deadlock and to clear the deadlock
when it occours?

how to monitor the databases for deadlocks?
Feb 1 '07 #3

P: n/a
On Feb 1, 1:19 am, "kavin" <kavinilammur...@gmail.comwrote:
hi,

can any one help me in detecting a deadlock and to clear the deadlock
when it occours?

how to monitor the databases for deadlocks?
I have found the db2pdcfg utility to be incredible useful when
troubleshooting deadlocks. It produces a dump of all the agents in the
database and what database objects they are busy with when a deadlock
is detected by db2. By mining this information you can solve the
concurrency problems in your application.
db2pd is also useful.

Feb 2 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.