IBM Books

Quick Beginnings for DB2 Connect Enterprise Edition


Migrating Instances

This procedure describes how to migrate DB2 instances that were created using a previous version of DB2.

If you upgraded your installed DB2 product by applying a PTF or a FixPak, you should update instances, using the db2iupdt command, instead of migrating them. Instance updates do not apply to DB2 Product Documentation and DB2 Product Messages. See Updating Instances on UNIX Systems for further information.

Before you can migrate an instance to use the latest version of DB2, you must install DB2 Version 5 on your system.

Figure hint not displayed.

If there are several DB2 instances using previous versions of DB2, 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.

Each DB2 instance must be migrated separately. To successfully migrate a DB2 instance, you need to perform the following steps:

  1. Prepare the DB2 instance for migration.

  2. Ensure that the user exit program can be migrated.

  3. Migrate the DB2 instance.

If you want to migrate several instances, you must repeat these steps for each instance.

Prepare the DB2 Instance for Migration

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, you need to perform the following steps:

  1. Log in as the DB2 instance owner.

  2. Ensure that there are no applications using any databases owned by this DB2 instance. To get a list of all applications owned by the instance, enter the db2 list applications command.

    You can end a session by entering the db2 terminate command. It is not recommended to force termination of applications using the db2 force applications all command, since some applications may have unexpected behavior when terminated using this command. See the Command Reference for usage and details of this command.

  3. When all applications are complete, stop all database server processes owned by the DB2 instance by entering the db2stop command.

  4. Stop the DB2 license daemon by entering the db2licd end command.

  5. Stop all command line processor sessions by entering the db2 terminate command in each session that was running the command line processor.

  6. Enter the db2_kill command to clean up any remaining DB2 resources.

  7. Log off.

The DB2 instance is now ready for migration.

Migration Considerations for the User Exit Program



Figure hint not displayed.

Follow these instructions if you are using the db2uexit user exit program 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. For more information on these new interfaces, refer to 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:

At a convenient time, you should modify your user exit program to use the new DB2 Version 5 interfaces. The new user exit program should replace db2uext2 in the INSTHOME/sqllib/bin orsqllib\bin directory, used to support the pre-Version 5 user exit program, db2uexit, which should be removed.

Migrate the DB2 Instance

After an instance is ready for migration, use the db2imigr command to migrate the instance as follows:

  1. Log in as user with root authority.

    Figure hint not displayed.

    If the library_path environment variable is set to /usr/lib on AIX or /opt/lib on HP-UX, SCO UnixWare 7, or Solaris, and there is a link in /usr/lib or /opt/lib to the Version 5 libdb2.a DB2 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 is:

    • LIBPATH on AIX

    • SHLIB_PATH on HP-UX

    • LD_LIBRARY_PATH on Solaris or SCO UnixWare 7

    After migrating the DB2 instance, you should reset LIBPATH to its original setting.

  2. 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, SCO UnixWare 7, 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 type 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 DB2 server is installed. Otherwise, the AuthType is set to (CLIENT).

    Notes:

    1. The authentication type of the instance applies to all databases owned by the instance.

    2. While authentication type (DCE) is an optional parameter, it is not valid to choose (DCE) for this command.

    -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.



Figure hint not displayed.

If you are migrating a DB2 Version 2.1 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 5. Set the db2sort registry value to the run time library for the sort command as follows:

   db2set DB2SORT="/usr/lib/libsort.a"


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]

[ DB2 List of Books | Search the DB2 Books ]