Using a script to perform a comparison
The CMP_STRUCTURE_CHG script in the CM/PILOT component of
BMC AMI Change Manager for Db2
contains the steps to perform a comparison and generate a CDL file if differences exist between the data structures.
If the Change Manager Compare component finds no differences, CM/PILOT worklist processing stops and an Analysis worklist is not created. If differences exist, a CDL file is created and imported, and an Analysis worklist is created to apply the changes. This example assumes that the comparison, import, analysis, and execution are performed on the same subsystem. For more information about scripts, see Using-scripting-tools-to-automate-change-management.
In this task, you create and execute a task ID.
Before you begin
Depending on the inputs specified for the comparison, any of the following items can be required:
Item | Reference |
---|---|
DDL file | |
Change Manager worklist | |
DDL baseline | |
Catalog baseline | |
Catalog baseline profile containing scope rules | |
Outbound migrate profile containing scope rules, change rules, or locations | |
Inbound migrate profile containing change rules | |
Alter-type work ID |
To create a task ID
- On the BMC AMI Change Manager for Db2 Main Menu, select CM/PILOT, and press Enter.
- On the CM/PILOT Main Menu, select TASKIDs and press Enter.
- On the TASKID Action Menu, type the name of a new TASKID and select Create a TASKID. Then, press Enter.
- On the Script Selection List, select Change data structures using a Compare trigger, and press Enter.
- On the Create TASKID panel, specify the information for a task ID.
- CM/PILOT uses the name of the task ID as the name for a new alter-type work ID. You can type a different name for WORKID or type the name of a work ID name template.
- (Optional) Type the name of a CM/PILOT Application. An Application groups a set of Change Manager profiles. For more information about Applications, see Using-scripting-tools-to-automate-change-management.
- (Optional) Specify a Comment to describe the task ID.
- Press END.The task ID is created.
To execute the task ID
- On the TASKID Action Menu, select Execute a TASKID and press Enter .
- On the TASKID Interface panel, specify the data set names to be used by CM/PILOT.
- Type the data set name for the CM/PILOT Worklist.
- Type the data set name for the CM/PILOT JCL.
- Type the data set name for Diagnostics or type SYSOUT.
- Select the method of executing the CM/PILOT worklist.For more information about executing a CM/PILOT worklist, see Processing-CM-PILOT-worklists.
- (Optional) Override the options that are set in Change Manager.
Type S to select Override
Change Manager
options and then press Enter.
On the Override Change Manager Options panel, select Override
Change Manager
Options.
Type S to select the Change Manager Analysis and Execution options that you want to override, and press Enter.For more information about the Change Manager options, see Using-options-to-control-your-environment.
- Press END.
- On the TASKID Interface panel, create a CM/PILOT worklist.
- Type S to select Create Worklist. Then, press Enter.
- On the Step Settings panel, type S to select Step 1 Compare, and press Enter.
- On the TASKID Compare Step Options panel, select the structures that you want to compare, and press Enter. (For this example, Catalog was selected for Compare1 Type and Compare2 Type.)
- (Optional) On the Step Settings panel is displayed, to modify the Analysis step, type S to select Step 2 Analysis step and press Enter.
- (Optional) To modify the Execution step, type S to select Step 3 Execution step and press Enter.
To specify the inputs for the comparison
- 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.
- 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 5.
- (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 and creators. Change Manager 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 4, the Mixed List panel is displayed. Otherwise, the Compare CDL Options panel is displayed (proceed to Step 8).
- 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 Taskid 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.
- Press Enter.If you chose to display a list of the object attributes in Step 10.a, the Compare Object Attributes panel is displayed. Otherwise, the TASKID Migrate Profiles panel is displayed (proceed to Step 13).
- 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, 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 Taskid Compare CDL Options panel, press Enter.
- On the TASKID Migrate Profiles panel, specify the migrate profiles.
- (Optional) Specify the name of an outbound migrate profile. The outbound migrate profile can contain change rules and locations. Change Manager applies the rules after it performs the comparison (when it generates the CDL).
- (Optional) Specify the name of an inbound migrate profile. The inbound migrate profile can contain change rules. It can be used when the CDL that is generated from the comparison is imported.
- Press Enter.
- On the Change Manager Datasets panel, specify the data set names to be used by the Analysis and Execution components of Change Manager. Then, press Enter.
On the TASKID Interface panel, select your options for processing the CM/PILOT worklist.
- To edit the CM/PILOT worklist, type S to select Edit Worklist.
- To create the JCL to run the worklist, type S to select Create JCL.
- To review or modify the JCL, type S to select Edit JCL.
- To submit the JCL to run the CM/PILOT worklist, type S to select Submit JCL.
- Press Enter.
CM/PILOT creates an Analysis worklist and the Execution JCL that is required to run the worklist.
To run the comparison and to import the resulting CDL into an alter-type work ID, execute the Analysis worklist.