Scenario: Comparing DDL to a catalog
You can compare the DDL for a single object to the Db2® catalog to make changes on the system for only that object.
About this task
Suppose you want to change a table on your test system. For example, you might add a column in the middle or at the end of the table. So, you generate DDL that shows how the table will look after the change. The DDL will be your source for the comparison. It includes only a CREATE TABLE statement for the table. The DDL does not include any related indexes, foreign keys, or other related objects. Those objects will not be changed, because they are not included in the source DDL.
You then specify that the compare target be selected automatically from the Db2 catalog. In this case, Db2 Object Comparison Tool determines how to change the table. If the table does not currently exist in the target, Object Comparison Tool creates the table. If the table exists, Object Comparison Tool uses the version file instead of the catalog. Object Comparison Tool might alter the table or drop and re-create it, depending on the changes that need to be made. Db2 Object Comparison Tool restores objects and dependencies, such as indexes. If the table needs to be dropped and re-created, Db2 Object Comparison Tool also re-creates objects that have been dropped as a result of dropping the table. The table data is unloaded and, after the object definitions are applied, reloaded back into the table.