Archived log file compression
As of Db2® 10.1, you can compress archived log files. This capability, in addition to data and index compression, along with backup compression, reduces the amount of disk space required for your database environment.
Archived log files are the third major space consumer for roll-forward recoverable databases. Archived log files contain a significant amount of data and these archives can grow quickly. If modified data is already in compressed tables, logging is reduced by virtue of including compressed record images in log records. Compression of archived log files further increases storage savings, even in these environments.
To use compression for your archived log files, you can use the UPDATE DB CFG command to set the logarchcompr1 and logarchcompr2 configuration parameters to ON.
Restrictions
- Archived log file compression does not take effect under the following
conditions.
- The corresponding archived log file method is not set to DISK, TSM, VENDOR, or DB2REMOTE. When the corresponding archived log file method is set as described, the log files are physically moved out of the active log path, or the mirror log path.
- Whenever archived log file compression is enabled, but the corresponding
log archiving method is set to OFF, LOGRETAIN or USEREXIT,
archived log file compression has no effect. Any update to the logarchmeth1 and logarchmeth2 or
the logarchcompr1 and logarchcompr2 database
configuration parameters which results in such a scenario returns
a warning, SQL1663W.Note: When the database is activated, SQL1663W is not returned when setting or changing archived log file compression database configuration parameters. Instead, SQL1363W is returned, which is a higher priority message. If the database is not activated, the SQL1663W warning message is returned.
- Manual archiving and retrieval with db2adutl.
- The db2adutl utility does not perform compression or decompression during UPLOAD or EXTRACT operations. Movement of compressed log files to and from the archive location is fully supported by db2adutl.
- If
logs are uploaded to
IBM Storage Protect, formerly Tivoli Storage Manager (TSM),
with db2adutl, and you want to compress archived log files, archived log file
compression must be enabled when the logs are archived to the disk location, before
db2adutl picks them up. If compressed logs are retrieved manually with
db2adutl, they are decompressed on first access.Note: As of version 8.1.19, IBM Storage Protect is the new product name for Tivoli Storage Manager (TSM). For more information, see IBM Storage Protect Downloads - Latest Fix Packs and interim fixes
- Archived log file compression is not supported when raw devices
are used for database logging.
- Archived log file compression is not supported when either the logpath or the newlogpath database configuration parameters point to a raw device. Any database configuration update that results in archived log file compression being enabled while logpath or newlogpath database configuration parameters point to raw devices fails, SQL1665N.
- When enabling archived log file compression using the logarchcompr1 and logarchcompr2 database configuration parameters, logs already stored in a backup image are not affected.