Repairing a Corrupt Database

From InterBase

Go Up to Validation and Repair


If a database contains errors, they are displayed in the following dialog:

Validation Report Dialog

The errors encountered are summarized in the text display area. The repair options you selected in the Database Validation dialog are selected in this dialog also.

To repair the database, choose Repair. This fixes problems that cause records to be corrupt and marks corrupt structures. In subsequent operations (such as backing up), InterBase ignores the marked records.

Some corruptions are too serious for IBConsole to correct. These include corruptions to certain strategic structures, such as space allocation pages. In addition, IBConsole cannot fix certain checksum errors that are random by nature and not specifically associated with InterBase.

Note:
Free pages are no longer reported, and broken records are marked as damaged. Any records marked during repair are ignored when the database is backed up.

If you suspect you have a corrupt database, perform the following steps:

  1. Make a copy of the database using an operating-system command. Do not use the IBConsole Backup utility or the gbak command, because they cannot back up a database containing corrupt data. If IBConsole reports any checksum errors, validate and repair the database again, setting the Ignore Checksum Error option to True. Note: InterBase supports true checksums only for ODS 8 and earlier.
  2. It may be necessary to validate a database multiple times to correct all the errors. Validate the database again, with the Read Only Validation option set to True.
  3. Back up the mended database with IBConsole or gbak. At this point, any damaged records are lost, since they were not included during the back up. For more information about database backup, see About InterBase backup and restore options.
  4. Restore the database to rebuild indexes and other database structures. The restored database should now be free of corruption.
  5. To verify that restoring the database fixed the problem, validate the restored database with the Read Only Validation option set to True.

Advance To: