Results 1 to 5 of 5
  1. #1
    Join Date
    Jul 2002
    Posts
    3

    Lightbulb Unanswered: 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

  2. #2
    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.

  3. #3
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    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)

    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.

  4. #4
    Join Date
    Aug 2001
    Location
    UK
    Posts
    4,650

    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

    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.

  5. #5
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •