Situation: DB2 LUW database with several tables reporting overflow.
We are attempting to determine the cause of the overflow. The tables in question do NOT have varchar
columns. Million+ rows are inserted per month. Updates to rows are mostly limited to changing a single column from a value of 0 to 1. Tables are compressed. Clustered index.
Is anyone aware of a DB2 for LUW utility that can be used to identify the specific rows which have overflowed? We are hoping that by identifying the rows we can uncover the cause of the overflow.
Currently there are two causes being entertained – the combination of compression/update or the presence of the clustered index.
Best Answer
You are likely correct to suspect compression as the cause of overflows. Having a clustered index by itself does not cause row movement outside of a reorg.
You can use the
db2dart
(Database Analysis and Reporting Tool) utility to dump formatted table pages; the "Record Type" field will identify which records have overflown. For example, runto dump all pages (
/ps 0 /np 0
) from the tableYOURTABLE
(note the uppercase name) in tablespace 2.Overflown record will appear like this:
with their actual data in the new location:
You can use the verbose flag (
/v y
) to include the actual row data in the report. For a large table you probably want to select a subset of pages by specifying a sensible value for/np
.Don't forget to
FLUSH BUFFERPOOL ALL
before runningdb2dart
on an active database, otherwise the data on disk, where the utility reads them, may not reflect changes still in the bufferpool.