Step 1. Specify the objects and information to migrate

You can migrate object definitions, object data, views, catalog statistics, or any combination of this information for Db2 databases, table spaces, and tables, as well as their dependent objects.

Procedure

To specify the objects and information to migrate:

  1. On the DB2 Administration Menu (ADB2) panel, specify option 1, and press Enter.
  2. On the System Catalog (ADB21) panel, specify one of the following options, and press Enter:
    • D for databases
    • S for table spaces
    • T for tables
    • V for views
    You can use any of these object types as a base to select objects that you want to migrate.
  3. On the Databases (ADB21D) panel, Table Spaces (ADB21S) panel, Tables, Views, and Aliases (ADB21T) panel, or Views (ADB21VV) panel, issue the MIG primary command or line command.
    Tip: If you use the MIG primary command, first filter the list of objects on the panel so that only the objects that you want to migrate are listed.
  4. On the Migrate Table Spaces (ADB28S) panel, Migrate Tables (ADB28T) panel, or Migrate Views (ADBP8V) panel, take one of the following actions:
    • To specify the objects individually, modify the list of objects on this panel as needed by using the available commands and line commands. For example, on the Migrate Table Spaces (ADB28S) panel, you can use the MIGARC command to add all related archive table spaces.
    • Start of changeTo specify an object scope, do not modify the list of objects on this panel. You can later specify the object scope as part of Step 2. Generate the migration batch jobs.End of change
  5. Specify the NEXT command.
  6. For views, specify the level at which you want to migrate the view on the DDL Level (ADBP8VO) panel, and press Enter.
    Figure 1. DDL Level (ADBP8VO) panel
    ADBP8VO n ---------------------- DDL Level --------------------------- 13:15 
    Command ===>                                                                 
                                                                                 
                                                                                 
    DDL level . . . VW (DB - Database, TS - Tablespace, TB - Table, VW - View)   
                                                                                 
                                                                                 
  7. On the Migrate Parameters (ADB28M) panel, specify the GEN option, and press Enter.
  8. On the Generate SQL from DB2 catalog (ADBP8MG) panel, specify the SQL statements that you want generated for the migration, and press Enter:
    Figure 2. Generate SQL from DB2 catalog (ADBP8MG) panel
    Start of change
    ADBP8MG n -------------- DD1A Generate SQL from DB2 catalog ------------- 23:44
    Command ===>                                                                    
      
    Show this panel prior to each use . . N (Y,N) 
                                                                                 
    SQL statement types to be generated from the DB2 catalog:                     
      CREATE VIEW  . . . . . . . . . . Y (Y,N,D)  
      CREATE INDEX . . . . . . . . . . Y (Y,N)     
      CREATE SYNONYM . . . . . . . . . Y (Y,N)       
      CREATE ALIAS . . . . . . . . . . Y (Y,N)       
      CREATE TRIGGER . . . . . . . . . Y (Y,N,D)    
      CREATE MASK  . . . . . . . . . . Y (Y,N)       
      CREATE PERMISSION  . . . . . . . Y (Y,N)                                            
      CREATE STORAGE GROUP . . . . . . Y (Y,N)
      CREATE parent DATABASE . . . . . N (Y,N)
      CREATE parent TABLESPACE . . . . N (Y,N)  
      
      GRANT access ON DATABASE . . . . Y (Y,N,A,R) 
      GRANT access ON TABLESPACE . . . Y (Y,N,A,R) 
      GRANT access ON TABLE  . . . . . Y (Y,N,A,R) 
      GRANT access ON VIEW . . . . . . Y (Y,N,A,R)
      GRANT use OF STORAGE GROUP . . . Y (Y,N,A,R)
    
      ALTER TABLE ADD FOREIGN KEY  . . Y (Y,N,D) 
      LABEL ON . . . . . . . . . . . . Y (Y,N) 
      COMMENT ON . . . . . . . . . . . Y (Y,N) 
      ALTER TABLE ACTIVATE CONTROL . . Y (Y,N) 
    
    Other GEN options:  
      New TS storage group  . . .           >        
      New IX storage group  . . .           >        
      New database  . . . . . . . 
      New schema of objects . . .           >        
      New grantor . . . . . . . .           > 
                                                        
      Use Masking . . . . . . . . . . . . N (Y,N)     
      Run SQLID . . . . . . . . . . . . .          (Blank, a SQLID, <NONE>)                       
      IDENTITY START value  . . . . . . . ORIGINAL (Original,Computed)          
      Retain GENERATED ALWAYS:                                             
        For ROWID . . . . . . . . . . . . N (Y,N)                          
        For ROW CHANGE TIMESTAMP  . . . . N (Y,N)
      Include SQL comments  . . . . . . . N (Y,N)                          
      Target Function Level . . . . . . .          (Current DB2 FL: 507) 
      Include Db2 pending chgs  . . . . .          (Yes,No,Alter)       
    End of change
  9. On the Migrate Parameters (ADB28M) panel, specify the following options to indicate which information you want to migrate:
    Scope of migrate:
    Specify whether you want to migrate DDL, data, and catalog statistics.
    Catalog statistics options:
    Specify the qualifier for the target catalog and the catalog tables that you want to update.

    When you migrate catalog statistics, Db2 Admin Tool generates INSERT, UPDATE, and DELETE statements that modify the catalog statistics. The statements are generated with the qualifier of the target catalog that you specify. The statistic fields that are modified are those fields that are associated with the objects that are being migrated. (The complete list of statistics fields are those fields that are set by RUNSTATS that can be modified and the five statistics columns for table functions in SYSROUTINES, which are not set by RUNSTATS.)

    Tip: To control the number of generated statistics, specify SELECT in the Statistics tables field. Later in the process (as part of Step 2. Generate the migration batch jobs), you can select which catalog tables you want to update with statistics.
    Figure 3. Migrate Parameters (ADB28M) panel
    ADB28M in ------------------- DD1A Migrate Parameters ------------------- 09:58
     Option ===> GEN                                                                 
                                                                                    
     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                                                              
    

    Keep this panel open. In the next step (Step 2. Generate the migration batch jobs), you will continue entering options on the Migrate Parameters (ADB28M) panel.

What to do next

Step 2. Generate the migration batch jobs