Generating change commands from the Change Management Script Editor

You can use the Change Management Script Editor to generate the change commands that are necessary to apply changes to a DB2 database. The change commands include DDL, DCL, and DB2 commands, such as UNLOAD, RELOAD, REBIND, and RUNSTATS.

Before you begin

You must be connected to the database that you want to change before you can generate change commands.

Procedure

To generate change commands from the Change Management Script Editor, complete the following steps:

  1. In the Change Management Script Editor, the Objects to be Changed area lists the objects that are to be changed. Click Preview Commands to generate the change commands that will change your objects.
  2. In the Commands section of the Change Management Script Editor, you see the syntax of the change commands that will be run against your database. The following list describes different actions that you can take with the change commands:
    Regenerate data preservation and maintenance commands.
    Clicking Data Options starts the Customize Data Preservation wizard, which gives you the opportunity to make the following changes to the generated commands:
    • Change the unload and reload methods that are used for data preservation.

      You can change the methods that are used to unload and reload data, and customize the options for the methods that you choose. If you choose to save the data in external data files by using export commands or DB2 High Performance Unload commands instead of saving it internally in tables, you can change the location for data files. The file directory must be on the database server.

    • Verify and customize the commands for data preservation.

      For a table that must be dropped and re-created, you can review and customize the commands that are used to save the data from the table and then insert the data back into the table. You might want to change the query that is used to save the data. You might also want to change how the unloaded columns are mapped to the reloaded columns. In some cases, the generated commands might contain errors that you must resolve.

      Similarly, you can review and customize the commands for any tables that are being dropped but not re-created or for any new tables that are being added.

    • Change the DB2 maintenance commands that are generated.

      You can generate commands to rebind packages, run statistics for tables, and flush the package cache so that SQL statements will use updated statistics.

      You can choose to not generate any DB2 maintenance commands.

    Data is reloaded without referential integrity being enforced.
    Review the impact that the change commands will have on the database.
    A Summary of Changes report is generated automatically. Click View Change Report to open the report. Use the links in the navigation frame of the report on the left to view the various sections of the report.
    Verify the undo commands.
    Commands to undo the changes are generated automatically. Click Edit Undo to open the undo commands in the SQL and XQuery Editor where you can preview them and verify that they are correct.

What to do next

Your change commands are ready for use. Click Run to deploy the change commands, or repeat the steps to specify more changes and generate corresponding change commands.
Important: Change commands are deployed in the order that they are displayed.

Feedback