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.

Related topic

USING dataSetName

The USING option is required when you specify the 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.

Option

Description

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 might 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.

Value

Description

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 the 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.)

Value

Description

INDEXES AUTO

(Default) INDEXES AUTO tells BMC AMI Recover to recover indexes if the 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.

Important

For optimal results with EXPORT and IMPORT, make sure that the image copies for both table spaces and index spaces are consistent. If the table space and image space copies are not registered at the same RBA, you might receive the following informational message indicating that the copies might not be consistent:

BMC180132I databaseName.spaceName(part) MAY NOT BE CONSISTENT (X’rba’, X’rba’)

This message suggests only possible inconsistencies due to registration RBAs but does not confirm them.

If a table has multiple indexes, you must register all image copies for the index spaces at the same RBA to include them in the migration file. The expected RBA is set by the first exported index. For any other index image copies not registered at that first RBA, the image copy information is not included in the migration file although the migration file will still include the other catalog data for the indexes. 

To include the missing index image copies in the migration file, you must make index image copies with a common RBA and then rerun EXPORT to rebuild the migration file.

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 might 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 might 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.

Value

Description

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



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.

Value

Description

YES

Updates RUNSTATS column statistics information on the target system using information from the migration file

NO

(Default) Specifies that RUNSTATS column statistics information is not to be updated.

Important

You can specify the COLSTATS option only if the 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.

Option

Description

AUTO

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

Column definition

Action

Not compatible

Does 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.

REQUIRED

Tells BMC AMI Recover to allow recovery only if definitions match

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

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. 

Option

Description

IGNORE

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

RESETTGT

Resets the target space  

UPDMAXASSIGNEDVAL



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

Value

Description

YES

Specifies 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 the XML DOCID column is always updated if the target MAXASSIGNEDVAL is less than the source MAXASSIGNEDVAL value, otherwise, the sequence is updated based on the value specified for UPDMAXASSIGNEDVAL option.

This option specifies whether BMC AMI Recover should update the catalog and DBD information for a target XML Tablespace when a version mismatch is detected during an IMPORT operation.

Valid values are as follows:

Value

Description

YES

Specifies that 

BMC AMI Recover

 accepts an IMPORT of an XML Tablespace when the row versions do not match. 

BMC AMI Recover

 will update the catalog and DBD information on the target tablespace and table to match the source. These updates will create a point where a recovery to a point before this change is not possible. The imported XML Tablespace will be in AREO* status.

NO

(Default) Specifies that 

BMC AMI Recover

  rejects an IMPORT when the row versions on an XML Table do not match between the source and the target.

 

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