Quick Beginnings

Migrating Databases

This section applies only if you are migrating databases from Version 5.x to the Version 7.1 format. If you are migrating from Version 6.1 to Version 7.1, you can skip this section.

If you are updating a single-partition Version 7 instance to the Version 7 multipartition format, you do not need to migrate the databases in that instance.

When pre-Version 7 databases are migrated for use in a Version 7 partitioned database system, default nodegroups are created for them. For more information about default nodegroups and how they are used, see Nodegroups and Data Partitioning.

To migrate Version 5.x databases owned by an instance:

  1. Log in with a user account that has SYSADM authority. See Working with the System Administrative Group for more information.
  2. Ensure that the databases you want to migrate are cataloged. To retrieve a list of all catalogued databases on your system, enter the db2 list database directory command. The syntax of this command is as follows:
    DB2 LIST DATABASE DIRECTORY command
     
    >>-LIST----+-DATABASE-+--DIRECTORY----+----------------+-------><
               '-DB-------'               '-ON--+-path--+--'
                                                '-drive-'
     
    
    The ON path/drive parameter specifies the local database directory from which to list information. If it is not specified, the contents of the system database directory are listed. For more information and examples, refer to the Command Reference.
  3. Migrate the database using the db2 migrate database command. The syntax of this command is as follows:
    DB2MIGRATE DATABASE command
     
    >>-MIGRATE----+-DATABASE-+--database-alias---------------------->
                  '-DB-------'
     
    >-----+---------------------------------------+----------------><
          '-USER--username--+------------------+--'
                            '-USING--password--'
     
    

    For more information and examples, refer to the Command Reference.

Migrating Version 5 databases containing SYSCAT DMS tablespaces
If you are migrating Version 5 databases that contain a SYSCAT Database Managed Space (DMS) tablespace, you should ensure that you have approximately 70 percent free space in the tablespace before migrating the database. You can check the size of your tablespaces by entering the db2 list tablespaces show detail command.

If your tablespace does not have enough free space, you may receive the following error:

   SQL1704N Database migration failed. Reason code 17.

In this case, you should restore your Version 5 database under a Version 5 instance, add more containers using the ALTER TABLESPACE statement, and migrate the database again. For more information about tablespaces and the ALTER TABLESPACE statement, refer to the Administration Guide and the SQL Reference.


[ Top of Page | Previous Page | Next Page ]