Subject Re: [firebird-support] Database Corruption
Author Ann W. Harrison
Carsten Schäfer wrote:
> This weekend(sunday) we got a database corruption at one customer site
> (FB 2.0 on a Windows 200 Server).
> No one is directly working on the database file.
> DB is only accessed via our application, that uses the jaybird driver.
> Can someone please explain how this can happen ?

The corruption probably happened earlier and was just detected when
gbak attempted to read the bad page.
> This is the output from gbak:
> gbak: ERROR:database file appears corrupt ()
> gbak: ERROR: bad checksum
> gbak: ERROR: checksum error on database page 8099
> gbak: ERROR: gds_$receive failed
> gbak:Exiting before completion due to errors

Could you get a copy of IBSurgeon and use it to analyze the broken
database? Save a copy of it somewhere - it may be important.

To recover the contents of the database first try a gbak without
garbage collection. With luck, that will work.

But luck tends to be in short supply when a database has gone
corrupt, so use the verbose switch as well as the -g switch.
Then you'll know what table has the bad page, and be ready to
dump the metadata, create a new database, and reload the data.