Chapter 3. Administration and management 67
If you use a user-provided compression library, the library is stored in the backup
image by default and will be used on restore. The command syntaxes are:
DB2 BACKUP DATBASE sample COMPRESS COMPRLIB libname COMPROPTS options
DB2 RESTORE DATABASE sample COMPRLIB libname COMPROPTS options
In these examples, COMPROPTS is used to pass the options to the compression
library.
Use of the automatic database function could create some CPU costs due to the
compression computation. However, the media I/O time will be decreased
because the image size is smaller. The overall backup/restore performance
impact depends on whether CPU or media I/O is a bottleneck of the system.
3.1.4 Logs in backup images
DB2 transaction log files are essential for restoring and recovering a database or
table space to a consistent point in time using online backup images. Prior to
Version 8.2, the backup and restore utilities required shipping the backup image
and corresponding log files as separate objects to the disaster recovery sites.
This risks losing the log files required for recovery. The new enhancement
enables you to include the logs on the online backup. This way, you can ship the
backup images with the log files to ensure that the backup will be restorable if
archived logs are misplaced. This feature supports all types of online backups
such as database, table space, incremental, and compressed.
If the INCLUDE LOGS option is specified in the backup command, DB2 will
truncate the tail log file and close it after the table space or database is backed
up. All logs that are needed to restore the backup and roll forward to the time
corresponding to the end of the backup are placed in the backup image. DB2
backs up log files in parallel with backing up the table space data. If database
backup compress is specified, the log files will be compressed as well.
By default, the log will not be backed up with the database or table space backup
image. To use this feature, specify the INCLUDE LOGS option in the backup
command, such as:
DB2 BACKUP DB sample ONLINE TO d:\db2backup INCLUDE LOGS
When restoring the database, specify the directory where you want DB2 to place
the log files. For example:
RESTORE DB sample ONLINE FROM d:\db2bckup LOGTARGET d:\db2logs
ROLLFORWARD DB sample TO END OF LOGS AND STOP OVERFLOW LOG PATH d:\db2logs
You also can restore log files only from the integrated backup image:
RESTORE DB sample LOGS FROM d:\db2backup LOGTARGET d:\db2logs

Get DB2 UDB V8.2 on the Windows Environment now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.