IBM Support

Deadlocks can occur when running RUNSTATS with ALLOW READ or ALLOW WRITE ACCESS

Question & Answer


Question

Using the ALLOW READ ACCESS or ALLOW WRITE ACCESS options on the RUNSTATS command does not prevent the possibility of deadlocks, lock waits, or lock timeouts.

Answer

The documentation for the runstats command specifies that the ALLOW READ ACCESS and ALLOW WRITE ACCESS options will allow access to the table while the statistics are being calculated.

These options prevent DB2® Universal Database™ (DB2 UDB) product from exclusively locking the table for which statistics are being obtained, but they do not affect the locks acquired on system catalog objects.

When the runstats utility has finished examining the table, it must write the updated statistics into the catalogs. This procedure requires appropriate locks to be obtained in order to perform the update. The entry for the table in the catalog cache will be updated as well, which will require catalog cache locks. If another application is accessing the system catalog table at the same time, you might experience lock waits or even deadlocks.

Since the occurrence of the lock wait or deadlock depends on timing, you might or might not experience one. If a deadlock or timeout occurs, resubmit the statement and the procedure will likely succeed.

Related Information

[{"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Performance - Lock-Latch","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"},{"code":"PF027","label":"Solaris"},{"code":"PF033","label":"Windows"}],"Version":"9.1;8","Edition":"Enterprise;Personal;Workgroup;DB2 UDB Express","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 June 2018

UID

swg21188578