Repairing Indexes

This option is only relevant for the Embedded database.

 

Special Note

Database Builder has the ability to rebuild a table’s indexes in the event that they may become corrupted. To rebuild a table’s indexes, select Reindex from the Maintenance menu or click the Sort Files button on the tool bar.

A table-selection panel pops up. Select the tables you wish to re-index, then click on the Sort button. This pops up the Rebuild Database Indexes panel. The panel is divided into the tab pages Rebuild selector and Options.

Rebuild Selector

This tab page shows a list of each selected table and its indexes. The indexes to be sorted can be selected by clicking their check boxes in the list. There are buttons for selecting indexes for the current selected table (row-selection buttons) and for all tables (table-selection buttons). There are separate buttons for selecting the on-line or batch indexes as groups.

The sort can be started by clicking the Rebuild button or F2.

Options

On this tab page, there is a checkbox for detecting bad rows. If this is checked, then you have the following choices for what to do when invalid data is detected.

Invalid Data


Option

Action

Write to .BAD file for cleanup

You can specify that when you re-index, a file will be created to contain the data from rows containing bad index data. It has the same rootname as the table being re-indexed, and the extension .BAD.

Abort rebuilding indexes

Select this if you want the re-index process to be aborted in the event rows are found containing bad data.

Overwrite data with space/zeroes

Select this if you want any row with bad data to be retained but columns with bad data to be emptied (filled with spaces or zeroed as appropriate to the type of the column).  

 

Duplicate Records

There is also a checkbox for what to do if duplicate rows are detected. If duplicate rows are found with the same data in the columns making up the index, obviously something is wrong. The index may have been set to batch before data entry, or it may have been corrupted by a power failure, or there may some other cause.

 

See Also

Database Maintenance