Hardware accelerated backup and log file compression

You can achieve hardware compression for backup images and log archive files by using a nest accelerator. Supported options include the NX842 of POWER7+ and higher processors, the NXZLIB of POWER9 or higher processors, and the NXU for Linux® on IBM z Systems® 15 and later versions.

Attention: Support for the NXZLIB and NXU nest accelerators is available in Db2 11.5.7 and later versions.

Prerequisites

The following prerequisites apply when you are using the NX842 nest accelerator:

  • This solution is supported on AIX®. Minimum AIX level is AIX V7 TL3 SP3.
  • Active Memory Expansion (AME) must be licensed but not enabled. This restriction is temporary and not a technical limitation. In addition, Active Memory Sharing (AMS) must be deactivated on the logical partition (LPAR). The NX842 compression units are typically not used for AME on database servers since deep row compression, adaptive compression, and index compression can make memory compression inefficient.
  • The CPU must be a POWER7+ or later.
  • The following minimum firmware levels are recommended for POWER8: FW820.50, FW830.30 or FW840.40.
    Remember: If the kernel requirements are met, it is possible to recover by using the backup images and log files that were compressed with NX842 on previous POWER® versions.
  • The NX842 compression units are typically not used for AME on database servers since deep row compression, adaptive compression, and index compression can make memory compression inefficient.
The ZLIB compression method is supported on AIX and Linux on IBM z Systems. The following prerequisites apply:
  • The minimum AIX level is AIX V7.2 TL5 SP3, running on a system equipped with a POWER9 or later CPU. In addition, the firmware level FW940 or later is required. The Power9 processor needs to run in Power9 mode and not in Power9_base mode.
    On AIX, you can use nxstat -S if the ZLIB accelerator is available.
    nxstat -S
    Need to show

    GZIP accelerator available
  • The Linux on IBM z Systems version must be z15 or higher, running on a system with a CPU that supports the deflate feature. Check the features line of the /proc/cpuinfo file to see whether it contains dflt:
    cat /proc/cpuinfo
    ...
    features        : esan3 zarch stfle msa ldisp eimm dfp edat etf3eh highgprs te vx vxd vxe gs vxe2 vxp sort dflt sie
    ...
Note: On AIX systems, you can run the command db2pd -osinfo to check whether the accelerators are available. Availability is displayed in the output lines containing NX842 and NXZLIB.
The example below shows a sample output:
db2pd -osinfo

Operating System Information:

OSName:   AIX
NodeName: hotelaix7
Version:  6
Release:  1
Machine:  00C45AC54C00
AME    :  Disabled
AMS    :  Disabled
NX842  :  Operational
NXZLIB :  n/a

Advantages of using this solution

  • Fast compression can be achieved through the special hardware compression units NX842 or NXZLIB on POWER CPUs and NXU on z processors. The general CPU resources are not used for this compression.
  • The compression algorithm in hardware provides faster compression than the common Db2® compression.

Hardware compression for backup operations

To start a backup that uses either hardware compression or ZLIB compression, it is necessary to specify the library.

To specify the library for hardware compression, run the following command:
backup database databasename compress comprlib libdb2nx842.a
To specify the library for ZLIB compression, run the following command:
backup database databasename compress comprlib libdb2zcompr.so
Note: The ZLIB compression runs with hardware support if the prerequisites are met.
The backups can be compressed by default with either NX842 or ZLIB compression. To achieve this backup compression, the registry variable DB2_BCKP_COMPRESSION must be set to either NX842 or ZLIB. After you set the registry variable, issue the following command:
backup database databasename compress
The image is then compressed by using the selected hardware compression method.

Hardware compression for log archive compression

The NX842 hardware compression can also be used for log archive compression. To activate hardware compression for log archive compression, change the database configuration parameter LOGARCHCOMPR1 or LOGARCHCOMPR2 to NX842 by running the following command:
update database configuration for databasename using LOGARCHCOMPR1 NX842
Note: The LOGARCHCOMPR1 and LOGARCHCOMPR2 parameters can take different values. For example, the common Db2 compression can be used for LOGARCHCOMPR1 and NX842 compression for LOGARCHCOMPR2:
update database configuration for databasename using LOGARCHCOMPR1 ON
update database configuration for databasename using LOGARCHCOMPR2 NX842
For more information on NX842 compression, refer to POWER NX842 Compression for Db2.
The ZLIB compression can also be used for log archive compression. To activate ZLIB compression for log archive compression, change the database configuration parameter LOGARCHCOMPR1 or LOGARCHCOMPR2 to ZLIB using the following command:
update database configuration for databasename using LOGARCHCOMPR1 ZLIB
Note: The LOGARCHCOMPR1 and LOGARCHCOMPR2 parameters can take different values. For example, the common Db2 compression can be used for LOGARCHCOMPR1 and ZLIB compression for LOGARCHCOMPR2:
update database configuration for databasename using LOGARCHCOMPR1 ON 
update database configuration for databasename using LOGARCHCOMPR2 ZLIB
The ZLIB compression runs with hardware support if the prerequisites are met.

Encrypted backup creation using hardware compression for AIX systems

You can create encrypted backups that take advantage of NX842-accelerated compression, using the unified compression and encryption library, libdb2nx842_encr.a. This option is currently available only to users running Db2 on the AIX platform.

Currently, the DB2_BCKP_COMPRESSION registry variable cannot be used to specify joint compression and encryption operations for your Db2 backups. If neither your database nor your backups are currently encrypted and you wish to use NX842 hardware compression, you need to first the set the DB2_BCKP_COMPRESSION variable to use NX842:
$ db2set DB2_BCKP_COMPRESSION=NX842
Once your database is encrypted, you can set Db2 to use NX842-accelerated compressed backups automatically:
$ db2 connect to <your database> $ db2 update db cfg using encrlib libdb2nx842_encr.a

Encrypted backup creation using zlib compression

If your database is encrypted and you want to use ZLIB compression, set Db2 to use the compression library for your operating system.

For AIX users:
$ db2 connect to <your database> $ db2 update db cfg using encrlib  libdb2zcompr_encr.a
For Linux users:
$ db2 connect to <your database> $ db2 update db cfg using encrlib  libdb2zcompr_encr.so
For Windows users:
$ db2 connect to <your database> $ db2 update db cfg using encrlib  libdb2zcompr_encr.dll