Step 2. Generate the migration batch jobs

Start of changeYou can choose to have the migration batch jobs generated online or in batch. Generate the jobs in batch if you want to specify an object scope.End of change

If you specify to have the migration jobs generated in batch, Db2 Admin Tool creates a work data set (MIGVARS) that stores the parameter information that you specify on Migrate Parameters (ADB28M) panel and the necessary ISPF tables to use as input when generating the migration source and target JCL. For more information about the data sets that are required during this migration process, see Work data sets used by the MIG function.

Before you begin

Before you generate the migration batch jobs, complete Step 1. Specify the objects and information to migrate.

Procedure

To generate the migration batch jobs:

  1. On the Migrate Parameters (ADB28M) panel, specify the following job and data set options, and press Enter:
    Worklist name and Data set information:
    Use these fields to change the default qualifier values that are used for the MIGVARS data set.
    Target system parameters:
    Specify the SSID, node name, sample program load library, and JCL data set information for the target subsystem.
    Migrate options:
    Specify the remaining options (those options other than Scope of migrate, which you specified in the last step in Step 1. Specify the objects and information to migrate).

    Start of changeIf you want to specify an object scope, specify YES for the Generate MIG jobs in batch option.End of change

    If you specify YES for the DROP on target before CREATE field, any RESTRICT ON DROP conditions for tables are not considered. If a table is defined with RESTRICT ON DROP, you must remove that attribute for the DROP statement to complete successfully.

    If you specify UNLOAD in the Unload method field and YES in the Parallel utilities field, and do not provide your own UNLDDN template, the default template ASYREC6 with variable &PART or &PA in the ADB2UCUS skeleton is used as the template for the unload data set. When &PART or &PA is specified, Db2 Admin Tool replaces the variable with 00001 up to the maximum partition number of the associated object. The total length of the values for &PREFIX and &LEVEL must not exceed 12 bytes.

    Optional steps after reload:
    Specify which jobs you want to run after reloading the data.

    The CHECK DATA, RUNSTATS, and COPY requests are not generated for implicitly created table spaces.

    The REBIND option generates rebinds of the source packages for the target system.

    Utility control options
    Specify whether to use templates and custom utility options.

    If you set the option Use customized utility options to YES, use the UO (Customize utility options) command to specify the utility options. To customize the HPU utility, enter the HPU option on the Change Utilities Options (ADB2UOPS) panel, as described in Unloading objects by using Db2 High Performance Unload.

    If you choose to migrate only the data, use the LOAD utility option REPLACE or RESUME to control how the data is loaded into the target system with the following restrictions:
    • Db2 does not allow using LOAD REPLACE on certain types of tables. When LOAD REPLACE is specified but not allowed, the RESUME YES option is used instead.
    • If all tables in a multi-table table space are not selected for migration on the source system, and the LOAD REPLACE option is specified, RESUME YES is used instead.
    • If all tables in a multi-table table space are selected for migration on the source system, and the LOAD REPLACE option is specified, any additional tables in the table space on the target system remain empty after migration.
    If you do not use customized utility options, Db2 Admin Tool uses the default REPLACE and RESUME option that is generated by the Db2 UNLOAD utility or the Db2 High Performance Unload (HPU) utility.
    Figure 1. Migrate Parameters (ADB28M) panel
     ADB28M ------------------- DD1A Migrate Parameters ------------------- 09:58
     Option ===>                                                                    
                                                                                    
     Please specify the following for DB2 Admin Migrate:      DB2 System: DD1A      
                                                              DB2 SQL ID: ADM001     
                                                                        More:     + 
     Worklist name . . . . . . .            (also used as middle qualifier in DSNs) 
                                                                                    
     Data set information:                                                          
       PDS for jobs  . . . . . .   MYMIGR.JCL            
       Prefix for datasets . . .   ISTJE                                            
                                                                                    
     Target system parameters:               
       DB2 subsystem id (SSID) .   DB2X        DB2 release  . . . . : 1101              
       Target system node name .               Submit job at local. : NO  (Yes/No)      
       DB2 sample pgm load lib .   DBS.DSN110.RUNLIB.LOAD                              
       Target JCL job data sets for Admin and DB2                                         
         Use customization settings for Admin libs . . . . . NO  (Yes/No)                 
         Use customization settings for the following libs . NO  (Yes/No)                   
           DB2 Admin APF library . .                                                       
           DB2 exit library  . . . .                                                        
           DB2 load library  . . .   SYS1.DSNDB2X.SDSNLOAD                          
       Catalog statistics options:                                                  
         Catalog qualifier . . . . . HI          >  (default SYSIBM)                
         Statistics tables . . . . . SELECT         (All or Select. Default is All) 
                                                                                    
     Migrate options:                                                               
       Generate MIG jobs in batch  . . .   NO       (Yes/No)                        
       Generate work stmt list . . . . .   NO       (Yes/No)                        
       Combine job steps . . . . . . . .   YES      (Yes/No, Yes if HPU Unload)     
         Member prefix for combined jobs   ADBMG    (default ADBMG )                
       Scope of migrate:                                                            
         DDL . . . . . . . . . . . . . .   N        (Yes/No)                        
         Data  . . . . . . . . . . . . .   N        (Yes/No)                        
         Catalog statistics  . . . . . .   N        (Yes/No)                        
       DROP on target before CREATE  . .   NO       (Yes/No,No if scope DDL is NO)  
       Unload method . . . . . . . . . .   U        (U - Unload, H - HPU, C - Cross)
       Parallel utilities  . . . . . . .   NO       (Yes/No)                        
                                                                                    
     Optional steps after reload:                                                   
       Run CHECK DATA  . . . . . . . . . : NO       (Yes/No)                        
       Run RUNSTATS  . . . . . . . . . . : NO       (Yes/No)                      
       Run IMAGE COPY  . . . . . . . . . : NO       (Yes/No)                      
       Run REBIND  . . . . . . . . . . . : NO       (Yes/No)                      
                                                                                  
     Utility control options:                                                     
       Generate template statements  . . :          (Yes/No)                      
       Use customized utility options  . :          (Yes/No)                      
                                                                                  
     BP  - Change batch job parameters                                             
     TU  - Specify template usage                                                  
     UO  - Customize utility options                                               
     GEN - GEN options                                                              
    

    After you press Enter, Db2 Admin Tool starts to generate the jobs required for migration.

  2. If the Specify Masks (ADB2GENM) panel is displayed, follow the instructions in Specifying masks.
  3. If the Catalog Statistics Tables (ADBPGEN2) panel is displayed (because you specified SELECT in the Statistics tables field), specify the catalog tables that you want to update with statistics. Remove the slash (/) next to catalog tables that you do not want to update.
    For example, removing the slash (/) that is next to SYSCOLDISTSTATS turns off the generation of updates to that table.
    Tip: Tables with the suffix of DISTSTATS are used to store partition-level statistics. These tables are not used by the optimizer but are used by RUNSTATS. Therefore, tables with the suffix of DISTSTATS can be turned off if you do not plan to run RUNSTATS on the target objects.

If you chose to generate the migration jobs online, the Migrate Progress (ADB28MP) panel is displayed to show the progress of building the jobs. In this case, you do not need to take any action. When Db2 Admin Tool finishes generating the jobs that are required for migration, they are displayed in an ISPF Edit session, as shown in the following example. You can skip the remaining steps in this procedure and continue to Step 3. Run the migration batch jobs.

Figure 2. Sample migrate edit panel
   Menu  Functions  Utilities  Help
 ------------------------------------------------------------------------------
 EDIT     ISTJE.MIGDSN85.JCL                                 Row 00001 of 00011
 Command ===>                                                  Scroll ===> PAGE
    Name     Prompt          Size    Created           Changed           ID
 . SST1RE                      60   2007/11/25   2007/11/25 00:55:00   ISTJE
 . SST2UL1                     64   2007/11/25   2007/11/25 00:55:00   ISTJE
 . SST3CH                      34   2007/11/25   2007/11/25 00:55:00   ISTJE
 . SST4XF                      19   2007/11/25   2007/11/25 00:55:00   ISTJE
 . SST5DE                      29   2007/11/25   2007/11/25 00:55:00   ISTJE
 . TST1CR                      23   2007/11/25   2007/11/25 00:55:00   ISTJE
 . TST2RL                      96   2007/11/25   2007/11/25 00:55:00   ISTJE
 . TST3CK                      35   2007/11/25   2007/11/25 00:55:00   ISTJE
 . TST4RS1                     23   2007/11/25   2007/11/25 00:55:00   ISTJE
 . TST5IC                      58   2007/11/25   2001/11/25 00:55:00   ISTJE
 . TST7DE                      29   2007/11/25   2007/11/25 00:55:00   ISTJE
   **End**                                                                  

If you chose to generate the jobs in batch, an ISPF edit session opens and lists the generated jobs. These jobs are needed to generate the migration jobs. In this case, continue with the remaining steps.

Start of change
Figure 3. Sample of job edit panel for generating the migrate jobs in batch
   Menu  Functions  Utilities  Help
 ------------------------------------------------------------------------------
 EDIT     ISTJE.MIGDSN85.JCL                                 Row 00001 of 00011
 Command ===>                                                  Scroll ===> PAGE
    Name     Prompt          Size    Created           Changed           ID
 . ADBMGSC                    121   2021/11/10   2021/11/11 00:55:00   ISTJE
 . ADBMGS0                     83   2021/11/10   2021/11/11 00:55:00   ISTJE
   **End** 
End of change

  1. Start of change If you want to specify an object scope, edit one of the following jobs according to the instructions in the job comments:
    • <Member prefix for combined jobs>SC, if you chose to combine the job steps
    • SSTSCBAT, if you chose not to combine the job steps

    This job redefines the object scope that is saved in the ADBSVARS data set for generating the migration batch jobs.

    End of change
  2. Submit one of the following jobs to generate the jobs that are required for migration:
    • <Member prefix for combined jobs>SO, if you chose to combine the job steps
    • SST0BAT, if you chose not to combine the job steps

What to do next

Step 3. Run the migration batch jobs