Db2 command actions to upgrade instances and databases

Learning what actions take place when you invoke the commands to upgrade instances and databases gives you a better understanding of the upgrade process for Db2 servers.

Instance upgrade
When the instance upgrade is called explicitly using the db2iupgrade command, or implicitly when you install Db2 version 12.1 on Windows and select the Work with Existing option and then choose a pre-version 12.1 copy with the upgrade action, the command does the following things:
  • Calls the db2ckupgrade command.
  • Upgrades an existing instance to a new instance under a Db2 version 12.1 copy.
  • Upgrades instance profile registry variables. The global profile registry variables set by the user are not upgraded.
  • Upgrades the database manager configuration file.
  • Sets the jdk_path database manager configuration parameter.
  • Upgrades the db2audit.cfg audit configuration file when the audit facility is enabled.
  • Uses the SSLconfig.ini SSL configuration file to set the new database manager configuration parameters to the corresponding SSL parameter value in this file and upgrades the instance profile registry setting DB2COMM=SSL.
For a successful instance upgrade, all files must exist for all instances and all files must have write access granted.

Review the db2iupgrade command for more information about the command and the options that can be specified.

Database directory upgrade

The database directory is accessed when you issue commands such as LIST DATABASE DIRECTORY or UPGRADE DATABASE command.

Database upgrade
When the database upgrade is called explicitly using the UPGRADE DATABASE command the following database entities might be converted during the database upgrade:
  • Database configuration file
  • Log file header
  • Global log file header file
  • Table root page for all tables
  • Index root page for all tables
  • Catalog tables
  • Storage group files
  • Buffer pool files
  • Table space files
  • History file

The UPGRADE DATABASE command upgrades the files SQLSPCS.1, SQLSPCS.2 , SQLSGF.1, and SQLSGF.2 to support new functionality on automatic storage table spaces such as removing storage paths from a database and rebalancing automatic storage table spaces after you add or drop storage paths from a database.

The UPGRADE DATABASE command automatically collects statistics for all system catalog tables during database upgrade. The following table shows the RUNSTATS command called for the automatic collection of statistics:
Table 1. RUNSTATS command for automatic statistics collection
auto_runstats User profile RUNSTATS command
Enabled Exists RUNSTATS command with the SET PROFILE parameter using the information in the STATISTICS_PROFILE column in SYSCAT.TABLES.
Enabled Does not exist RUNSTATS command with default parameters
Disabled N/A RUNSTATS command from the most recent call to the RUNSTATS command.1
Note:
  1. If statistics were previously collected for the table, the RUNSTATS command is issued as indicated in the table. If there are no statistics collected for the table, the RUNSTATS command is not issued.

The automatic collection of statistics for all system catalog tables ignores any exclusion policies defined in the health monitor. Also, if you have manually modified your system catalog table statistics via updates to SYSSTATS views, manually reissue these updates to the SYSSTATS views.