Subject Re: [firebird-support] db became corrupt - why?
Author Ann W. Harrison
Nick Upson wrote:

>> Did you do a gfix -mend?
>
> yes, that allowed me to do a backup, attempt to restore, and use the
> errors from the restore to restore RI by deleting invalid data
>
>> Could the foreign key errors indicate that you lost records in the master (referenced) table?
>
> yes, that is what happened. The question is how given that
> a) there is no code that deletes from that table
> b) several tables refer to it in their FK definition which should have
> stopped it being deleted

Gfix -mend isn't stopped by little things like foreign key constraints;
it just whacks out whatever it doesn't like. Better than losing the
whole database, but far from perfect. If you have a copy of the old
database, you might try the free version of IBSurgeon to see if it finds
anything it can fix.

Anyway, that argues that the bad data was on disk. There are a number
of problems that show up as "decompression overran buffer". One is a
bad line index entry - so the database starts reading at the wrong
place on a page.

Do you have a copy of the bad database?


Good luck,

Ann