This procedure describes how to migrate DB2 instances that were created
using a previous version of DB2.
![]() |
To update a Version 6 single-partition database system to a Version 6
partitioned database system, you must update the instance using the
db2iupdt command. For more information on the
db2iupdt command, refer to the Command
Reference.
|
Each DB2 instance must be migrated separately. To successfully migrate a DB2 instance, perform the following steps:
Step 1. | Prepare the DB2 instance for migration. |
Step 2. | Verify that the databases can be migrated. There are also migration considerations you should take into account if you are using the Version 2 user exit program. |
Step 3. | Migrate the DB2 instance.
|
If you want to migrate several instances, you must repeat these steps for each instance.
Before you can migrate a DB2 instance, all applications using any databases owned by this instance must be completed. To prepare a DB2 instance for migration, perform the following steps:
The DB2 instance is now ready for migration.
DB2 provides the db2ckmig migration command which
is used to verify whether all cataloged databases can be migrated.
![]() |
To ensure that you can migrate the instance to DB2 Enterprise - Extended Edition, you should run the db2ckmig command. If instance migration failed, you must correct errors reported by this command. You can choose to run the db2ckmig command again to verify that the errors have been corrected and then migrate the instance. For detailed information about the db2ckmig command, refer to
the Command Reference.
|
To verify that all cataloged databases can be migrated, perform the following steps:
Step 1. | Log in as the instance owner. | ||||||||
Step 2. | Enter the following command: DB2DIR/bin/db2ckmig -h -a 0 -l INSTHOME/migration.log
and INSTHOME is the home directory of the instance and migration.log is the name for the output file. | ||||||||
Step 3. | Check the log file. The log file displays the errors that occur when you run the db2ckmig command. If it shows any errors, see Table 13 for suggested corrective actions. In the partitioned database system, errors may be returned at the database partition level. | ||||||||
Step 4. | Check that the migration log file is empty before continuing with the instance migration. | ||||||||
Step 5. | Backup the database after making corrections. See Table 13 for more information on correcting error messages.
|
All local databases now have the same authentication type as the instance where they reside; the authentication type in the database directory is ignored by DB2 Version 6 servers. If a warning is logged due to a conflicting authentication type, and you want a database to retain its previous authentication type, then you can do one of the following:
![]() | Before changing the authentication type of the instance, you should make
sure that the new authentication type will be appropriate for all databases
residing there. Be certain to consider the security implications of the
different authentication types.
If there are databases that you do not want to migrate, you can uncatalog them (along with all aliases). The db2ckmig command does not perform any verification of uncataloged databases.
|
Refer to the Administration Guide for more information about the actions required to correct these
conditions.
Table 13. Correcting Error Messages
Error | Action | ||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
A database is in backup pending state | Perform a backup of the database. | ||||||||||||||
A database is in roll-forward pending state | Recover the database as required. Perform or resume a roll-forward database to end of logs and stop. | ||||||||||||||
Table space ID is not in normal state | Recover the database and table space as required. Perform or resume a roll-forward database to end of logs and stop. | ||||||||||||||
A database is in an inconsistent state | Restart the database to return it to a consistent state. | ||||||||||||||
The Version 2 database contains database objects that have a schema name of SYSCAT, SYSSTAT, or SYSFUN | These schema names are reserved for the Version 6 database
manager. To correct this error, perform the following steps:
| ||||||||||||||
The Version 2 database contains database objects that have a dependency
on the SYSFUN.DIFFERENCE function. Possible violated database
objects are:
| The SYSFUN.DIFFERENCE function must be dropped and recreated
during database migration. However, if there is a database object that
is dependent on this function, migration will fail. To correct this
error:
| ||||||||||||||
The database contains user-defined distinct types (UDTs) that use the type name BIGINT, DATALINK, REAL or REFERENCE. | These data type names are reserved for the Version 6 database
manager. To correct this error, perform the following steps:
| ||||||||||||||
Structured type and function have the same name. | A structured type and function (with no arguments) belonging to the same
schema cannot have the same name. The type or function and objects
using the type or function have to dropped and recreated using another
name. To correct this error, perform the following steps:
|
![]() |
These instructions apply only to the DB2 Version 2.x
db2uexit user exit program. If you are not using the Version
2.x db2uexit user exit program, skip this section and go to Installing DB2 Version 6.
|
DB2 Version 6 uses the db2uexit user exit program to archive and retreive log files. For more information on the db2uexit interfaces, refer to the Administration Guide.
If you are using the Version 2.x user exit program, you should consider the following before migrating instances:
cp DB2DIR/misc/db2uext2.v2 INSTHOME/sqllib/adm/db2uext2
| where DB2DIR | = /usr/lpp/db2_06_01 | on AIX |
|
| = /opt/IBMdb2/V6.1 | on Solaris |
Note: | You must ensure that db2uext2 is owned by the instance owner and is executable by the owner. |
If you are migrating from DB2 Version 2.x, you should modify your user exit program to use the DB2 Version 6 interfaces. The new user exit program db2uexit should replace db2uext2 in the INSTHOME/sqllib/adm directory.
After you have successfully completed the pre-installation checks, you can now start installing DB2 Version 6 using either the interactive or distributed method. For installation procedures, see the following sections:
![]() |
Only local cataloged databases that reside in the DB2 instance are checked
for migration. Uncataloged databases may be unusable after the instance
has been migrated. Refer to the Administration
Guide for further information.
|
After an instance is ready for migration, use the db2imigr command to migrate the instance as follows:
![]() |
If the library_path environment variable is set to /usr/lib on AIX or /opt/lib on Solaris, and there is a link in /usr/lib or /opt/lib to the Version 6 libdb2 shared library, this can cause an error when using the db2imigr command. To fix the error, you should reset the library_path environment variable so that it does not reference the libraries in those paths by entering the following command: unset library_path where library_path represents:
After migrating the DB2 instance, you should reset LIBPATH to its
original setting.
|
DB2DIR/instance/db2imigr [-d] [-a AuthType] [-u fencedID] InstName
| where DB2DIR | = /usr/lpp/db2_06_01 | on AIX |
|
| = /opt/IBMdb2/V6.1 | on Solaris |
and where:
Notes:
![]() |
Because the INSTHOME directory is NFS mounted on all machines,
you only have to run the db2imigr command on one machine to migrate
the entire instance.
|
![]() |
If you are migrating a DB2 Version 2.1 or Version 5 instance, created on AIX, and the instance uses the environment variable DB2SORT set to a keyword SMARTSORT, you must set the registry value db2sort after the instance is migrated to Version 6. Set the db2sort registry value to the run time library for the sort command as follows: db2set DB2SORT="/usr/lib/libsort.a" |