Subject Re: [firebird-support] Corruption problem
Author Gary Benade
> A client's 600 Mb database, running of FB 1.01, refuses to back up
> with the error "cannot find back record version (291)."
> Validation check produces no errors. Backing up with checksum,
> garbage collection and limbo transactions switched off makes no
> difference.
> The table on which the back up seems to fail gives errors if I try
> to empty it or drop it ("software consistency check").
> Is there anything I can do? The client's tape backup stops the FB
> service every night and backs up the database file, and I don't know
> how far back the corruption goes.

Steps to fix database:

1) always work with a copy of the database in case further damage occurs.
Working with a copy also gives you exclusive access which is required to
perform the following operations:
2) gfix -v -f database.gdb
3) if previous step reports corruption: gfix -m -i database.gdb
4) repeat step 2 to see if the corruption was fixed

Steps to salvage data:

1) create a new database with the same metadata structure:
A) gbak -m will backup only the metadata. It can then be restored to create
new database.
B) isql -x -a will extract the metadata to a script file.
isql -i scriptfile will then create the new database.
2) copy the data to the new database:
A) Delphi's datapump can be used to copy data from all tables to a new
B) use isql to perform a table by table copy of the data.

Hope this helps