Before attempting any repair routine
backup the database. If an index rebuild does not complete, the database will be inaccessible by any means until the flag in the master block is cleared by a successful index build. Otherwise, the backup will need to be restored.
The IDXBUILD qualifier of the PROUTIL command, accomplishes most of its work without displaying messages, unless it encounters a fatal error condition.
If an IDXBUILD is interrupted while rebuilding a selected subset of indexes, the list of selected indexes is usually retained in a file named
<dbname>.xb. The <dbname>.xb file is used when the IDXBUILD utility is restarted, so that only the original subset listing of indexes are rebuilt in subsequent runs.
If the IDXBUILD utility is unable to locate the <dbname>.xb file, then it will assume ALL on the subsequent run and will deactivate all indexes for the database. Depending on the size of the database and the number of indices, the subsequent rebuild all indexes for a database instead of the original selected subset will take a lot longer than initially planned.
It is encouraged that if a subset IDXBUILD terminates for any reason,
before re-running the index build operation, ensure that the <dbname>.xb file exists in the current working directory where the IDXBUILD command is being issued. If the
.xb file does not exist, then a
<dbname>.xb text file can be manually created. This file must contain an exact subset listing of all tables/indexes that were being rebuilt in the prior failure. Failure to adhere to this recommendation will result in index corruption. In most cases, IDXBUILD will finish without reporting errors, however, when the application makes use of these damaged indexes (that were missing in the .xb file), the consequences will be realized.
Manually creating the dbname.xb file:
- The file needs to have <dbname>.xb for the file name. Example: sports2000.xb
- This <dbname>.xb file must exist in the working directory where the IDXBUILD command is going to be issued. When the IDXBUILD utility is run, it looks in the current directory for the <dbname.xb> file.
- The contents of the <dbname>.xb file has the following format which needs to be repeated for all tables and indexes associated with the failed IDXBUILD.
tableowner
tablename
indexname
- The file also needs to have an "!" exclamation mark for the final entry.
Example sports2000.xb file:
PUB
customer
name
PUB
customer
custnum
PUB
order
custorder
PUB
order
orderdate
!
When the IDXBUILD utility is rerun, it will locate the <dbname>.xb file and display to the screen all tables and indexes which need to be rebuilt then prompt for approval prior to starting the IDXBUILD. It will then ask for information regarding sort space and then proceed with the rebuild.
On successful completion of a subset index rebuild the <dbname>.xb file is deleted.