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
- On the BMC AMI Change Manager for Db2 Main Menu, select Compare (CDL Build), and press Enter.
- On the Compare Type Selection panel, select Catalog for both Compare1 Type and Compare2 Type. Press Enter.
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.
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 . . . .
- On the Compare Catalog to Catalog panel, type the abbreviation for an object type.
- 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.
- Specify the values for Compare1.
- 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.
- (Optional) To limit the scope of the comparison, type the name of the table owner.
- (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.
- Type the name of the object.
- Specify the values for Compare2.
- Repeat Step 6.
- (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.
- 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).
- 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.
- Press Enter.
On the Compare CDL Options panel, specify the object types and attributes for the comparison.
Type Y or N for each object type that you want to include in or exclude from the comparison.
- Type S to display a list of the object attributes to include in or exclude from the comparison.
- (Optional) Type S to generate comparison report information as comments in the CDL file.
- (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).
- Select a Run Type.Be aware that specifying foreground for large comparisons might make your TSO session unavailable for a lengthy period of time.
- 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).
- On the Compare Object Attributes panel, specify the object attributes.
- To include an object attribute in the comparison, type Y adjacent to the attribute.
- 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.
- Press Enter.
- On the Compare CDL Options panel, press Enter.
- On the Compare JCL Processing Interface panel, specify the data set names to be used in the comparison.
- (Batch run type) Type the data set name for the JCL that is generated by this process.
- Type the data set name for the CDL that is generated by this process.
- 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.
- (foreground run type) If you specified SYSOUT in step Step 14.c, specify the SysoutClass.
- 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.
- Press Enter.
- On the Compare Override Options panel, if you selected to override the defaults, specify the data set and CDL options.
- To specify the data set allocation parameters for new data sets, type a value for the Unitname, Volume, Priqty, or Secqty.
- To include CDL statements for created, altered, or dropped objects, type S to select the statements.
- 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.
- Press END.
- On the Compare JCL Processing Interface panel, select your options for the comparison.
- 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.
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
NODEFINETo 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.
To edit the CDL file that is generated by the comparison, type S to select Edit CDL File.
- Press Enter.
- To create the input for the comparison, select one of the following options:
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.