******************************************************************** * _ __ _____ ______ * * / | / / / ___/ / ____/ * * / |/ / \__ \ / __/ * * / /| / ___/ / / /___ * * /_/ |_/ /____/ /_____/ Index Migration tool * * readme for Linux * * V1.0 * ******************************************************************** DB2 Net Search Extender indexes built under 32-bit DB2 instances are not compatible with 64-bit instances. Trying to search on an index, or to update an index, that was built under a 32-bit DB2 instance in a 64-bit instance always results in an error message preventing the operation from completion. To avoid that indexes have to be rebuilt completely, we offer a tool to migrate the indexes offline. The migration affects only a small number of metadata files, and is therefore performed quickly, and without large amounts of data movement. To perform this migration, execute the script which is delivered within this package. This readme is organized with the following sections: 1. migrate index from NSE V8 32-bit to NSE V9.x 64-bit 2. migrate index from NSE V9.x 32-bit to NSE V9.x 64-bit 3. steps to run the index migration tool in the NSE 32-bit set up. 1. migrate index from NSE V8 32-bit to NSE V9.x 64-bit *************************************************** Planning: ========= - Take a back-up of the database and Index directory from NSE V8 system - While doing back-up ensure that the metafiles with extensions .dii, .dei, .ded,.did ,.an,.as and .tf are backed-up properly. Migration steps: ================ This migration tool need to run only on a 32-bit source NSE instance which will be migrated to 64-bit.(This should not be run on a 64-bit instance) The sequence of steps for migrating a V8 32-bit instance with NSE indexes to a V9 64-bit instance is given below: Assuming we have a working V8 DB and NSE indexes. - prepare DB2 V8 32-bit database for moving to DB2 V9.x 64-bit(dropping DATALINKS UDFs) Drop the DataLink functions in the DB2 8 database: db2 Drop Specific Function DB2Ext.DataLinkContent1 db2 Drop Specific Function DB2Ext.DataLinkContent2 db2 Drop Specific Function DB2Ext.DataLinkContent4 db2 Drop Specific Function DB2Ext.DataLinkContent3 db2 Disconnect All - Migrate the 32-bit index files to 64-bit using migration tool ctemigridx.(refer the section 3 for details) - Take a backup of the database and index files from the 32-bit instance. - Move the backed-up files and database to the target machine where V9.x is installed. - Before migrating NSE indexes to Version 9.x 64-bit, migrate the required NSE databases to DB2 Version 9.x 64-bit. - Restore the NSE indexes and the newly generated 64-bit metafiles into the V9.x 64-bit set-up by following the below procedure: 1. Stop Net Search Extender, issue the following command: db2text stop 2. Restore the backup copies of the index directories to the SAME PATH as before. 3. Restart Net Search Extender, issue the command: db2text start - Migrate the NSE database to the current release db2extmdb - Perform alter index by mentioning new index and work directories(make sure the instance owner has the sufficient permission to access and alter the index files) Example: db2text alter index for text index directory work directory - Perform searches as before and verify whether the new migrated index is searchable 2. migrate index from NSE V9.x 32-bit to NSE V9.x 64-bit ***************************************************** Planning: ========= - Take a back-up of Database and Indexes from NSE V9.x 32-bit. - While doing back-up ensure that the metafiles with extensions .dii, .dei, .ded ,.did,.an,.as and .tf are backed-up properly. Migration steps: ================ This migration tool need to run only on a 32-bit source NSE instance which will be migrated to 64-bit. (This should not be run on a 64-bit instance.) Assuming we have a working V9.x 32-bit DB and NSE indexes. - Migrate the 32-bit index files to 64-bit using the migration tool ctemigridx.(refer the section 3 for details) - Take a back-up of the database and index files from the 32-bit instance. - Move the backed-up files and database to the target machine where V9.x is installed. - Before migrating NSE indexes to Version 9.x 64-bit, migrate the required NSE databases to DB2 Version 9.x 64-bit. - Restore the NSE indexes and the newly generated 64-bit metafiles into the V9.x 64-bit set-up by following the below procedure: 1. Stop Net Search Extender, issue the following command: db2text stop 2. Restore the backup copies of the index directories to the SAME PATH as before. 3. Restart Net Search Extender, issue the command: db2text start - Migrate the NSE database to the current release db2extmdb - Perform alter index by mentioning new index and work directories(make sure the instance owner has the sufficient permission to access and alter the index files) Example: db2text alter index for text index directory work directory - Perform searches as before and verify whether the new migrated index is searchable 3. Steps to run the Index Migration tool in NSE V9 32-bit: ======================================================= * logon as the DB2 instance owner * extract the NSE_32_64_Idx_Migr_Tool_Linux archive * cd to the NSE_32_64_Idx_Migr_Tool_Linux directory * make sure that: - DB2 is up and running - NSE is stopped - no other processes try to get an exclusive lock on the index files located in the index directory (where the index directories are located, was decided when the index was created) * run the file ctemigridx: the script can be run in two different modes. The first mode takes a database name as argument, and automatically determines all existing indexes in that database and offers to migrate them all at once, or selectively. - Mode 1: ctemigridx -dbname Mode 1 will establish a database connection and queries all data that is needed from the NSE database tables. After that it shows a list of indexes that are ready to get migrated. You can choose one index or all listed indexes. Adding the "-check" parameter to the command, will perform all the necessary steps without the migration. Example: ctemigridx -dbname sample Mode 2 can be used to migrate a particular index, if you know the indexname already, and want to target the migration of this index. This mode is useful if you have a large number of indexes, and want to avoid going through a long menu of indexes. It also comes handy if you are running repeated tests with an individual index. - Mode 2: ctemigridx -i -p [-showmap] for example: ctemigridx -i IX123456 -p \sqllib\db2ext\indexes The index directory has to be specified in the same way as it is used at index creation time. The index directory always has a NODE0000 subdirectory which then contains the index itself. Currently the script only supports single-node-systems. If you add the "-showmap" flag, the logfile will show a dump of the migrated index attribute (sections and attributes) for additional verification purposes. ctemigridx -i IX123456 -p < home dir>\sqllib\db2ext\indexes -showmap * When the Net Search Extender index migration is done, some *.32 files can be found in the index directory. According to the indexes that has/have been migrated these new files can be found: - IX123456.as.32 (Backup of the old 32 bit IX123456.as file) - IX123456.an.32 (Backup of the old 32 bit IX123456.an file) - IX123456.tf.32 (Backup of the old 32 bit IX123456.tf file) The migration uses a temporary work directory that is created during migration, if it is not already present. In case it is not there, a TMP_IX123456 directory can be found inside the Net Search Extender index directory. After verification of the 64-bit Net Search Extender index(es), the *.32 files can be removed or transferred to another location in terms a backup. * After this, index migration is complete, and the user can proceed to perform the instance migration to 64-bit as described in the DB2 documentation. NOTE: V9.x could be replaced with either V9.1 or V9.5.