473,385 Members | 1,588 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

db2diag.log doesn't capture deadlock

4
Hi DB2 Gurus,

I just want to clarify, does the db2diag.log capture a deadlock error? SQL911 with code 2 and 68.

I am using db2 V9.1 FP 5 running in RHEL4. I have done a simulation to the deadlock and locktimeout, however, the error didn't report to the db2diag.log. I am using DIAGLEVEL 3.
Is this expected? Or it should be reported in my db2diag.log?
I have enable the stmt and lock, stmt and timestamp monitor switches.
Is there any ways that to make the db2diag.log to capture the deadlock alert?

Thanks.

Regards,
Eddy Ng
Feb 3 '10 #1
4 7293
I don't how to force db2 write deadlock message to db2diag.log

Normally, when we would like to monitor deadlock we will use deadlock eventmonitor which write information to Table or File depend on your setting.
Moreover, you can force the database to send email to you when deadlock occur.
Mar 26 '10 #2
db2diag.log captures deadlock @ DIAGLEVEL 4 as the message is of type "INFO"

here is the test case :

On term1:
db2 "create db sample"
db2 "connect to sample"
db2 "create table testtab1 (col1 int)"
db2 "create table testtab2 (col1 int)"
db2 +c "lock table testtab1 in exclusive mode"

On term2:
db2 "connect to sample"
db2 +c "lock table testtab2 in exclusive mode"

On term1:
db2 +c "lock table testtab2 in share mode" # This will hang term1

On term2:
db2 +c "lock table testtab1 in share mode" # This will hang term 2

[red]
DB21034E The command was processed as an SQL statement because it was not a valid Command Line Processor command. During SQL processing it returned:
SQL0911N The current transaction has been rolled back because of a deadlock or timeout. Reason code "2". SQLSTATE=40001
[/red]

2010-04-01-14.34.12.912896-600 I2921A773 LEVEL: Info
PID : 4120592 TID : 1 PROC : db2agent (SAMPLE) 0
INSTANCE: db2inst2 NODE : 000 DB : SAMPLE
APPHDL : 0-11 APPID: *LOCAL.db2inst2.100402003258
AUTHID : DB2INST2
FUNCTION: DB2 UDB, lock manager, sqlplnfd, probe:80
DATA #1 : String, 147 bytes
Request for lock "TAB: (3, 21)" in mode "..S" failed due to deadlock
Application caused the lock wait is "*LOCAL.db2inst2.100402003252"
Statement:
DATA #2 : Hexdump, 33 bytes
0x0000000112FB1A94 : 6C6F 636B 2074 6162 6C65 2074 6573 7474 lock table testt
0x0000000112FB1AA4 : 6162 3220 696E 2073 6861 7265 206D 6F64 ab2 in share mod
0x0000000112FB1AB4 : 65 e

2010-04-01-14.34.12.913295-600 I3695A496 LEVEL: Info
PID : 4120592 TID : 1 PROC : db2agent (SAMPLE) 0
INSTANCE: db2inst2 NODE : 000 DB : SAMPLE
APPHDL : 0-11 APPID: *LOCAL.db2inst2.100402003258
AUTHID : DB2INST2
FUNCTION: DB2 UDB, access plan manager, sqlra_compile_var, probe:220
RETCODE : ZRC=0x80100002=-2146435070=SQLP_LDED "Dead lock detected"
DIA8002C A deadlock has occurred, rolling back transaction.

2010-04-01-14.34.12.945181-600 I4192A769 LEVEL: Info
PID : 4120592 TID : 1 PROC : db2agent (SAMPLE) 0
INSTANCE: db2inst2 NODE : 000 DB : SAMPLE
APPHDL : 0-11 APPID: *LOCAL.db2inst2.100402003258
AUTHID : DB2INST2
FUNCTION: DB2 UDB, trace services, sqlt_logerr_data, probe:0
DATA #1 : SQLCA, PD_DB2_TYPE_SQLCA, 136 bytes
sqlcaid : SQLCA sqlcabc: 136 sqlcode: -911 sqlerrml: 1
sqlerrmc: 2
sqlerrp : SQLRL426
sqlerrd : (1) 0x80100002 (2) 0x00000002 (3) 0x00000000
(4) 0x00000000 (5) 0x00000000 (6) 0x00000000
sqlwarn : (1) (2) (3) (4) (5) (6)
(7) (8) (9) (10) (11)
sqlstate:

2010-04-01-14.34.12.945418-600 I4962A629 LEVEL: Info
PID : 4120592 TID : 1 PROC : db2agent (SAMPLE) 0
INSTANCE: db2inst2 NODE : 000 DB : SAMPLE
APPHDL : 0-11 APPID: *LOCAL.db2inst2.100402003258
AUTHID : DB2INST2
FUNCTION: DB2 UDB, access plan manager, sqlra_compile_var, probe:225
MESSAGE : stmt
DATA #1 : Hexdump, 33 bytes
0x0000000112FB1A94 : 6C6F 636B 2074 6162 6C65 2074 6573 7474 lock table testt
0x0000000112FB1AA4 : 6162 3220 696E 2073 6861 7265 206D 6F64 ab2 in share mod
0x0000000112FB1AB4 : 65 e


Hope this answers your question.

Cheers,
Shashank K
IBM Australia
Apr 1 '10 #3
eddy82
4
Hi Shashank,

Thanks for the reply. However, to set the diaglevel 4 is not feasible as this will actually dump too many info on the db2diag.log. I have use the db2pdcfg to actually capture the deadlock.

btw, for your simulation, how often you get locktimeout and deadlock? during my simulation, the results that i got was:
a) 1 error code 2, 1 error code 68
b) 2 error code 68
does you guys faced the same issue?
Apr 1 '10 #4
not worked out shashank
<link removed: possible spam>
Apr 1 '10 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

7
by: Andrew Mayo | last post by:
Here's a really weird one for any SQL Server gurus out there... We have observed (SQL Server 2000) scenarios where a stored procedure which (a) begins a transaction (b) inserts some rows into...
3
by: Nigel Robbins | last post by:
Hi There, I'm getting a deadlock when I have two clients running the following statement. DELETE FROM intermediate.file_os_details WHERE file_uid = ? AND obj_uid There is a compound index on...
7
by: Shawn | last post by:
We are on IBM DB2 7.1 ON WINDOWS. The db2diag.log is not working and no new line written into it for few days. The last lines in db2diag.log shows: Warning: active log held by dirty pages....
1
by: Rohit Raghuwanshi | last post by:
Hello all, we are running a delphi application with DB2 V8.01 which is causing deadlocks when rows are being inserted into a table. Attaching the Event Monitor Log (DEADLOCKS WITH DETAILS) here....
6
by: p175 | last post by:
2006-08-14-17.46.13.656000-240 I1472H436 LEVEL: Warning PID : 1452 TID : 336 PROC : db2syscs.exe INSTANCE: DB2 NODE : 000 DB : SQ4V6...
14
by: Gio Galma | last post by:
how I can invoke the db2diag utility in a Windows environment? in my D:\Program Files\IBM\SQLLIB\BIN directory I can see only db2diag.dll, and it seems there isn't the command line version; which...
1
by: oddbande | last post by:
We have just upgraded a test enviroment to db2 9, and have set both the notifylevel and diaglevel to 3. But even so I get a lot of these messages in my db2diag.log: ...
0
by: cwho.work | last post by:
Hi! We are using apache ibatis with our MySQL 5.0 database (using innodb tables), in our web application running on Tomcat 5. Recently we started getting a number of errors relating to...
5
by: Norm | last post by:
Does anyone have any suggestions for securing against this vulnerability: http://nvd.nist.gov/nvd.cfm?cvename=CVE-2007-1027 Fixes are not yet available from IBM. They will be in FP2 for V9...
6
by: KG | last post by:
Hi, Does anyone knows how to recover the test file db2diag.log. By mistake I have delete the contents of db2diag.log, wondering if I could restore the contents of my db2diag.log.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.