There are optional activities you may want to undertake following database migration. You can also apply these optional activities to a down-level database backup which is restored to Version 7, because at the end of the restore, the database is migrated to Version 7.
Note: | This section applies only to migration scenarios involving Version 5.x databases, or to Version 6 databases that were previously migrated from the Version 5.x format but whose unique indexes were not migrated using the db2uiddl command. |
Version 5.x unique indexes are not automatically migrated to Version 7 semantics for several reasons:
All existing applications will continue to work even if the unique indexes are not converted to Version 7 semantics. You have to convert unique indexes to Version 7 semantics only if support for deferred uniqueness checking is required.
To convert unique indexes:
The db2uiddl command searches the database catalog tables and generates all the CREATE UNIQUE INDEX statements for user tables in an output file.
db2 -tvf filename
where filename is the name of the file generated by the db2uiddl command.
When database migration is completed, the old statistics that are used to optimize query performance are retained in the catalogs. However, DB2 Version 7 has statistics that are modified or do not exist in Version 5.x. To take advantage of these statistics, you may want to execute the runstats command on tables, particularly those tables that are critical to the performance of your SQL queries.
Refer to the Command Reference for the syntax of the runstats command. For details on the statistics, refer to the Administration Guide.
During database migration, all existing packages are invalidated. After the migration process, each package is rebuilt when it is used for the first time by the Version 7 database manager.
For better performance we recommend that you run the db2rbind command to rebuild all packages stored in the database. Refer to the Command Reference for the syntax of this command.
Some of the database configuration parameters are changed to Version 7 defaults or to other values during database migration. Refer to the Administration Guide for more information about configuration parameters.
We recommend that you run the DB2 Performance Monitor for suggestions in choosing appropriate configuration parameters. For more information, refer to the Administration Guide.
To migrate the explain tables in a database that has been migrated to Version 7, run the following command:
db2exmig -d dbname -e explain_schema [-u userid password]
where:
The explain tables belonging to the user ID that is running db2exmig, or that is used to connect to the database, will be migrated. The explain tables migration tool will rename the Version 5.x and Version 6 tables, create a new set of tables using the EXPLAIN.DDL, and copy the contents of the old tables to the new tables. Finally, it will drop the old tables. The db2exmig migration utility will preserve any user added columns on the explain tables.