Importing changes

You can create a change by importing SQL statements from a data set. When you import the statements, a new change is created and registered. You can import multiple delta changes as a group in one change.

About this task

You can import SQL statements (DDL), delta changes that are generated by IBM® Db2 Object Comparison Tool for z/OS®, or a mix of SQL statements and delta changes if they logically relate.

Object Comparison Tool creates a delta change if CHANGE is specified for the Generate apply jobs field on the Generate Compare Jobs (GOC5) panel. (This specification generates parameter CMDELTA for GOC2CMP).

Warning: Importing an Object Comparison Tool change data set that is not generated as a delta change can have unwanted side effects that cannot be checked during the import process.
Requirements:
  • When you import SQL statements into a change, the subsystem that is used for the import operation must support the SQL statements that you are importing.
  • If you are importing a delta changes data set, the data set must represent one generated delta changes file. Concatenating or merging multiple data sets into one can cause unpredictable results, because statements are reordered during the import process.
  • The data sets from which you are importing the SQL statements must be one of the following types:
    • One of the following delta changes data sets: Any other change data sets that are produced by Db2 Admin Tool cannot be imported.
    • A data set that contains SQL statements and meets the following requirements:
      • A fixed-block sequential data set (RECFM=Fx)
      • A member of a partitioned data set with a logical record length of 80 (LRECL=80)

You can create a single change by importing multiple files at the same time; all data set types that are valid for import operations can be part of the same import.

During the import process, the syntax of each change statement in the imported SQL statements is checked. However, semantic checking is done during the analyze process.

Restriction: Changes to tables or sequences using alias names is not supported. The actual name of the object must be used.

Procedure

To import changes:

  1. On the DB2 Administration Menu (ADB2) panel, specify option CM, and press Enter.
  2. On the Change Management (CM) (ADB2C) panel, specify option 1, and press Enter.
  3. On the Manage Changes (ADB2C1) panel, specify option 4, and press Enter.
  4. On the Import Changes (ADB2C14) panel, specify the name of the data set that contains the SQL statements that you want to import, and press Enter.

    If the input data set is a partitioned data set (PDS), you must specify a member name or a member pattern (as defined by ISPF). If a member pattern is specified, all members that fit the pattern are added to the list of data sets to import; they are listed in member name sequence.

  5. Specify additional input data sets as needed:
    ADB2C14 n ------------------- CM - Import Changes ------------------- 08:05
    Command ===                                                                    
                                                                                   
    Commands : CONTINUE RESET                                DB2 System: DD1A      
                                                                                   
    Input data set information:                                                    
      Data set name .                                                              
        Member  . . .          (member name or pattern if partitioned)             
    Line commands :                                                                
    M - Move   A - After  B – Browse  D - Delete                                   
                                                                                   
    Select Seq Data set name                                                Oper.  
    ------ --- --------------------------------------------------------     ------ 
                                                                                   
             1 USER01.PROD.CHANGES(FEB08001)                                       
             2 USER01.PROD.CHANGES(FEB08002)                                       
             3 USER01.PROD.CHANGES(FEB08003)                                       
             4 USER01.PROD.CHANGES(FEB08010)                                       
             5 USER01.PROD.CHANGES(FEB08011)                                       
             6 USER01.PROD.CHANGES(FEB08071)                                       
             7 USER01.PROD.CHANGES(FEB08072)                                       
             8 USER01.PROD.CHANGES(FEB08073)                                       
             9 USER01.PROD.CHANGEXX                                                
            10 USER01.PROD.CHANGES(XXCHGA)                                         
            11 USER01.PROD.CHANGES(XXCHGB)                                         
    ******************************* END OF DB2 DATA *******************************   
    

    If you need to clear the list of data sets, issue the RESET command.

  6. Specify the sequence in which you want these input data sets processed by using the line commands M and A to move entries in the list.
    The input data sets are processed in the sequence in which they are listed on the panel.
    Recommendation: Carefully plan for any situation where you are importing multiple data sets into a single change. Db2 Admin Tool cannot check whether the changes in the specified sequence will logically work as desired. The input changes are imported into the change individually in the sequence that they are specified. You must ensure that any change in the list logically has all preceding changes as prerequisites.
  7. Issue the NEXT command, and press Enter.
  8. On the Select process modes (ADB2C14M) panel, specify values for Prereq resolution mode and Execution mode, and press Enter:
    ADB2C14M  ------- CM Import changes - Select process modes --14:28 
                                                                             
                                                                             
     Specify how to continue Import :                                        
                                                                             
     Prereq resolution mode  . BATCH     (TSO/Batch)                         
     Execution mode  . . . . . BATCH     (TSO/Batch)                                           

    Importing a change is a two-phase process in which Db2 Admin Tool determines if any pending changes exist for the objects and then registers the imported change. The processing modes are:

    TSO
    Perform the processing in the foreground.
    Batch
    Perform the processing in background.
  9. If you specify TSO for both Prereq resolution mode and Execution mode, complete the following steps:
    1. On the Register Options (ADB2CRO) panel, specify the following information, and issue the NEXT command:
      • An owner for the change. (The default owner is the current SQL ID.)
      • A name for the change.

      Optionally, you can also specify a comment, an ignore, and a mask for the change.

    2. If the changes in the data set affect objects that have pending changes, on the Import - Pending Changes (ADB2C14P) panel, specify one of the following actions to take, and press Enter.
      Prereq
      Make the pending changes a prerequisite for this change.
      Supersede
      Make this change a prerequisite change for the pending changes. The pending changes are put in DEFINED status.
      Ignore
      Ignore the pending changes. The pending changes are left in analyzed status.

      Virtual changes are not applied to the object and prerequisites are not established. You are responsible for establishing the prerequisites and ensuring that pending changes do not conflict with the current change. To help identify any conflicting changes, use run-time analyze when running this change.

      Cancel
      Cancel importing this change.
      Display
      Display the changes that are pending.
    3. On the Import Changes (ADB2C14) panel, verify the message that indicates whether the change was registered successfully.
      The change is put in DEFINED status. If pending changes exist and you specified Ignore as the action to take, pending changes are not put in DEFINED status.
  10. If you specify TSO for Prereq resolution mode and Batch for Execution mode, complete the following steps:
    1. On the Promote Target Output Data Set Name (ADB2DSAL) panel, specify the name of an output data set name to contain the (delta) change statements, and press Enter.
    2. On the Register Options (ADB2CRO) panel, specify the following information, and issue the NEXT command:
      • An owner for the change. (The default owner is the current SQL ID.)
      • A name for the change.

      Optionally, you can also specify a comment, an ignore, and a mask for the change.

    3. If the changes in the data set affect objects that have pending changes, on the Import - Pending Changes (ADB2C14P) panel, specify one of the following actions to take, and press Enter.
      Prereq
      Make the pending changes a prerequisite for this change.
      Supersede
      Make this change a prerequisite change for the pending changes. The pending changes are put in DEFINED status.
      Ignore
      Ignore the pending changes. The pending changes are left in analyzed status.

      Virtual changes are not applied to the object and prerequisites are not established. You are responsible for establishing the prerequisites and ensuring that pending changes do not conflict with the current change. To help identify any conflicting changes, use run-time analyze when running this change.

      Cancel
      Cancel importing this change.
      Display
      Display the changes that are pending.
    4. Review the generated job to register the change and submit the JCL.

      When the job completes successfully, the change is registered and put in DEFINED status. If pending changes exist and you specified Ignore as the action to take, pending changes are not put in DEFINED status.

  11. If you specify Batch for Prereq resolution mode, you must specify Batch for Execution mode. In this case, complete the following steps:
    1. On the Import a Change - Action for Pending Changes (ADB2CONF) panel, specify one of the following actions to take if pending changes exist for the objects that the imported change affects:
      Prereq
      Make the pending changes a prerequisite for this change.
      Supersede
      Make this change a prerequisite change for the pending changes. The pending changes are put in DEFINED status.
      Ignore
      Ignore the pending changes. The pending changes are left in analyzed status.

      Virtual changes are not applied to the object and prerequisites are not established. You are responsible for establishing the prerequisites and ensuring that pending changes do not conflict with the current change. To help identify any conflicting changes, use run-time analyze when running this change.

      Cancel
      Cancel importing this change.
      Recommendation: Specify Cancel to avoid registering the changes if pending changes exist. You can review the batch output, which lists the pending changes and decide whether to keep them as prerequisite changes or supersede them. Then, you can import the change again and specify either Prereq or Supersede.
    2. On the Register Options (ADB2CRO) panel, specify the following information, and issue the NEXT command:
      • An owner for the change. (The default owner is the current SQL ID.)
      • A name for the change.

      Optionally, you can also specify a comment, an ignore, and a mask for the change.

    3. Review the generated job and submit the JCL.

Results

You can now display your imported change (Displaying changes), and then run it (Running a change).