USING specification for IMPORT

USING specifies the name of the migration file created by the BMC AMI Copy EXPORT command.

The syntax diagram for the USING specification is in IMPORT syntax.

USING dataSetName

The USING option is required when you specify IMPORT command. USING specifies the name of the migration file created by the BMC AMI Copy EXPORT command. The migration file contains migration information for one or more table spaces and index spaces. This information includes object identifiers, copy data set names, and other data relating to the target table spaces and index spaces.

OptionDescription
CHANGE TABLE FROM creator1.tableName1 TO creator2.tableName2 or CHANGE INDEX FROM creator1.indexName1 TO creator2.indexName2

When the table names or index names are not the same between the source and the target subsystems, use the CHANGE ... FROM ... TO syntax to resolve differences.

Each table or index must contain a creator and a name. You can use an asterisk (*) as any portion of the name.

You must take care when using wildcard. If the name in the FROM clause does not produce a one-to-one match for all the tables or indexes on the target space, the space is considered unrecoverable.

For example, you may want to copy the production payroll tables to the test subsystem, but the creator names between these two subsystems are different. Use the CHANGE TABLE feature to identify table name matches between the two subsystems. The migration file is searched for the FROM table name pattern and is substituted with the TO table name pattern. Multiple CHANGE TABLE FROM ... TO clauses are allowed in a single USING specification.

In the following specification, all the tables in the migration file with the creator name of PAYPROD resolve to a creator name of PAYTEST, which matches the tables on the target subsystem.

 IMPORT USING 
<dataSetName> CHANGE TABLE FROM PAYPROD.* TO PAYTEST.*
EXCLUDE (dbname.ts or qualifier.ix)

The EXCLUDE option in the USING specification excludes one or more objects from the import process. You can use wildcards or specific names to specify the exclusions. The following wildcards are valid:

  • % and * match one or more characters in the object name.

  • _ and ? match a single character in the object name.

List the excluded objects following the EXCLUDE keyword. Each item in the list must be in the form dbname.ts or qualifier.ix and you must separate the individual items with commas. Enclose the list in parentheses.

DSNUM

You can exclude multiple partitions from the specified object.

  • DSNUM ALL is allowed with partitioned and nonpartitioned objects.

  • DSNUM begin : end is allowed for partitioned objects to exclude a range of partitions.

  • DSNUM integer is allowed for partitioned objects to exclude a single partition.

SYNC

The SYNC option indicates if migration should include all spaces in the IMPORT command or only those spaces that have changed since the last migration.

SYNC is useful in cases where the image copy indicated by the current EXPORT file is identical to the spaces imported previously.

ValueDescription
SYNC AUTO

(Default) Specify SYNC AUTO to replace only spaces that have changed since the last time those spaces were imported. Consider this option when migrating to a query-based environment when the spaces are read only. Cost savings can be significant if you only refresh the objects that have changed since the last migration.

SYNC REPLACE

Specify SYNC REPLACE to replace all spaces regardless of whether they have changed or not. Consider this option when migrating to a subsystem where the data is manipulated in test environment.

INDEXES

The INDEXES option specifies how BMC AMI Recover handles indexes when you specify the IMPORT command. (You can also use INDEX or INDEXS instead of INDEXES.)

ValueDescription
INDEXES AUTO

(Default) INDEXES AUTO tells BMC AMI Recover to recover indexes if information is available for them in the migration data set. Any index not in the migration data set but defined on the target system is rebuilt.

INDEXES RECOVER

INDEXES RECOVER tells BMC AMI Recover to recover indexes on the target system if they have entries in the migration data set.

INDEXES REBUILD

INDEXES REBUILD tells BMC AMI Recover to rebuild all indexes on the target system regardless of whether they have entries in the migration data set.

INDEXES NO

INDEXES NO tells BMC AMI Recover that indexes on the target system are left unchanged.

RESET

The RESET keyword causes the log points in each data page to be reset to '0'. You must specify RESET when you are migrating data from one Db2 non-data-sharing system to another because the log point values on the first subsystem are meaningless or misleading on the target Db2.

NOCOPYPEND

The NOCOPYPEND option resets COPY-pending status and issues message BMC96232 to inform you that COPY-pending status has been reset even though the space is not recoverable.

You may want to use the NOCOPYPEND option if you are migrating data from one Db2 subsystem to another in a query or testing system where you do not need to be able to run a recovery on the target space.

Because the input copy is not registered on the target system, the target space is not recoverable after the IMPORT. You cannot run a RECOVER to current on the target system because no usable copies are registered in SYSCOPY or BMCXCOPY (but you could run IMPORT again).

STATS

The STATS option allows you to carry forward existing RUNSTATS from a migration file. These RUNSTATS may then be optionally applied during an BMC AMI Recover IMPORT. To import stats, you must have specified STATS YES in the BMC AMI Copy EXPORT command.

ValueDescription
STATS YES

STATS YES updates RUNSTATS information on the target system by using information from the migration file. RTS statistics are also updated.

STATS NO

(Default) RUNSTATS information is not updated. RTS statistics are always updated.

STATS AUTO

STATS AUTO updates RUNSTATS information on the target system by using information from the migration file. RUNSTATS information is collected for indexes that do not have RUNSTATS information and will be rebuilt.

COLSTATS

( BMC.DB2.SPE2110 Open link )


You can use the COLSTATS option to carry forward existing RUNSTATS column statistics from a migration file and to apply these column statistics during a BMC AMI Recover IMPORT. To import statistics, you must have specified STATS YES COLSTATS YES in the BMC AMI Copy EXPORT command.
Column statistics from SYSCOLSTATS, SYSCOLDIST, SYSCOLDISTSTATS, and SYSCOLUMNS are included in the migration file.

ValueDescription
YESUpdates RUNSTATS column statistics information on the target system using information from the migration file
NO(Default) Specifies that RUNSTATS column statistics information not to be updated.

Important

You can specify COLSTATS option only if STATS YES or STATS AUTO command is requested.

MATCHING

The MATCHING option controls the logic of IMPORT and MIGRATE processing if the table definitions are not the same for the source and target subsystems.

OptionDescription
AUTO

Tells BMC AMI Recover to do one of the following actions, depending on the column definition:

Column definition

Action

Not compatibleDoes not migrate the data
Compatible

Migrates the data

For an IMPORT, BMC AMI Recover calls REPAIR CATALOG (or REPAIR VERSIONS) if there are column differences.

AUTO is the default value if BMC AMI Recover is not running for Db2 Version 10. If you specify MATCHING AUTO when running Db2 Version 10, BMC AMI Recover generates a warning and forces MATCHING REQUIRED.

REQUIRED

Tells BMC AMI Recover to allow recovery only if definitions match

REQUIRED is the default value if BMC AMI Recover is running for Db2 Version 10.

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

DEFNOSRC ( SPE2010 Open link )

The DEFNOSRC option specifies whether BMC AMI Recover should reset the target space so that it is empty. This option works only if the source table space was created with the DEFINE NO attribute and is not yet populated. 

OptionDescription
IGNORE(Default) Ignores a request to reset the target space. The product works in the same manner as before
RESETTGTResets the target space  

UPDMAXASSIGNEDVAL

( BMC.DB2.SPE2110 Open link )


The UPDMAXASSIGNEDVAL option specifies whether BMC AMI Recover updates the MAXASSIGNEDVAL column in the SYSIBM.SYSSEQUENCES catalog table for identity columns.

ValueDescription
YESSpecifies that BMC AMI Recover updates MAXASSIGNEDVAL when the imported table has an identity column. 
NO(Default) Specifies that BMC AMI Recover does not update MAXASSIGNEDVAL when the imported table has an identity column.

Important

The sequence for XML DOCID column is always updated if target MAXASSIGNEDVAL is less than source MAXASSIGNEDVAL value, otherwise the sequence is updated based on the value specified for UPDMAXASSIGNEDVAL option.

Related topic
Was this page helpful? Yes No Submitting... Thank you

Comments