Question & Answer
An error will occur if you create a database backup using the COMPRESS option within a 32-bit instance and then attempt to restore that backup to a 64-bit instance. The error is: SQL2570N A database cannot be restored on a platform that does not match the platform on which the backup image was created.
DB2® Universal Database™ (DB2 UDB) will attempt to read the compression library that resides within the backup image. In this scenario, since the backup is from a 32-bit instance, a 64-bit instance is unable to read the compression library that resides within the backup image.
If you want to restore a compressed DB2 UDB backup from a 32-bit instance into a 64-bit instance, you need to specify the COMPRLIB option in your RESTORE command. The COMPRLIB option allows you to specify the 64-bit version of the compression library within the restore command so that DB2 UDB does not attempt to read it from the image.
Below is an example of a failing restore command followed by a successful restore command. The example output is obtained from a Linux® environment, but the commands and output would be similar on other operating systems (with the exception of the actual compression library name used).
Failing restore command:
db2 "restore database sample from /UDB/dbdump1/ntdmpi31/SAMPLE/comp taken at 20050516121941 into sample replace existing redirect parallelism 4 without prompting"
Successful restore command:
db2 "restore database sample from /UDB/dbdump1/ntdmpi31/SAMPLE/comp taken at 20050516121941 into sample replace existing redirect parallelism 4 comprlib libdb2compr.so without prompting"
The compression library names on different operating systems are as follows:
- AIX®: libdb2compr.a
- Solaris: libdb2compr.so
- HP-UX: libdb2compr.sl
- Linux: libdb2compr.so
- Windows®: db2compr.dll
All of them are located in the instance home directory under the subdirectory sqllib/lib, except for on Windows, where it is found in sqllib\bin.
16 June 2018