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
Was this topic helpful?
Document Information
Modified date:
16 June 2018
UID
swg21188578