Creating a migration file for the Copy Migration feature


You can use the EXPORT, MIGRATE, and IMPORT commands to move data between Db2 subsystems simply and accurately. These commands support all BMC AMI Copy formats (including cabinet copies).

The tables on the source and target systems don't need to have the same number of columns and column types, but their columns must be compatible. The target table can have more columns and can assign default values if the table was created accordingly. 

 

For more information about which data types are compatible, see the IBM SQL Reference for ALTER TABLE, SET DATA TYPE, and Data Type Compatibility for Assignments and Comparisons table.

The Copy Migration feature requires one of the following valid passwords:

  • A Recovery Management for Db2 solution password
  • A BMC Database Administration for DB2 solution password
Warning

Important

For more information about the BMC AMI Recover MIGRATE and IMPORT commands, see BMC AMI Recover for Db2.

The BMC AMI Change Manager for Db2 product also has a data migration function that handles Data Definition Language (DDL) definition and Object Identifier (OBID) resolution. Change Manager also uses the Copy Migration feature (EXPORT and IMPORT only, not MIGRATE) of BMC AMI Copy and BMC AMI Recover. For more information, see ALTER and BMC AMI Change Manager for Db2.

Benefits of using the Copy Migration feature

Copy Migration feature with the BMC AMI Copy EXPORT commands and BMC AMI Recover MIGRATE and IMPORT commands provide the following benefits:

  • Supports importing copies that use BMC proprietary formats
  • Doesn't require you to manage data sets to keep up with current copies
  • Doesn't require you to know the OBIDs from the source system
  • Imports applications and object sets as a single unit
  • Doesn't require you to import unchanged objects (to save time)
  • Supports the use of older migration files to back date imports
  • Reduces errors, ensuring more accurate data migration (for example, less likely to use the wrong data set name or OBIDs)

Using Change Manager for data migration (EXPORT and IMPORT only), the Copy Migration feature provides the following benefits:

  • Simplifies the data movement process
  • Requires less JCL, and therefore less JCL management
  • Supports DSNUM values other than 0
  • Supports multiple imports and multitasking
Success

Best practice

We recommend that all table spaces be consistent. If a copy is included in an exported set and the spaces are inconsistent and you used the EXPORT command, message BMC180202 is issued.

Migration file

You can use the migration file to transfer all types of BMC AMI Copy and IBM copies between Db2 subsystems.

The migration file contains information to streamline the import recovery process with a minimum of user-supplied knowledge and intervention. You use the MIGRATE and IMPORT commands of BMC AMI Recover to complete the transfer and integration of data by using the copies.

The SYSCOPY and BMCXCOPY rows and metadata for the selected spaces are written to the designated sequential file. The metadata describes each table space with the information needed to translate OBIDs on the target system and to do checks during importing.

Each exported table space is registered in BMCXCOPY with COPY_TYPE = X. (You can use SQL Processor Using File Input (SPUFI) to find data set names of the appropriate migration files.)

For XML spaces, strings are encoded, and the encoding is saved in SYSIBM.SYSSTRINGS. The encoding might be different on different Db2 subsystems. Using the BMC AMI Copy EXPORT saves the information necessary to translate the strings in the migration file.

Information
Example

The following example shows how you can determine the data set names of the migration files for a specific table space:

  SELECT DBNAME, IXNAME,ICDATE, ICTIME, DSNAME                   
    FROM BMCUTIL.CMN_BMCXCOPY                                    
    WHERE IXNAME = 'TS01N1'                                      
    AND   COPY_TYPE = 'X'                                        
;                                                                
---------+---------+---------+---------+---------+---------+-----
DBNAME    IXNAME    ICDATE  ICTIME  DSNAME                       
---------+---------+---------+---------+---------+---------+-----
ACPIE01   TS01N1    120820  131854  ACP.QA.DEFQ.MA0065.G0001V00  
ACPIE01   TS01N1    120820  131828  ACP.QA.DEFQ.MA0060.G0001V00  
ACPIE01   TS01N1    120820  131553  ACP.QA.DEFQ.MA0015.G0016V00  
ACPIE01   TS01N1    120820  131523  ACP.QA.DEFQ.MA0010.G0033V00  
DSNE610I NUMBER OF ROWS DISPLAYED IS 4                           
DSNE616I STATEMENT EXECUTION WAS SUCCESSFUL, SQLCODE IS 100      
---------+---------+---------+---------+---------+---------+-----

Use the EXPOUT option on the OUTPUT command (OUTPUT syntax options) to specify that BMC AMI Copy should create a migration file.

Warning

Important

The migration file replaces the need for INCOPY and OBIDXLAT syntax with BMC AMI Recover. Records written to the file identify the correct data sets to use and how to translate the OBIDs from the source subsystem to the target subsystem.

Example EXPORT syntax

In this example, the OUTPUT descriptor defines a data set for exporting. Later in the SYSIN, an EXPORT command refers to OUTPUT EXPFILE.

Information
OUTPUT XPFILE
       UNIT SYSALLDA
       EXPOUT YES
       DSNAME 'RWC.EXPORT.D&DATE.T&TIME.X&TASK'

EXPORT TABLESPACE PAYROLL.*, INVENTRY.*
       EXPORTDDN (EXPFILE)

Limitations

The EXPORT command has the following limitations:

  • No support for incremental copies
  • No support for copies of the Db2 catalog
  • No support for clone spaces or spaces that were previously in a clone relationship
  • No support for specifying DSNUM

    First, EXPORT looks for DSNUM 0 or DSNUM 1 for either the latest full copy (LASTFULLCOPY) or for an exact RBA or LRSN. If EXPORT finds DSNUM 0, it uses that copy. If EXPORT finds DSNUM 1, it looks for DSNUM 2 and each consecutive number until it can't find a match. If EXPORT stops before reaching the number of partitions in a space, it stops with an error message.

    With multi-data set non-partitioned spaces, EXPORT will look for a DSNUM 0 or DSNUM 1 full copy matching the specified RBA or LRSN, and then look for image copies of additional data sets (DSNUM 2 – DSNUM n) that were registered with the same START_RBA.

    If you are using EXPORT with multi data set Large Object (LOB) table spaces, the copies should be made with RESETMOD NO. If RESETMOD YES is used with LOB table spaces, the COPY command is processed by the IBM Db2 COPY utility, and the copies of a multi-data set LOB might not be registered with the same START_RBA.

  • You can't specify EXPORT INDEXSPACE or EXPORT INDEX syntax. However, indexes are included when you specify INDEXES YES.
  • You can't write a migration file to a data set that is compressed via the COMPACTION option in the SMS data class. If BMC AMI Copy detects this situation, it issues message BMC180150E OUTPUT DATASET MAY NOT BE COMPRESSED.
  • You can't write a migration file to an AMI Cloud data set. If BMC AMI Copy detects a cloud data set, it issues message BMC180150E OUTPUT DATASET MAY NOT BE CLOUD DATA SET. For more information about Cloud Data Sets limitations, see Requirements and restrictions for integrating BMC AMI Data for Db2 with Cloud Data Sets.

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC AMI Copy for Db2 13.1