You can
combine the DATA CAPTURE CHANGES clause with the COMPRESS YES STATIC
or COMPRESS YES ADAPTIVE option for the CREATE TABLE and ALTER TABLE
statements to enable row compression on source tables for replication.
When
you enable compression, if you also specify the DATA CAPTURE CHANGES
clause as part of the commands REORG TABLE or LOAD
REPLACE, a source table can have two table-level compression
dictionaries: an active table-level compression dictionary and
a historical compression dictionary. In other words,
if DATA CAPTURE CHANGES is enabled, the table-level compression dictionary
is not replaced when you run the REORG TABLE or LOAD
REPLACE commands. Instead, a new dictionary is generated,
and the previous dictionary is retained.
The
historical compression dictionary makes it possible for the db2ReadLog API
to extract the row contents in log records that were written before
the active dictionary was rebuilt as a result of specifying the RESETDICTIONARY option
with a REORG TABLE or LOAD command.
Note: To
have log readers return the data within log records in an uncompressed
format instead of a raw compressed format, you must set the iFilterOption parameter
of the db2ReadLog API to DB2READLOG_FILTER_ON.
If you specified the DATA CAPTURE NONE option
as part of the CREATE TABLE statement used to create the table, then
issuing the REORG TABLE command or performing table
truncate operations by issuing the LOAD REPLACE, IMPORT
REPLACE, or TRUNCATE TABLE command removes
the historical compression dictionary for the table.
To see whether there is a historical dictionary
present for the table, check the HISTORICAL_DICTIONARY column in the
result set of the ADMIN_GET_TAB_DICTIONARY_INFO table function.