New applications or changes to existing applications might
require structural changes to databases. As a database administrator,
you might need to frequently migrate changes that were first made
in the development database environment to the test environment, and
then finally to the production environment.
The following figure shows the process of migrating changes from
one database environment to another.
Figure 1. The
process of migrating changes from one database environment to another
This task of migrating changes requires you to determine the differences
between the two database environments and to change only those objects
that are different. In some cases, determining the differences might
be easy, such as when only a new table has been added. In other cases,
determining the differences might be much more complex, such as when
numerous changes are made to multiple tables, tables have been added
or dropped, primary or foreign keys have been changed, and so on.
The source of structural changes to migrate can also be from a
DDL script file or a physical data model. Migrating changes from these
sources requires the same steps and analysis as migrating changes
from one database environment to another.
A change plan is used to migrate changes to a database. To migrate
database object changes, you start the
Compare and Migrate
Objects wizard from the main menu. The wizard guides you
through these steps:
- Selecting the source of structural database object changes to
migrate
- Specifying any masks and ignores to simplify what is included
in the comparison
- Using the structural comparison table to review the differences
between the source of the changes and a model of the target database
and to copy any differences that you want to apply to the target database
After you have selected and copied the differences that you want
to apply, you can work with the change plan. Review the changes in
the change plan, determine if an object that is being changed impacts
other objects, add additional changes to the change plan, and apply
the changes in the change plan to the target database.
When you review and deploy the change plan, the
Review
and Deploy dialog opens and the generated commands, which
can be customized, are displayed. You can use the features in the
Review
and Deploy dialog to complete these tasks:
- Specify whether to save data and automatically load and reload
that data for objects that must be dropped and re-created
- Change how data from unloaded columns is mapped to the columns
to be reloaded
- Select which subset of DB2® maintenance
commands to include in the change plan
- Specify whether to have undo commands created