Change commands

Change commands are statements that can be issued against a DB2 database. Change commands are the central resource for managing change with DB2® Change Management Expert. They can be SQL, DB2 commands, or utility commands (such as export and import commands).

Change commands can be generated between the base model and the target model, manually created, or imported from a script file. DB2 Change Management Expert allows the SQL, DB2 commands, or utility commands to all be specified in a single script file.

DB2 Change Management Expert checks the syntax of change commands in the Change Command Editor. A change command can be invalid. Change commands are generated based on a particular database state. If these change commands are applied to the database in a different state, semantic errors can occur. DB2 Change Management Expert checks the semantics of the change command when the change commands are applied to the model. Error messages are generated if a change command has put the DB2 Change Management Expert model in an invalid state. DB2 Change Management Expert cannot issue change commands that are not syntactically correct. DB2 Change Management Expert can issue commands that might be invalid for semantic reasons; however, proper use of the deployment script will help to prevent this possibility.
Tip: There are a variety of editors avail in the Eclipse environment to help you edit SQL, however the Change Command Editor is probably the best to use when you are using DB2 Change Management Expert because it supports syntax checking for all of the commands that DB2 Change Management Expert supports. Other editors might not support all of the commands or might not check your syntax. You can specify the default editor based on your file extensions by selecting Windows > Preferences > General > Editors > File Associations. You should use the Change Command Editor as the default editor for *.chx, *.ddl, and *.sql files.

In addition, DB2 Change Management Expert provides the Generate Change Commands wizard that generates your change commands for you. For example, you can manipulate export and import utility commands by using the DB2 Change Management Expert Generate Change Commands wizard.

You use change commands to change your target database. You create a deployment script, which includes all of your change commands, to deploy your changes to the DB2 catalog. DB2 Change Management Expert automatically determines how to issue those changes.

A change command that is applied against a DB2 Change Management Expert model might succeed, but the same command issued against DB2 might fail. DB2 Change Management Expert can be more forgiving than DB2 because DB2 Change Management Expert shows you the proposed model of the database and you can decide if the actions taken by DB2 Change Management Expert were appropriate. For example, if between the time that you generate change commands and the time that you deploy them, the DB2 catalog might have changed underneath. Although the change commands that you applied to the model were successful, the change commands might fail when you deploy them to DB2 if the base catalog has been altered.

Tip: The Deployment wizard will warn you of situations where your commands might fail or if there is a conflict with the database catalog. You can refresh your base model before you deploy your changes. If a difference between your base model and the DB2 catalog was found, you must regenerate your change commands.
Related tasks
Creating a deployment script
Generating change commands from the Deployment Script Editor


Feedback

Copyright IBM Corporation 2006, 2007. All Rights Reserved.