Generate the commands to implement the changes for a change
plan. The commands are generated from the change plan. Then, run the
generated commands to apply the changes to the database.
Before you begin
A connection to the database must exist.
Procedure
- Complete either of the following actions to generate the
commands for your change plan.
- If the change plan is active and is displayed in the change
plan toolbar in the Object List, click the
(Review
and deploy changes) icon on the toolbar.
- Otherwise, in the Administration Explorer,
click the Change Plans folder for the database.
In the Object List, right-click the change plan
that you want to deploy and click Review and Deploy.
The Review and Deploy dialog opens
and displays the generated change commands.
- Review the commands. If you are not satisfied
with the commands, you can click Cancel, modify
the change plan, and regenerate the commands.
- Optional: Alter the commands that are displayed by using
the various elements in dialog:
- Save data check box
- If objects must be dropped and re-created, this option ensures
that the data is unloaded and then reloaded into the newly created
objects. You can use the default location for saving the data or specify
a different location. Click Refresh DDL to
refresh the displayed commands with your changes. Data is reloaded
without referential integrity being enforced.
- Column Mapping
- Use this option to change how the unloaded columns are mapped
to the reloaded columns.
- Advanced Options
- Use these options to specify whether to include REBIND, REORG,
and RUNSTATS commands and FLUSH CACHE statements in your change commands.
You can also specify whether to have an undo command script generated.
When a change plan is deployed to a database, the undo command script
gives you the option of reversing the changes.
- Click Run and then click Finish.
Tip: You cannot type directly in the generated commands
section of the dialog. If you want to modify the generated commands,
click
Edit and schedule and then click
Finish.
The command script opens in the
SQL and XQuery editor.
You can modify and run the commands.
You can also use the editor
to start the Job Manager, where you can schedule a time to run the
command script.
When you open the change commands in the SQL
and XQuery editor, the change plan is closed. You are no
longer using the change plan to manage your changes, and the change
plan is not updated. The status of the change plan remains PENDING
even if you run the commands through the SQL and XQuery editor
or the Job Manager.
- Check the results of running the commands in the SQL
Results view.
If any commands that were run
failed, determine the cause of the failure and take corrective action.
For example, you might use one of the following approaches:
- Analyze the deployed command script to determine if you can continue
to run the script from the point of failure after making necessary
adjustments to the script or to the DB2 system.
- Use the undo script to help you roll back the partially deployed
changes.
With either approach, click the Change Plans folder
for the database in the Administration Explorer.
To work with the deployed command script, right-click the change plan
and click Review and Deploy. To work with the
undo script, right-click the change plan and click Review
Undo commands. The commands open in the Review
and Deploy dialog.
Click Edit
and schedule to open the commands in the SQL
and XQuery editor. Make the necessary changes to the commands
and run them from the editor.
Results
Your database now reflects the changes that you specified.