Exporting changes

You can selectively export multiple changes made in one environment so that you can later distribute those changes to multiple external environments.

About this task

To export changes, you must first create a list of the changes whose statements are to be promoted. You can arrange those changes in any desired sequence. When the list is complete and you request that those changes be exported, Db2 Admin Tool extracts all of the change statements to a single file. A new change is created with the type COMPARE; it is marked COMPLETE when the promote process is complete. That file with the change statements can be then be imported into different environment. The import function uses the statements in that file to implement the change in the target environment.

You can create a single change by exporting multiple files at the same time. All types can be part of the same export.

Exporting a change is a two-phase process in which Db2 Admin Tool determines if the objects have any pending changes and then registers the exported change. If the exported SQL statements affect objects that have pending changes, the system determines whether the change becomes a prerequisite change for those pending changes.

Requirement: When you export SQL statements into a change, the version of Db2 that is on the system must support the SQL statements that you are exporting.

Export processing can be done in TSO or batch mode. TSO is the default.

Procedure

To export a change:

  1. Navigate to the CM - Export Changes (ADBPC15) panel by completing one of the following sets of steps:
    • If you want to export multiple 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 5, and press Enter.
    • If you want to export a single change:
      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 1 and optionally any filtering criteria at the bottom, and press Enter.
      4. On the CM - Changes (ADB2C11) panel, issue the EX line command next to the change that you want to export.
  2. On the CM - Export Changes (ADBPC15) panel, issue the XC line command to exclude individual changes from the list as needed.
    If you navigated to this panel by selecting option 5 on the Manage Changes (ADB2C1) panel, all changes are listed and are marked as INCLUDE by default.
    Figure 1. CM - Export Changes (ADBPC15) panel
     ADBPC15 n --------------- CM - Export Changes ---------------------------
     Commands: NEXT  ADD  COMMENT  EXPOPT                                          
     Line commands:                                                                 
      I - Interpret  IC - Include Change  XC - Exclude Change
      ? - Show all line commands                        
                                                                           Operation
     Sel       ID Owner    Name                           Type    Status   Type     
                * *        *                              *       *        *        
     --- -------- -------- -----------------------------> ------- -------- ---------
             1066 SYSADM   D26985                         CHANGE  DEFINED  INCLUDE  
             3883 J148286  AUTO:2013-09-18-09.54.12.50428 CHANGE  ANALYZED INCLUDE   
                1 SCHAUFU  D24583A                        CHANGE  COMPLETE INCLUDE  
             1064 VNDLRC   DT26897.CHANGEOO.02            CHANGE  COMPLETE INCLUDE  
             1061 VNDRG    D27018 A2SMPETEST              CHANGE  ANALYZED INCLUDE  
             1060 VNDLRC   DT27024.CHANGE.01              CHANGE  ANALYZED INCLUDE  
             1059 VNDLRC   DT27024.CHANGE.00              CHANGE  COMPLETE INCLUDE  
               22 VNDEJB   EBX2                           CHANGE  DEFINED  INCLUDE  
                4 SYSADM   TST1                           CHANGE  DEFINED  INCLUDE  
                3 VNDEJB   DSFA                           CHANGE  DEFINED  INCLUDE  
             1053 XHLI     CHG00002                       CHANGE  ANALYZED INCLUDE  
             1052 XHLI     CHG00001                       CHANGE  DEFINED  INCLUDE  
     Command ===>                                                  Scroll ===> PAGE 
      F1=HELP      F2=SPLIT     F3=END       F4=RETURN    F5=RFIND     F6=RCHANGE   
      F7=UP        F8=DOWN      F9=SWAP     F10=LEFT     F11=RIGHT    F12=RETRIEVE  
  3. Optional: To specify a mask or change whether batch mode is used, complete the following steps:
    1. Issue the EXPOPT command, and press Enter.
    2. On the Export Options (ADBPC15O) panel, specify the relevant options, and press Enter:
      Figure 2. Export Options (ADBPC15O) panel
      ADBPC15O ---------------------- DD1A Export Options --------------------- 10:52
      Option ===>                                                                    
                                                                                     
      Please specify the following Export options:                                   
                                                                                     
      Export changes in batch . . . . . . . YES (Yes/No)                             
                                                                                     
      Enter mask details (optional):                                                 
        Mask Table Entry:                                                            
          Owner . . . .      >                  (? to look up)                       
          Name  . . . .                 >       (? to look up)                       
        Data Set:                                                                    
          Mask DSN  . .                                                              
        Options:                                                                     
          Edit Mask . .                         (Yes/No)                             
                                                                                     
      Show this panel prior to each use . . YES (Yes/No)   

      If you specify a mask, the mask is applied to the changes that you selected on the CM - Export Changes (ADBPC15) panel. The exported data set will have the specified mask applied.

      Tip: If you want this options panel to be always be displayed after the CM - Export Changes (ADBPC15) panel, change the last field to YES.
  4. On the CM - Export Changes (ADBPC15) panel, issue the NEXT command, and press Enter.
    If the Export Options (ADBPC15O) panel is displayed, specify any options on that panel as needed, and press Enter.
  5. On the Specify Data Set / Member Information (ADBPVERD) panel, specify parameters for the data set that is to contain the final list of exported changes, and press Enter: (This data set is a changes file that can later be imported to a different environment.)
    Figure 3. Specify Data Set / Member Information (ADBPVERD) panel
     ADBPVERD  -------------- Specify Data Set / Member Information ------------- 
                                                                                  
     Data Set Name  . . EXPORTED.CHANGES                                          
     *Member Name . . .                                                           
                                                                                  
     *Volume serial . . . . :               (Blank for system default volume)     
     Device type  . . . . . . SYSALLDA      (Generic unit)                        
     Space units  . . . . . . TRACKS        (TRKS or CYLS)                        
     Primary quantity . . . . 1             (In above units)                      
     Secondary quantity . . . 1             (In above units)                      
     *Directory blocks  . . . 0             (Zero for sequential data set)      * 
     *Record format . . . . : F             (F or V)                              
     *Record length . . . . : 80            F80                                   
     *Block size  . . . . . .                                                     
     *Data set name type  . .               (LIBRARY, PDS or blank)               
     (* Specifying LIBRARY may override zero directory block)                     
                                                                                  
      F1=HELP     F2=SPLIT    F3=END      F4=RETURN   F5=RFIND    F6=RCHANGE      
      F7=UP       F8=DOWN     F9=SWAP    F10=LEFT    F11=RIGHT                    
    

    Exporting multiple data sets into a single change should be carefully planned. The export function cannot check whether the changes in the specified sequence will logically work as desired. The changes will be imported into the change individually in the sequence they are specified, and you must ensure that any change in the list logically has all preceding changes as prerequisites.

    If you requested TSO mode, the requested changes are exported.

    If you requested batch mode, a JCL job is generated. You must submit the job to export the changes.