Hi George,
I work with a lot of compressed tables and have never experienced the same problem, which leads me to believe your problem might be elsewhere.
Did you check the active locks at the time when you issued the ALTER TABLE statement (before it failed)?
For example:
-- Currently active LOCKs:
db2 "select L.APPLICATION_HANDLE, L.LOCK_OBJECT_TYPE, L.LOCK_MODE, L.LOCK_STATUS, T.TABSCHEMA, T.TABNAME from TABLE (MON_GET_LOCKS(NULL, -2)) as L left outer join SYSCAT.TABLES T on L.TBSP_ID = T.TBSPACEID and L.TAB_FILE_ID = T.TABLEID where L.LOCK_OBJECT_TYPE in ('ROW','TABLE')";
-- Who is CURRENTLY waiting (REQ_APP_HANDLE) on whose (HLD_APP_HANDLE) active locks:
db2 "select L.REQ_APPLICATION_HANDLE, L.HLD_APPLICATION_HANDLE, L.LOCK_OBJECT_TYPE, L.LOCK_MODE, L.LOCK_STATUS, T.TABSCHEMA, T.TABNAME from TABLE (MON_GET_APPL_LOCKWAIT(NULL, -2)) L left outer join SYSCAT.TABLES T on L.TBSP_ID = T.TBSPACEID and L.TAB_FILE_ID = T.TABLEID";
Hope this helps!
Regards, Damir
------------------------------
Damir Wilder
Senior Consultant
Triton Consulting
London
------------------------------
Original Message:
Sent: Tue October 29, 2024 08:14 AM
From: George Chatama
Subject: Deadlock or timeout on a compressed table
Hi team,
We recently compressed a table in db2 and did reorg on the table to save space using ALTER TABLE TABLENAME COMPRESS YES statement. This worked and we saved a lot of space. Now we want to increase the size of a specific column using ALTER TABLE, but after a short time the query is failing with the following:
The current transaction has been rolled back because of a deadlock or timeout. Reason code "68".. SQLCODE=-911, SQLSTATE=40001, DRIVER=4.27.25 SQL Code: -911, SQL State: 40001
We previously did try the same ALTER TABLE on non compressed tables and it did go through properly.
Can this be because the table has been compressed, if so how can I handle it without undoing the compression?
------------------------------
George Chatama
------------------------------