Upgrading a Db2 server by using online backups from a previous release

You can rebuild your database on a previous release by using online database backups from the same release and then upgrade to Db2 version 12.1.

Before you begin

Before upgrading your Db2 server:
  • Ensure that you have root access on Linux® and UNIX operating systems or Local Administrator authority on Windows.
  • All necessary full or incremental online pre-Db2 version 12.1 database backups of your databases so that you can rebuild your databases by using these online backups.


Restrictions

Perform this task only under the following conditions:
  • If you cannot upgrade the existing instances and databases.
  • If you did not perform full offline database backups recently or incremental offline database backups as indicated in Pre-upgrade tasks for Db2 servers.

Procedure

To upgrade a Db2 server by using online backups from a previous release:

  1. Transfer pre-Db2 version 12.1 online database backup files for all the databases that you want to upgrade to the Db2 server.
  2. If you do not have a Db2 copy with the same version as the online database backups, install a Db2 copy of the same version.
    For example, if you performed the online database backups from a version 11.1 copy, you must have a version 11.1 copy installed on the Db2 server.
  3. If you do not have an instance running on the Db2 copy with the same version as the online backups, create an instance under this Db2 copy.
  4. Log on to the Db2 server as a user with SYSADM authority.
  5. Rebuild your databases by using the RESTORE DATABASE command with the REBUILD WITH ALL TABLESPACES IN DATABASE parameter followed by the ROLLFORWARD DATABASE command.
    For example:
    RESTORE DB db-name 
            REBUILD WITH ALL TABLESPACES IN DATABASE
            TAKEN AT timestamp-backup;
    ROLLFORWARD DB db-name 
            TO END OF LOGS AND STOP;

    You can choose to rebuild your database with just a subset of table spaces. However, you must drop all table spaces in restore pending state after you issue the ROLLFORWARD DATABASE command. You cannot upgrade databases with table spaces in restore pending state.

  6. Verify that the databases that you rebuild are in consistent state by issuing the GET DB CFG command as shown in the following example for Windows operating system:
    db2 GET DB CFG FOR sample | FIND "All committed transactions have been written"
    
    All committed transactions have been written to disk = YES
  7. Upgrade the Db2 server by using one of the following tasks: