Applying another deployment script to a target model

From the Data Models Page of the Deployment Script Editor, you can apply the DDL changes from another deployment script to the target model.
Prerequisite: A deployment script for changes to another database must exist.
Applying another deployment script to the target model of a database allows you to make the same changes to the database that were made to another database. For example, assume that two developers each have their own development database for an application. You want to move the changes that each developer made to the test database for the application. If you have the deployment scripts that the developers used to change their databases, you can apply those deployment scripts to a model of the test database, and then eventually deploy the consolidated changes to the test database.
Restriction: The Apply Deployment Script action, on the Data Models tab of the Deployment Script Editor, might not always leave the target model in a valid state. When the base models of the two databases are different, you might have to resolve errors that DB2® Change Management Expert will flag to account for missing objects. However, invalid models might result if there are extensive differences, especially in the unchanged parts of the models that have dependencies on the objects that were changed. Take care to thoroughly understand the changes to the target model before generating your change commands. Otherwise the commands might be invalid. When you are managing changes between databases with different base models, you should merge the changes by using the Comparison Editor. Always check your target model for errors before generating change commands and deploying those changes.

To apply another deployment script to a target model, complete the following steps:

  1. Go to the Data Models Page in the Deployment Script Editor for the database that you want to change.
  2. Click Apply another deployment script to display the Select Deployment Script wizard.
  3. Complete the steps in the wizard to select the deployment script to apply to your target model. DB2 Change Management Expert extracts the DDL changes from the deployment script and applies them to your target model.
    Tip: If you encounter errors when applying another deployment script to the target model, the errors might be caused by the deployment script trying to:
    • Add an object that already exists in the target model
    • Delete an object that does not exist in the target model
    • Change an object that does not exist in the target model.
    • Add an object whose parent object does not exist in the target model.

    You will see a page that shows each error. You can choose to ignore the error or force the change to be applied. If you delete an object that does not exist or if you add an object that does exist, forcing the change to be applied is the same as ignoring the change. In all the other cases, forcing the change to be applied will copy the missing objects from the target model in the other deployment script and then reapply the failed changes.

    Verify that the deployment script is the set of changes that you want to make to your target model. Check your target model, make any necessary changes to target model to correct for the possible causes of error, and then apply the deployment script again.
You are now ready to compare the base model and target model of the database that you are changing, to analyze the differences between the models, and to verify the changes that you are making. You can then generate the change commands to create the DDL that can be deployed to change the actual database.
Related concepts
Migration analysis
Model comparison and synchronization
Working with the deployment script
Related tasks
Changing a model with the Data Model Editor
Changing the diagram of a model
Changing a model in the Data Project Explorer view
Applying change commands
Related information
Merging the structural differences of data objects in the compare editor
Merging data object properties differences in the compare editor


Feedback

Copyright IBM Corporation 2006, 2007. All Rights Reserved.