If the file is corrupt, Rebuild returns a non-zero value.
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:
|
5 | Statistics about each key structure. This includes information about how much space is being saved by key compression. |
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:
|
5 | Statistics about each key structure. This includes information about how much space is being saved by key compression. |
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.
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”.