Information
Limited support BMC provides limited support for this version of the product. As a result, BMC no longer accepts comments in this space. If you encounter problems with the product version or the space, contact BMC Support.BMC recommends upgrading to the latest version of the product. To see documentation for that version, see ALTER and BMC AMI Change Manager for Db2 13.1.

Comparing a Db2 catalog to a Db2 catalog


Use the following procedure to compare two sets of data structures that are contained in two different catalogs. You can use this type of comparison to synchronize copies of an application under development or to compare a small subset of an application’s objects or individual objects.

The example used in this set of steps compares a local Db2 catalog to a remote Db2 catalog. In addition, the scope of the comparison was defined explicitly by specifying the object type and object name for Compare1 and Compare2 on the Compare Catalog to Catalog panel.

To compare a Db2 catalog to a Db2 catalog

  1. On the BMC AMI Change Manager for Db2 Main Menu, select Compare (CDL Build), and press Enter.
  2. On the Compare Type Selection panel, select Catalog for both Compare1 Type and Compare2 Type. Press Enter.
  3. On the Compare Catalog to Catalog Scope Selection panel, select One catalog object and all of its dependents as the source of the scope. Press Enter.

    Warning

    Note

    To select multiple catalog objects, specify scope rules in a baseline profile or an outbound migrate profile and select to use the profile as the source of the scope. For information, see Using-a-profile-to-scope-a-catalog-to-a-catalog-comparison.

    The Compare Catalog to Catalog panel is displayed, as shown in the following figure.

    ACMF9CMC ---------------- Compare Catalog to Catalog --------------------
     Command ===>                                                                   
                                                                                   
     CDL will be generated to make Compare1 look like Compare2.                     
                                                                                   
     Object Type ( SG DB TS TB IX VW SY AL SP )   DB                                
     Display list of objects (Y/N)  . . . . . . . N                                 
                                                                                   
     Type the values for Compare1, where the resulting CDL will be applied.         
              Name - part 1  . . . . . . . . . . R1BASIC                            
              Name - part 2  . . . . . . . . . .                                    
              Name - part 3  . . . . . . . . . .                                    
       Optional table owner (to limit scope) . . *                                  
       Optional location name for remote Db2 . .                                    
                                                                                   
     Type the values for Compare2, where the objects already have the desired       
     structure definitions. Then press Enter.                                       
              Name - part 1  . . . . . . . . . . S1BASIC                            
              Name - part 2  . . . . . . . . . .                                    
              Name - part 3  . . . . . . . . . .                                    
       Optional table owner (to limit scope) . . *                                  
       Optional location name for remote Db2 . . DBDC                               
       Optional outbound migrate profile containing change rules for object names   
       to be applied BEFORE the Compare  . . . .                                    
                                                                                   
  4. On the Compare Catalog to Catalog panel, type the abbreviation for an object type.
  5. If you plan to use a wildcard for Name - part 1, Name - part 2, or Name - part 3, type Y to display a list of objects in a mixed list.
  6. Specify the values for Compare1.
    1. Type the name of the object.
      • If the name of the object has only one part, for Name - part 1, type the name or owner, or type a wildcard to specify an object from a list of objects.
      • If the name of the object has two parts, specify the following information:
        • For Name - part 1, type the name or owner, or type a wildcard to specify an object from a list of objects.
        • For Name - part 2, type the name of a single object or type a wildcard to specify an object from a list of objects.
      • If the name of the object has three parts (such as a stored procedure), specify the following information:
        • For Name - part 1, type the name or owner, or type a wildcard to specify an object from a list of objects.
        • For Name - part 2, type the name of a single object or type a wildcard to specify an object from a list of objects.
        • For Name - part 3, type the name of an object or type a wildcard to specify an object from a list of objects.
    2. (Optional) To limit the scope of the comparison, type the name of the table owner.
    3. (Optional) Specify the name of the location of the remote Db2 subsystem. As an alternative, you can type a wildcard for the location name to generate a list of remote locations from which you can select.
  7. Specify the values for Compare2.
    1. Repeat Step 6.
    2. (Optional) Specify the name of an outbound migrate profile for Compare2. The outbound migrate profile must contain change rules to resolve the names of the objects. BMC AMI Change Manager for Db2 applies the change rules to the objects in Compare2 before the comparison.
  8. Press Enter.If you chose to display a list of objects in a mixed list in Step 7, the Mixed List panel is displayed. Otherwise, the Compare CDL Options panel is displayed (proceed to Step 11).
  9. From the Mixed List panel, you can perform one of the following actions:
    • Type S to select a single object to use in the comparison. Then, press Enter.
    • Press END to exit the mixed list. All of the objects listed on the mixed list will be included in the comparison.
  10. Press Enter.
  11.  On the Compare CDL Options panel, specify the object types and attributes for the comparison.

    1. Type Y or N for each object type that you want to include in or exclude from the comparison.

      Warning

      Note

      If you want to include the parent objects of tables in the comparison, do not type Y for the database and table space.

      Perform one of the following tasks:

      • Specify the OVERRIDE( INCLUDEPARENTS) keyword in the ALUIN input stream.
      • Include the database and table space in scope rules in an outbound migrate profile or a catalog baseline profile.
    2. Type S to display a list of the object attributes to include in or exclude from the comparison.
    3. (Optional) Type S to generate comparison report information as comments in the CDL file.
    4. (Optional) Specify the name of an outbound migrate profile. The outbound migrate profile can contain change rules and locations. Change Managerapplies the rules after it performs the comparison (when it generates the CDL).
    5. Select a Run Type.Be aware that specifying foreground for large comparisons might make your TSO session unavailable for a lengthy period of time.
    6. Press Enter.

    If you chose to display a list of the object attributes in Step 11.b, the Compare Object Attributes panel is displayed. Otherwise, the Compare JCL Processing Interface panel is displayed (proceed to Step 14).

  12. On the Compare Object Attributes panel, specify the object attributes.
    1. To include an object attribute in the comparison, type Y adjacent to the attribute.
    2. If you specified to include the partition attributes in Step 12.a, you can exclude one or more of the partition attributes. Type N adjacent to the attributes that you want to exclude.
    3. Press Enter.
  13. On the Compare CDL Options panel, press Enter.
  14. On the Compare JCL Processing Interface panel, specify the data set names to be used in the comparison.
    1. (Batch run type) Type the data set name for the JCL that is generated by this process.
    2. Type the data set name for the CDL that is generated by this process.
    3. Type one of the following options for Diagnostics:
      • (Foreground run type) To display the diagnostics on the terminal, type TERM.
      • To write the diagnostics to a sequential file, type the name of the data set.
      • To write the diagnostics to a print data set, type SYSOUT.
    4. (foreground run type) If you specified SYSOUT in step Step 14.c, specify the SysoutClass.
  15. Type S to select Override Compare defaults to change data set allocation parameters or to control the content of the CDL that is generated by the comparison process.
  16. Press Enter.
  17. On the Compare Override Options panel, if you selected to override the defaults, specify the data set and CDL options.
    1. To specify the data set allocation parameters for new data sets, type a value for the Unitname, Volume, Priqty, or Secqty.
    2. To include CDL statements for created, altered, or dropped objects, type S to select the statements.
    3. To display, in the CDL, the change rules from an outbound migrate profile or the automatic change rules, type S for Display change rules applied to Compare2 BEFORE the Compare.
    4. Press END.
  18. On the Compare JCL Processing Interface panel, select your options for the comparison.
    1. To create the input for the comparison, select one of the following options:
      • (Foreground run type) Type S to select Create Input.
      • (Batch run type) Type S to select Create JCL.
    2. To review or modify input to the comparison process, select one of the following options:

      • (Foreground run type) Type S to select Edit Input.
      • (Batch run type) Type S to select Edit JCL.

      The following figure shows an example of the ALUIN input stream.

      Press END.

      SSID DEDK
      CMPTYPE1  LOCAL
      CMPTYPE2 REMOTE
      LOCATION2 DBDC
      SCOPETYPE RULE
      INCLUDE(    ALTER CREATE DROP)
      SCOPERULE1 (* IX ACM83.*           )
      SCOPERULE2 (* IX ACM83.*        )
      CHANGERULESIN2 NULL
       DEFAULTOFF
      NOSTOGROUP
      NODATABASE
      NOTABLESPACE
      *-NOINDEX
      NOTABLE
      NOCHECKCNST
      NOFOREIGNKEY
      NOUNIQUECNST
      NOVIEW
      NOSYNONYM
      NOALIAS
      NOTRIGGER
      NOAUXILIARY
      NODEFINE
    3. To run the comparison, select one of the following options:

      • (Foreground run type) Type S to select Run Compare.
      • (Batch run type) Type S to select Submit JCL.

      Change Manager generates a CDL file and a diagnostic output file.

    4. To edit the CDL file that is generated by the comparison, type S to select Edit CDL File.

      Error
      Warning

      Do not attempt to edit the CDL file while the comparison is in progress, or the file will be locked, and the Compare component will not be able to access it.

    5. Press Enter.

Where to go from here

Now that have compared your data structures and have generated a CDL file, you can import the CDL file to an alter-type work ID and process it as a set of change requests for a subsystem.

 

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

ALTER and BMC AMI Change Manager for Db2 12.1