Handling Db2 versioning information
When you move objects that contain system pages from one Db2 subsystem to another Db2 subsystem, the version information on the target Db2 subsystem must match the version information on the source Db2 subsystem. If the version information does not match, you cannot access the data on the target Db2 subsystem.
If your version information does not match, use the following steps to move objects to another Db2 subsystem and to ensure that the version information matches.
To move objects to another Db2 subsystem
Ensure that the object definitions on the source and target Db2 subsystems are the same.For a table space, each table must have the same number of columns, and each column must be the same data type.
If you are copying indexes that have not been altered in Db2, check the SYSIBM.SYSINDEXES catalog table on both subsystems to ensure that the value in both the CURRENT_VERSION column and the OLDEST_VERSION column is 0.
Run BMC AMI Recover on the target subsystem with the OBIDXLAT option. On the control statement, specify the proper mapping of table database object identifiers (OBIDs) for the table space or index from the source to the target subsystem.
Run DB2 REPAIR VERSIONS on the object on the target subsystem or specify the BMC AMI Recover UPDATE VERSIONS option in Step 3.This action updates the version numbers in the target system’s catalog using the version numbers in the system pages or index directory pages that have been laid down from the source system.
For table spaces, the utility updates the following columns:
- OLDEST_VERSION and CURRENT_VERSION in SYSTABLEPART
- VERSION in SYSTABLES
- OLDEST_VERSION and CURRENT_VERSION in SYSTABLESPACE
For indexes, the utility updates OLDEST_VERSION and CURRENT_VERSION in SYSINDEXES. Db2 uses the following formulas to update these columns in both SYSTABLEPART and SYSINDEXES:
CURRENT_VERSION = MAX(target.CURRENT_VERSION,source.CURRENT_VERSION)OLDEST_VERSION = MIN(target.OLDEST_VERSION,source.OLDEST_VERSION)- If you need to rebuild indexes on your target system, you can do so now.
Related topic