Quick Beginnings
This procedure describes how to migrate DB2 instances that were created
using a previous version of a DB2 product.
Before you can migrate an instance to use the latest version of DB2, you
must install DB2 Version 5 on your system.

|
If there are several DB2 instances using previous versions of DB2 products,
you do not need to migrate all of these instances at this time.
Instances, that are not migrated, will continue to use previous versions of
DB2 products.
|
Each DB2 instance must be migrated separately. To successfully
migrate a DB2 instance, you need to perform the following steps:
- Prepare the DB2 instance for migration.
- Verify that databases can be migrated. This step is
optional. However, we recommend that you perform this step before
migrating an instance.
- Migrate the DB2 instance.
| Note: | 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 or terminated. To
prepare a DB2 instance for migration, you need to perform the following
steps:
- Log in as the DB2 instance.
- Ensure that there are no applications using any databases owned by this
DB2 instance.
- You can get the list of all applications using databases owned by the
instance using the following command:
db2 list applications
- You can force termination of all applications using the following
command:
db2 force applications all
| Note: | It is not recommended to force termination of applications. Some
applications may have unexpected behavior when terminated using this
command.
|
For usage and details of this command, refer to your current release Command Reference.
- Get a list of applications again to ensure that all applications have
terminated, using the following command:
db2 list applications
- Stop all database server processes owned by the DB2 instance by issuing
the db2stop command.
- Stop the DB2 license daemon by issuing the db2licd end
command.
- Stop all command line processor sessions by issuing a db2
terminate command in each session that was running the command line
processor.
The DB2 instance is now ready for migration.
- Log out as the DB2 instance.
Version 5 of DB2 provides the db2ckmig migration
tool. This tool verifies whether all cataloged databases can be
migrated. The db2imigr command in "Migrate the DB2 Instance" uses the db2ckmig command to verify whether the cataloged
databases can be migrated. However, to ensure that you can migrate all
databases to Version 5, you should run the db2ckmig program before
you migrate the instance.
You must correct errors reported by this program before continuing with
instance migration. For detailed information about the
db2ckmig program, refer to the Version 5 Command
Reference .
For example, to verify that all cataloged databases can be migrated, log in
as the instance owner and use the following command:
DB2DIR/instance/db2ckmig -e -a SERVER -1 INSTHOME/migration.log
| where
| DB2DIR
| = /usr/lpp/db2_05_00
| on AIX
|
|
| = /opt/IBMdb2/V5.0
| on HP-UX or Solaris
|
and INSTHOME is the home directory of the instance.
Check the log file, INSTHOME/migration.log. If it shows any
errors, see Table 11 for suggested corrective actions.
| Note: | The log file displays the errors that occur when you run the
db2ckmig program. Check that the log is empty before
continuing with the instance migration. Backup the database after
making corrections.
|
Table 11. 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 log and stop.
|
| Table space ID 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 Database transaction inconsistent state
| Restart the database to return it to a consistent state.
|
| The database contains database objects that have a schema name of SYSCAT,
SYSSTAT, or SYSFUN
| These schema names are reserved for the Version 5 database
manager. To correct this error, do the following:
- Back up the database.
- Export the data from the database object (catalogs or tables).
- Drop the object.
- Recreate the object with the corrected schema name.
- Import/Load the data into the object.
- Run db2ckmig against the database again, ensuring that the
database passes the db2ckmig check.
- Make a backup copy of the database.
|
The database contains database objects that have a dependency on the
SYSFUN.DIFFERENCE function. Possible violated database objects
are:
- Constraint
- Function
- Trigger
- View
| 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 ensure that
database migration is successfully completed and correct this error, do the
following:
- Constraint
- Issue the alter table command to drop the constraint.
- Function
- Issue the drop function command to drop the function dependent
on SYSFUN.DIFFERENCE.
- Trigger
- Issue the drop trigger command to drop the trigger.
- View
- Issue the drop view command to drop the view.
| Note: | Any package dependent on SYSFUN.DIFFERENCE will be marked inoperative
after migration. Therefore, the db2ckmig program will not
report any package that is dependent on the SYSFUN.DIFFERENCE
function.
|
|
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 5 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:
- Change the authentication type of the instance to the previous one.
- Move the database to another instance that has the desired authentication
type.

| 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); db2ckmig does not perform any
verification of uncataloged databases.
|
Refer to the Administration Guide for more information about the actions required to correct these
conditions.

|
Follow these instructions if you are using the user exit program,
db2uexit, with previous versions of DB2.
|
DB2 Version 5 has changed the interface it uses to invoke the user exit
program to archive and retrieve log files. These new interfaces are
documented in the Administration Guide . The name for the user exit program has changed to
db2uext2 in Version 5; in previous versions, it was called
db2uexit.
The following should be considered before migrating instances:
- If the pre-version 5 db2uexit is installed in the
INSTHOME/sqllib/adm directory before migration, it will remain in this
directory after migration. The Version 5 db2uext2 program
will be also installed in this directory. Its function is to invoke
db2uexit using the pre-version 5 interface. This allows the
old user exit program to be used on Version 5.
- If db2uexit is installed in a directory other than
INSTHOME/sqllib/adm, it will not be installed after migration. For
example, if db2uexit was in the INSTHOME/sqllib/bin directory,
after migration the db2uexit file will not be in the
INSTHOME/sqllib/bin directory. If you want to continue using the old
user exit, following migration, you must copy db2uexit to
INSTHOME/sqllib/adm directory. Then, you can do one of the
following:
| Note: | You must ensure that db2uext2 is owned by the instance owner and
is executable by the owner.
|
At a convenient time, you should modify your user exit program to use the
new Version 5 interfaces. The new user exit program should replace
db2uext2 in the INSTHOME/sqllib/bin directory, used to support the
pre-version 5 user exit program, db2uexit, which should be
removed.

|
Only local cataloged databases, owned by the DB2 instance, are checked for
migration. Uncataloged databases may be unusable after the instance has
been migrated.
|
After an instance is ready for migration, use the db2imigr
command to migrate the instance. You need to perform the following
steps:
- Log in as root.
- Run the db2imigr command as follows:
DB2DIR/instance/db2imigr [-d] [-a AuthType] [-u fencedID] InstName
| where
| DB2DIR
| = /usr/lpp/db2_05_00
| on AIX
|
|
| = /opt/IBMdb2/V5.0
| on HP-UX or Solaris
|
and where:
- -d
- Sets the debug mode that you can use for problem determination
- -a AuthType
- Is an optional parameter that specifies the authentication for the
instance. Valid authentication types are SERVER, CLIENT, and
DCS. If the -a parameter is not specified, the
authentication type defaults to SERVER, if a server product is
installed. Otherwise, the AuthType is set to CLIENT.
Notes:
- The authentication type of the instance applies to all databases owned by
the instance.
- Authentication type, DCE, is valid. However, it is not valid to
choose DCE as an AuthType for this command. To enable DCE
authentication for a DB2 instance, refer to the Administration Guide.
- -u fencedID
- Is the user under which the fenced user-defined functions (UDFs) and
Stored Procedures will execute.
- InstName
- Is the login name of the instance owner.
- If there are any errors in verifying that all databases can be migrated,
see Table 11 and take the suggested corrective actions. Then, reissue the
db2imigr command.
[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]
[ DB2 List of Books |
Search the DB2 Books ]