If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > DB2 > Deadlock Problem

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 10-20-03, 18:48
pablo1 pablo1 is offline
Registered User
 
Join Date: Jul 2002
Posts: 3
Lightbulb Deadlock Problem

Can anybody tell me how can get a trace or even logging the statements that produces deadlocks in a DB2 UDB 7.2 db server ?

Thanks in advance.

Pablo
Reply With Quote
  #2 (permalink)  
Old 10-21-03, 01:43
dr_suresh20 dr_suresh20 is offline
Registered User
 
Join Date: Sep 2003
Posts: 218
1] For obtaining the trace, you can modify db2cli.ini file located at "DB2PATH" (db2 installation path). Set the "trace" flag under [COMMON] section to "1". This will enable the logging. Please ensure that you have enough disk space though... Resetting the value to 0 will stop logging.

[COMMON]
trace=0
TraceFileName=c:\trace.log
traceflush=1

2] For your second part of the question; One can enable snapshot monitors so that we can find out which statements are producing deadlocks.
--** Enable monitor switches
DB2 UPDATE MONITOR SWITCHES USING bufferpool ON lock ON sort ON statement ON table ON uow ON
DB2 GET MONITOR SWITCHES

--**To get snapshot of lock information
DB2 GET SNAPSHOT FOR locks ON {db_name} > c:\temp\locks_{db_name}txt

Besides, make sure you have proper value set for parameters like "LOCKTIMEOUT" and related ones. Refer the db2 performance tuning guide for more information.

Hope this helps.
Reply With Quote
  #3 (permalink)  
Old 10-21-03, 03:32
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Re: Deadlock Problem

Or you can use Event Monitor ...

(I will post the steps from workplace ... I do not have a copy of the doc with me at home now)

Quote:
Originally posted by pablo1
Can anybody tell me how can get a trace or even logging the statements that produces deadlocks in a DB2 UDB 7.2 db server ?

Thanks in advance.

Pablo
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #4 (permalink)  
Old 10-21-03, 11:36
sathyaram_s sathyaram_s is offline
Super Moderator
 
Join Date: Aug 2001
Location: UK
Posts: 4,534
Re: Deadlock Problem

Create :
create event monitor mon1
for deadlocks
write to file '/tmp/evmon'
nonblocked append
;

Start :
set event monitor mon1 state 1;

Simulate the deadlock error ,,,

Stop:
set event monitor mon1 state 0;

Query State:
select evmonname,event_mon_state(evmonname) from syscat.eventmonitors"
;

Report :

db2evmon -db <dbname> -evm mon1


HTH

Sathyaram

Quote:
Originally posted by sathyaram_s
Or you can use Event Monitor ...

(I will post the steps from workplace ... I do not have a copy of the doc with me at home now)
__________________
Visit the new-look IDUG Website , register to gain access to the excellent content.
Reply With Quote
  #5 (permalink)  
Old 10-21-03, 14:27
pablo1 pablo1 is offline
Registered User
 
Join Date: Jul 2002
Posts: 3
Re: Deadlock Problem

well, i started the monitor and traying to find out wich statement is generating the deadlocks.

sathyaram_s thanks a lot for the piece of information

thanks dr_suresh20 too

Pablo1
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On