DB2 10.5 for Linux, UNIX, and Windows

Verifying that your databases are ready for upgrade

Before you upgrade your databases, it is important to use the db2ckupgrade command to verify that your databases are ready for upgrade.

The db2ckupgrade command verifies that a list of conditions is true in order to succeed at the database upgrade. Also, this command writes to the log file, specified with the -l parameter, a warning message for a list of conditions that affect database upgrades. See the Command Reference for details about the list of conditions.

The db2iupgrade calls the db2ckupgrade command. The db2iupgrade fails if the db2ckupgrade command finds any of the conditions are not true, and returns the error code DBI1205E.

Before you begin

Procedure

To verify that your databases are ready for upgrade:

  1. Log on to the DB2 server as the DB2 instance owner that you want to upgrade.
  2. If the instance that owns the the databases that you want to verify is not running, start the instance by running the db2start command.
  3. From the command-line prompt, change to the appropriate directory:
    • On UNIX or Linux operating systems, change to the DIRIMG directory, where DIRIMG is the location where you decompressed the DB2 Version 10.5 installation image or the directory where you mounted the DB2 product DVD.
    • On Windows operating system, insert the DB2 Version 10.5 product DVD in the drive and change to the \db2\Windows\utilities directory. Or change to the DIRIMG directory, where DIRIMG is the location where you decompressed the DB2 Version 10.5 installation image.
  4. Verify that the local databases that are owned by the current instance are ready to be upgraded and generate a log file by running the db2ckupgrade command, as follows:
        <DIRIMG> db2ckupgrade sample -l db2ckupgrade.log -u adminuser -p password
        db2ckupgrade was successful.  Database(s) can be upgraded.
    where:
    • DIRIMG is the location where you decompressed the DB2 Version 10.5 installation image or the directory where you mounted the DB2 product DVD.
    • sample is the database name
    • db2ckupgrade.log is the log file that is created in the current directory that includes details on errors and warnings

    When the db2iupgrade command runs the db2ckupgrade command, the update.log log file is specified for db2ckupgrade in the instance home directory for Linux and UNIX operating systems or in the current directory for Windows operating systems.

    In a partitioned database environment, run the db2ckupgrade command only once. It checks all partitions. Similarly, in a DB2 pureScale® environment, run the db2ckupgrade from only one member node.

  5. If you created user-defined data types using a name that is a system built-in data type name, drop these user-defined data types and re-create them using a different name that is not restricted. The db2ckupgrade command returns the SQL0473N error message when user-defined data types have a name that is a system built-in data type name. If you try to upgrade the database, the UPGRADE DATABASE command fails.
  6. If you created user-defined objects that are dependent on discontinued administrative routines, drop the dependent objects and re-create them using the routine or view that replaces the discontinued routine. The db2ckupgrade command returns the DBT5534W warning message when a user-defined object is dependent on discontinued administrative routines. If you upgrade a database that has dependent objects, the UPGRADE DATABASE command drops the discontinued administrative routines and marks the dependent objects inoperative or invalid.

    For more details, see Some administrative routines are discontinued

  7. If you created workload management objects that have a conflict with system-reserved ID during database upgrade, drop these objects and re-create them after you upgrade the database. The db2ckupgrade command returns the DBT5512E error message when a workload management object cannot be upgraded because the ID of that object conflicts with a system-reserved ID. Perform the following actions:
    1. Generate the DDL statements to re-create the workload management objects by issuing the db2look command with the wlm parameter.
    2. Drop all of the workload management objects from the database.
    After upgrading the database, re-create the workload management objects in the upgraded database by issuing the DDL statements that you generated with the db2look command.
  8. If you created database objects using restricted schema names, drop all the database objects that use reserved schema names and re-create them using a schema name that is not restricted. The db2ckupgrade command returns the SQL0553N error message when database objects have restricted schema names. If you try to upgrade the database, the UPGRADE DATABASE command fails.
  9. If you have identifiers called NULL for column names, routine parameter names, or variable names, qualify, or delimit with quotes these identifiers in your SQL statements to avoid conflict with the NULL keyword.

    The db2ckupgrade command writes the ADM4102W warning message to the log file when a database has identifiers called "NULL". If you use identifiers called "NULL" that are not fully qualified or delimited with quotes in your SQL statements, the identifier name might resolve to the NULL keyword instead. This would result in a change in behavior from previous releases. See Upgrade impact from SQL statement changes for details.

  10. If workload connection attributes contain asterisks (*), replace the asterisks (*) with another character. The db2ckupgrade command writes the ADM4103W warning message to the log file when workload connection attributes contain asterisks (*).

    Starting with DB2 Version 9.7, you can use a single asterisk (*) as a wildcard character. In some workload attributes, if the intention is to represent an actual asterisk, then you can use two asterisks (**). The UPGRADE DATABASE command replaces the single asterisk (*) with two asterisks (**) depending the type of connection attribute.

  11. If you created global variables of XML data type or created compiled SQL functions with parameters of XML data type or XML data type in the RETURNS clause, you must upgrade to the Version 10.1 Fix Pack 1 software or later fix pack releases that support the XML data type in these database objects. If you decide to upgrade to the Version 10.1 software, you must drop these database objects and re-create them specifying a supported data type.

    The db2ckupgrade command writes the ADM4004W warning message to the log file when a database has global variables of XML data type or compiled SQL functions with parameters of XML data type or XML data type in the RETURNS clause. The XML data type is not supported on these database objects. Therefore, these database objects are invalidated during the database upgrade.

  12. Ensure that the log file for db2ckupgrade command contains the following text: Version of DB2CKUPGRADE being run: Version 10.5. This text confirms that you are running the correct level of the db2ckupgrade command.
  13. Check and fix any invalid flavor fields on SQLSPCS files by using the fixtbspflvr tool. Details about this tool can be obtained from http://www.ibm.com/support/.