When you know the exact changes that you want
to move from one database to another, you can use the copy and paste
operations in the Object List view to move the
changes. You can move objects and data.
Before you begin
Connections must exist to the database from which you want
to move changes and for the database that you want to move the changes
to.
Procedure
To migrate changes from one database to another, complete
the following steps:
- Find and copy the objects that you want to migrate.
- In the Administration Explorer,
expand the database from which you want to migrate changes.
- Click the folder for the type of object that you want
to migrate.
- In the Object List view, find the
object to migrate. Right-click the object, and click Copy.
You can select multiple objects of the same type, for example, all
schemas or all tables.
- Paste the objects to the database that you want
to migrate them. Right-click the database in the Administration
Explorer and click Paste. When
you paste at the database level, the objects are pasted into the schemas
from which they came. If the schemas do not exist, they are created.
You
can paste into a schema in the Object List. Pasting
into a schema is not recommended unless you want to change schema
names for an object.
The Paste Database
Objects wizard starts.
- Complete the steps in the Paste Database Objects wizard. Use the wizard to specify whether to migrate only objects, only
data, or both objects and data. A new change management
script is created, and the change management script is displayed in
the Change Management Script Editor.
A data
design project is automatically created in the Data Project
Explorer. The name of the data design project is the name
of the database connection. If a data design project with the name
of the database connection exists, the name of the new data design
project is the database connection name with a numeric suffix. The
data design project contains and manages the resources that are necessary
to implement the changes to the actual database.
- Optional: To migrate any other changes to the target database,
drag and drop the object from the Object List that
is associated with the source database to the Change Management
Script Editor. The object must not exist in
the target database. Only the structural definition of the object
is migrated; the data in the object is not migrated.
Tip: To drag and drop an object, you must be able to see both
the Object List and the Change Management
Script Editor. To display them side by side, click the
title bar of the Change Management Script Editor,
and drag the title bar to the right until the mouse pointer becomes
a drop cursor, then release the left mouse button.
- In the Change Management Script Editor,
assess any other objects that might be impacted by migrating the changes
to the target database.
- In the Objects to be Changed list,
click each object. Objects that are affected by the objects that are
being migrated are displayed in the Impacted Objects list.
- Include impacted objects in the change management script.
Use the Alter and Drop buttons
to move the impacted objects to the Objects to be Changed list.
If you use the Alter button to move an impacted
object, you can click the object and make any necessary changes to
the object in the Properties view.
- Click Preview Commands to display
the generated commands in the Commands section
and review the commands.
To review a summary
of the changes that will be made to the database, click View
Change Report.
- Click Data Options to
start the Customize Data Preservation wizard
and complete the steps in the wizard. You might want to
customize commands when changes to a table require that the table
be dropped and then re-created for any of the following reasons:
- To modify the location of the data files
- To change the load and reload methods
- To redefine the query for unloading the data
- To correct mismatches between the data types of unload and reload
columns
- To remap how the data is loaded
You can also specify which DB2 maintenance commands are generated.
- Review the regenerated commands.
- Click Run to start the Deploy
Change Commands wizard.
- Review the change commands and click Finish to
deploy the changes to the actual database catalog.
Results
You have migrated changes from one database environment to
another.