Change plans

A change plan is the set of changes that you want to make to your DB2 for Linux, UNIX, and Windows database. A change plan also includes the specification resources, change commands, and metadata about how the changes will be implemented.

When you run your changes from a change plan, you are issuing commands to change your DB2 database. A change plan presents a consolidated way to work with a set of changes that you would like to make to your database.

You can use a change plan to:

When you run the change plan, you can set the options for data preservation, undo commands, and DB2 maintenance commands in the Review and Deploy dialog. Alternatively, you can also set these options in the Properties view for the change plan.

All the changes that you make to a database are collected in a change plan. A database can have one or more change plans. Only one change plan can be active at a time, which means that the changes that you make are added to the active change plan.

When a change plan is active, the Object List includes an additional toolbar for the change plan. When no change plan is active and you initiate a database change, a change plan is automatically created with a default name of Default Change Plan timestamp, where timestamp has the form yyyy-mm-dd hh-mm-ss. The newly created change plan automatically becomes the active change plan. You can also manually create a change plan and provide your own name for the change plan. After the change plan is created, you must make it the active change plan.

A change plan remains active until you deploy the changes in the change plan, close the change plan manually to work with it at a later time, or make another change plan the active change plan.

Displaying the change plans for a database

Each database in the Administration Explorer contains a Change Plans folder. You can double-click the folder to display the list of change plans for the database in the Object List. Right-click a change plan to display the context menu. The following table describes the actions that you can take on the menu:
Table 1. Context menu actions for change plans that are listed in the Object List
Menu iItem Description
Edit Makes the change plan active. A change plan toolbar is displayed in the Object List, and the name of the change plan is in the change plan toolbar. Any changes that you make to the database are added to this change plan. You can also double-click the change plan to make it active.
View Shows the changes in the change plan. If a change plan is active, it remains the active change plan.
Rename Opens a dialog where you can rename the change plan. For change plans that are created automatically and given a default name with a timestamp value, you might want to change the name to make it more meaningful.
Delete Deletes the change plan. You are not prompted to confirm the deletion of the change plan.
Review and Deploy Generates the DDL to implement the changes in the change plan and displays the generated DDL in the Review and Deploy dialog.
Review Undo Commands Displays the generated DDL to back out the changes that were made to the database catalog when the change plan was successfully run against the database. To undo changes, the status of the change plan must be DEPLOYED.
Properties Brings the Properties view into focus where the change plan is displayed. You can use the properties tabs to alter the attributes of the change plan.

Status of change plans

When you display the change plans for a database in the Object List, each change plan has a status. The status helps you determine what actions you can take on the change plan. The following table shows the status that a change plans can have:
Table 2. Status of changes plans
Change plan status Description
PENDING The changes in the change plan have not been deployed to the database catalog. You can activate the change plan and make more changes, edit an existing change, or review and deploy the change plan.
DEPLOYED The changes in the change plan have been deployed to the database catalog. If undo commands were generated for the change plan and you decide that you want to back out the changes that you made to the database, you can run the undo commands.

Change plan toolbar in the Object List

When a change plan is active, the Object List includes an additional toolbar for the change plan. In the following example, the Object List shows the list of tables in the GSDB database. The change plan tool bar indicates that the Customer and pricing changes change plan is the active change plan, and the change plan currently includes four changes:
Figure 1. Example of the Object List with the change plan toolbar, which shows the Customer and pricing changes change plan as the active change plan
Image of the Object List displaying the tables in the GSDB database with the change plan for the Customer and pricing changes active
Unless you close the change plan, any changes that you make to the database are added to this change plan. Use the icons on the change plan toolbar to work with the change plan.
Table 3. Icons on the change plan toolbar and their actions
Icon Description
Icon image that shows the number of changes in the change plan Shows the number of changes that are currently in the change plan. You can click the linked number to display the list of changes for the change plan.
Icon image that moves to the next object being changed For the list of objects that are currently displayed in the Object List, moves the focus to the next object that is being changed in the current change plan. Remember that you can always change which objects are listed in the Object List.
Icon image that moves to the previous object being changed For the list of objects that are currently displayed in the Object List, moves the focus to the previous object that is being changed in the current change plan.
Icon image that moves to the previous object being changed Generates the DDL to implement the changes in the change plan and displays the generated DDL in the Review and Deploy dialog.
Icon image that saves the changes Saves any newly defined changes to the change plan.
Icon image that closes the change plan. Closes the change plan. If any changes have not been saved, you are prompted to save or discard the changes when the change plan is closed.

In the Object List, icons indicate whether objects for the active change plan are being created (Image of a triangle with a green plus sign to indicate the object is being created), altered (Image of a triangle to indicate the object is being altered), or dropped (Image of a triangle with a red X to indicate the object is being dropped).


Feedback