Use the Compare and Migrate wizard
to analyze differences between two databases and migrate the selected
object changes from the source database to the target database. In
addition to a database connection, the source of the changes can also
be a DDL script file or a physical data model.
Before you begin
The Database Administration feature must be installed, and
a connection must exist for the database that you want to migrate
data to. If the source of the changes is a database, a connection
must exist to that database. The databases must be DB2® for Linux, UNIX, and Windows databases.
Procedure
- Optional: Create a change plan for the target database
and make it the active change plan in the Object List. Alternatively, you can have the change plan created automatically
as part the process of comparing and migrating objects.
- In the Administration Explorer view,
find and expand the database that you want to change.
- Right-click the Change Plans folder
and click .
- Specify the name of the change plan in the Create
a Change Plan dialog.
- Right-click the change plan and click Edit to
make it the active change plan.
Tip: You can
also double-click a change plan to make it the active change plan.
- Optional: If you did not manually create a change plan,
click any folder under the target database in the Administration Explorer
to make the Object List active.
- Compare the model of the source database to the model of
the target database and migrate the selected changes.
- From the main menu, click . The wizard starts.
- Complete the steps in the wizard and then click Finish.
Use the pages in the wizard to complete the following steps:
- Specify the source from which to migrate the changes.
- Specify the objects that you want to migrate. For example, you
can choose to migrate buffer pools, partition groups, schemas, table
spaces, users, and groups.
- Define masks and ignores to simplify what is included in the comparison.
Buffer pools, table spaces, containers, and authorizations are defined
to be ignored by default.
- Use the
(Next Difference) and
(Previous
Difference) icons in the toolbar of the structural comparison
table to identify the differences between the models and the source
and target databases. Use the (Copy from
Left to Right) icon to copy a difference that you want
to apply to the target database. You can also use this icon to move
an object out of the model of the target database.
If you did not manually create a change plan, one is created
automatically. The change plan contains the changes that are necessary
to apply the selected changes to the target database.
- Analyze the changes in the change plan to determine if
you are changing objects that impact other objects.
- On the change plan toolbar, click the
(Show the plan changes) icon to show
the changes in the plan. The icon includes a number that indicates
how many changes are currently in the change plan.
- For each object in the list of changes, check the Impacted
Objects column. This column shows the number of objects
that might be impacted by a change to that object.
- Right-click the row for a changed object and Analyze
Impact.
- Use either the model diagram or model reports view that
is displayed to assess the objects that are dependent on the object
that you are changing.
Remember: Whenever
possible, commands are automatically generated to alter objects that
are impacted by your changes. For objects that you have to change
manually, you can add a change to the change plan to modify those
objects.
- Review and deploy the change plan.
- On the change plan toolbar in the Object List,
click the
(Review and
deploy changes) icon to review the DDL for the changes
and to deploy the changes to database.
- In the Review and Deploy dialog,
click Run and then click Finish. Before you run the commands, you can use these features in the Review
and Deploy dialog to customize the commands:
- Ensure that data is saved and reloaded for any objects that must
be dropped and re-created and specify a location for saving the data
- Specify a subset of DB2 maintenance
commands to include in the commands
- Specify whether to generate undo commands
Results
You have migrated database objects changes from one database,
DDL script file, or physical data model to the target database. The
status of running the commands is displayed in the SQL Results view.