I have some partitioned tables with DB2 LUW 10. We have one partition for each data.I am reviewing a DB2 stored procedure that runs daily detaching old data partition and creating a new partition because some days this stored procedure takes some hours to complete but usually it only takes some seconds. We found that the delay occurs in the detach processing,
According to some logic the stored procedure calculates how many partitions are going to be detached (only one usually). For each partition to be detach the stored procedure issues
ALTER TABLE DETACH; COMMIT; SET INTEGRITY FOR TABLE XXX IMMEDIATE ALL UNCHECKED;
Please can you explain me the function of the commit and set integrity commands in this stored procedure?
Under which conditions can this stored procedure takes some hours to complete the partition detach ?
Thanks you very much for your help