Subject Re: [firebird-support] Database corruption
Author Jonathan Neve
Alexey Kovjazin wrote:

>Hello, Jonathan!
>
>==============================
>Summary of validation errors
>
>Number of record level errors : 6
>Number of index page errors : 2
>Number of database page errors : 12946
>
>Check the InterBase.Log file for additional information
>
>So I gather that it's not repairable...
>=====================================
>
>Wrong :)
>It is a light corruption with very little loss of data.
>The core of problem - several records were missed because of connection
>abnormal interruption.
>
>
It's due to an abnormal connection interruption? That's strange... I
thought it didn't matter if the client disconnected abuptly, provided
the server didn't get cut abruptly... Also, when forced writes are on,
isn't the database supposed to be able to withstand even the server
dying abuptly? Is there anything I can do that will make this type of
problem impossible for the future? (For this particular case, I don't
care so much about repairing the database, because I have 2 replicated
copies on other sites, so I can simply restore one of those. However, I
want to make this impossible for the future, because of couse, even
though no data was lost, much time has been wasted (for my customer!).)

>When, missed records caused missing some entries in indices related with
>this table.
>Index is a B-tree structure and if one of entries in higher level is
>incorrect, all (or just subordinate) index entries should be rebuilded (I
>think Ann may explain it much more perfectly in right words).
>
>
Ok, I see.

>Huge number of orphan pages means that index is marked unavailable and all
>its pages are marked as free after.
>gfix -mend - i.e., while walking through the index gfix did not reach these
>pages, so they are not used and marked as orphan.
>
>To fix such corruption, just backup and restore your database. Index will be
>recreated.
>Overall loss is only 6 records or even less.
>
>
Ok, thanks for the information. So the 12000 database page problems were
simply the orphan pages, and those are simply due to a problem on 5 or 6
records?

What I am mostly after is the cause of the corruption, and of course,
I'd like even more to know how I can prevent this type of thing in the
future...

Thanks a lot!
Jonathan Neve.