Subject RE: [firebird-support] Database corruption
Author Bob Murdoch
> -----Original Message-----
> From: Helen Borrie [mailto:helebor@...]
> Sent: Monday, September 06, 2004 2:44 AM
> >
> >We did a backup/restore on the db when moving to the latest
> version of FB.
> >It has remained a dialect 1 db.
>
> Was this recent? Could you run a gstat -h just to make sure
> about the ODS version?


Database "fds_corrupt.gdb"

Database header page information:
Flags 0
Checksum 12345
Generation 1102173
Page size 8192
ODS version 10.1
Oldest transaction 20517
Oldest active 1102144
Oldest snapshot 1102131
Next transaction 1102163
Bumped transaction 1
Sequence number 0
Next attachment ID 0
Implementation ID 16
Shadow count 0
Page buffers 2048
Next header page 0
Database dialect 1
Creation date Feb 6, 2004 23:38:29
Attributes force write, no reserve

Variable header data:
Sweep interval: 0
*END*

>
> The error reported by gbak:
> "database file appears corrupt ()
> -wrong page type
> -page 1653541 is of wrong type (expected 7, found 5)"
>
> indicates a corrupt (possibly empty) index page. If you can
> find out which index it was for, and it is a user index,
> probably dropping the index will fix the problem.

Yes, I noticed in the Firebird.log that a number of indices are mentioned as
corrupt after running gfix (I keep forgetting that gfix output goes to the
log, not to stdout). Things like:

Index 7 is corrupt on page 1781253 in table RETURN_SALE (142)
Index 7 has orphan child page at page 1781253 in table RETURN_SALE
(142)

All in all, looks to be about a dozen indices mentioned. Also found some
entries like this:

Relation has 4 orphan backversions (1071745 in use) in table
SALESCHECK (149)
Page 1121295 is an orphan


Bob M..