Generating undo commands

If a change to the target database fails or produces undesirable results, you can roll back that change to recover the previous database by creating undo commands. Undo commands are change commands that you use to roll back your changes. You can generate, view, and deploy undo commands from the Deployment Script Editor.
When you generate the change commands to apply to your database, DB2® Change Management Expert can automatically generate the commands that are necessary to undo the changes. To generate undo commands from the Deployment Script Editor, complete the following steps:
  1. On the Change Commands page of the Deployment Script Editor, click Generate Change Commands.
  2. Ensure that Enable Undo is checked on the DDL Generation Options page of the Generate Change Commands wizard to automatically generate the undo commands. This option is checked by default. If the Enable Undo check box is cleared, no undo script is generated. You can generate undo commands only by using the Generate Change Commands wizard.
  3. Complete the steps in the Generate Change Commands wizard. DB2 Change Management Expert uses the base and target models to calculate the undo commands and adds them to the deployment script.
  4. Return to the Undo Changes page of the Deployment Script Editor. On the Undo Changes page, your undo scripts are displayed in the Define Undo Commands section.
  5. You can add and specify the order of the undo scripts in the Define Undo Commands section. Click Add if you want to add additional scripts to the set of automatically generated undo commands.
Your undo commands are ready for you to use in case you need to return your database to its original state.
Restriction: If you modify the undo commands file and then run the Generate Change Commands wizard again, the automatically generated undo commands will overwrite your manual changes. However, you can merge the commands using the Merge page of the Generate Change Commands wizard.
Related tasks
Deploying undo commands
Generating change commands from the Deployment Script Editor


Feedback

Copyright IBM Corporation 2006, 2007. All Rights Reserved.