Rebuild Options - /f

If the file is corrupt, Rebuild returns a non-zero value.

Parameters

c
Specifies the validation to be performed. The default is 10.
Value Description
2 Checks the structure of the free space list (FSL).
8 Checks the index file structure.
256 Checks the data file structure with file open for sharing in another process. You cannot specify this check in combination with any other check.
0 Nothing.
1 Error messages only.
2 Messages showing the options you have specified.
3 Information about the file. This includes key definition, records lengths, data compression, and the version of the file handler that created and updated the file.
4 The different types of record present in the file:
  1. IDXFORMAT"4" information record.
  2. Deleted record.
  3. System record.
  4. Data record that has been reduced in size by a rewrite.
  5. Data record that has been increased in size by a rewrite, and therefore cannot fit into the original record area. Instead, this record points to another record area that contains the record.
  6. The record pointed to by a type 6 record.
  7. The record pointed to by a type 6 record.
  8. The record pointed to by a type 6 record.
5 Statistics about each key structure. This includes information about how much space is being saved by key compression.
You can select a combination of checks 2 and 8 by adding the numbers together. The more checks you perform, the longer the validation takes.
d
Specifies the message level.
These values are cumulative, so if you specify level 4, you will also receive messages at levels 1, 2 and 3. The default is 5.
Value Description
0 Nothing.
1 Error messages only.
2 Messages showing the options you have specified.
3 Information about the file. This includes key definition, records lengths, data compression, and the version of the file handler that created and updated the file.
4 The different types of record present in the file:
  1. IDXFORMAT"4" information record.
  2. Deleted record.
  3. System record.
  4. Data record that has been reduced in size by a rewrite.
  5. Data record that has been increased in size by a rewrite, and therefore cannot fit into the original record area. Instead, this record points to another record area that contains the record.
  6. The record pointed to by a type 6 record.
  7. The record pointed to by a type 6 record.
  8. The record pointed to by a type 6 record.
5 Statistics about each key structure. This includes information about how much space is being saved by key compression.

Examples

rebuild test.dat -f:c8

checks the structure of the index file.

rebuild test.dat -f:d1

specifies error messages only.

rebuild test.dat -f:c2d1

checks the structure of the FSL and specifies error messages only.

rebuild test.dat -f

Performs a full integrity check on a file, displaying all possible information. This is the same as specifying -f:c10.

Note:

The display might end with one of the following messages:

File is corrupt

This means that the control information in the file is not consistent with the data. For example, a record may have been deleted but the list of deleted records does not include it. Such a file is reported as corrupt, even though the data itself is not corrupt.

File contains transaction data 

This means that the control information may not be consistent with the data because the file contains records which were part of a Fileshare transaction which was not subject to a successful COMMIT or ROLLBACK.

For example, a record may have been written as part of a transaction, but a system failure caused Fileshare to stop processing before the transaction was COMMITed. If you are not using Fileshare Roll-Forward recovery, you can use rebuild to remove this transaction data by using the /d option and rebuilding to a new file. Note to quickly recover the file to a usable state that you can rebuild to the same file, this will recreate the index correctly (treating transaction data as deleted records) but the transaction record data will remain in the file, the space will not be reused and rebuild /f will continue to report that the “File contains transaction data”.