Comparing two schemas


Comparing schemas involves generating and viewing a set of reports. The reports list the objects that need to be created, altered, or dropped to make the two structures identical. BMC AMI Command Center generates the Change Definition Language (CDL) that defines the changes that must be applied to make the schema's structures identical. You can save the CDL to a data set and edit the CDL in the Scratchpad editor.

Related topics

BMC AMI Command Centerenables you to make the following comparisons:

  • Db2 catalog to Db2 catalog
  • DDL to DDL
  • Db2 catalog to DDL
  • DDL to Db2 catalog

Important

BMC AMI Command Center can generate DDL statements containing lines that are longer than 72 characters. These DDL statements cannot be used in a schema comparison.

The same set of reports is available for each type of comparison. For more information, see Schema comparison reports.

Use the following procedure to create and display a Schema Compare View for each comparison that you want to see. You can also navigate to and run a saved schema comparison.

To create a Schema Compare View

The comparison requires two inputs:

  • The schema or set of Db2 objects that has the structure definitions that you want to change (called the Primary Input in the procedure)
  • The schema that has the preferred structure definitions, to serve as the basis for changing the other schema (called the Secondary Input)

Important

After you have specified the two data structures for comparison, you can click Finish without changing the default dependent objects, attributes, or options values.

  1. In the Schema Management perspective, click Add Schema Compare View NW_plus_circle_o.png.The Compare wizard opens.
  2. On the wizard's General page, complete the following fields and click Next:

    Field

    Description

    Name

    Enter a name for the report.

    Select a report

    Select to create a new report or use an existing report.

  3. On the wizard's next page, take the appropriate action as follows:
    • If you are using an existing report, complete these actions:
      1. On the wizard's Comparison Dataset page, navigate to and select the data set that contains the report and click Next.

        For more information, see Viewing and editing a data set.

      2. (Optional) In the wizard's Options page, select Enable Trace to provide informational messages in the View Messages dialog box.
      3. Click Finish.
      4. Click Show Compare Report NW_run.png to rerun the report.
    • If creating a new report, on the wizard's Type of Comparison page, complete the following fields and click Next:

       

      Field

      Description

      Compare Type

      Select the type of comparison that you require.

      Output Compare Report

      Navigate to and select a data set to save the generated CDL output of the comparison.

  4. On the wizard's Data Structures page, complete the following fields according to the type of comparison that you are performing:

    Field

    Description

    Db2 objects that do not have the desired structure (primary input)

    Object Type

    Select the object type.

    DB2 Connection

    Select the Db2 connection from your list of favorites or add a Db2 connection to the list.
    For more information, see Connecting to Db2 subsystems.

    Filter

    Specify a filter for the name of the Db2 objects that you want to compare.

    Db2 objects that have the desired structure (secondary input)

    DB2 Connection

    Select the Db2 connection from the list.

    Filter

    Specify a filter for the name of the Db2 objects that you want to compare.

    Field

    Description

    Db2 objects that do not have the desired structure (primary input)

    DB2 Connection

    Select the Db2 connection from your list of favorites or add a Db2 connection to the list, as explained in Connecting to Db2 subsystems.

    DDL Data Set

    Select the DDL data set. This data set defines the scope of the comparison.

    For more information, see Viewing and editing a data set.

    Db2 objects that have the desired structure (secondary input)

    DDL Data Set

    Select the DDL data set.

    For more information, see Viewing and editing a data set.

    Field

    Description

    Db2 objects that do not have the desired structure (primary input)

    DB2 Connection

    Select the Db2 connection where the schema is stored.

    Db2 objects that have the desired structure (secondary input)

    DDL Data Set

    Select the DDL data set. This data set defines the scope of the comparison.

    For more information, see Viewing and editing a data set.

    Field

    Description

    Db2 objects that do not have the desired structure (primary input)

    DDL Data set

    Select the DDL data set. This data set defines the scope of the comparison.

    For more information, see Viewing and editing a data set.

    Db2 objects that have the desired structure (secondary input)

    DB2 Connection

    Select the Db2 connection where the schema is stored.

     

  5. Click Next.
  6. On the wizard's Dependent objects page, select the dependent objects to include in the comparison and click Next.

    Important

    To compare a Db2 catalog to a Db2 catalog, the Resolve object or creator name differences check box is enabled by default.

    When this option is enabled, the product excludes databases, table spaces, synonyms, and aliases from the comparison because duplicates might occur. The product performs this name conversion to resolve the differences in the object owners, schemas, and database names.

  7. On the wizard's Attributes page, select the attributes for each object type to include in the comparison and click Next.
  8. On the wizard's Options page, specify the option values for the current definition and click Next.
    For information about the options, see Setting Schema Management options.
    These values do not affect the global compare options that you specify by using the Options button NG_gear.png.
  9. Click Finish.The Reports tab displays the reports for this comparison. For more information, see Schema comparison reports.
  10. (Optional) If you want to view the generated CDL for the comparison, click Show CDL NW_file_text_o.png to view the CDL in the Scratchpad.

    Important

    You cannot run the CDL from the Scratchpad.

  11. (Optional) If you want to rerun the comparison, click Show Compare Report NW_run.png .

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*