Detecting and managing deadlocks


Deadlocks occur when a transaction cannot proceed because it is dependent on exclusive resources that are locked by some other transaction, which is in turn dependent on exclusive resources in use by the original transaction. With PATROL for DB2 UDB, you have the ability to monitor deadlocks in a database.

To monitor deadlocks, the KM using DB2 Event Monitoring which can impact performance. BMC recommends that you only run deadlock detection during the time that you suspect that there might be deadlocks in the database.

To monitor deadlocks, you must first turn on deadlock detection with the Monitor Deadlocks command. Access the Deadlock Detection menu from the Lock icon. The Lock icon appears in a database object window and serves as a container for the parameters associated with database locks.

Note

  • For DB2 UDB version 9.7, a Configure Default Account user must have the DBADM authority to monitor deadlocks. You can grant this authority to the user by using the following DB2 command:

db2 grant DBADM on database to user userName

  • You cannot monitor deadlocks for remote databases.
  1. Right-click on the Lock icon and select Deadlock Detection.
  2. select one of the following commands from the submenu:
    • Monitor Deadlocks
    • Pause Deadlock Detection
    • Resume Deadlock Detection
    • Stop Deadlock Detection
    • Show Deadlocks

Note

After stopping deadlock detection with the Stop Deadlock Detection command, you must use the Monitor Deadlocks command to restart detection. You can also get information about deadlocks by double-clicking the Deadlock parameter in the Lock container window.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*