Subject Re: gfix/ment and database page errors
Author Adam
--- In firebird-support@yahoogroups.com, emel <emel@e...> wrote:
>
> When gfix/mend set not available status of demaged record (like above)
> can I know what records marked? (for example tablename or prev+next
> records (in natural order) of demageds)
>
> eMeL
>
> ------------------------------------------------
>
> gfix -mend -user xxx -pass yyyy AAAA.FDB
> Summary of validation errors
>
> Number of index page errors : 24
> Number of database page errors : 69
>
> ------------------------------------------------
>
> sorry my terrible english ;)

That database looks pretty damaged. Before doing anything, take a file
system copy of the database and work with that.

If it is only a few record level errors, you can just use something like

select id
from corrupttable
order by id

and then find out what id is the last successful,

assuming 999 is the last successful, you suspect 1000 is a culprit and
change the query to

select id
from corrupttable
where id <= 999
or id >= 1001
order by id

and follow this process until you can make it the whole way through
the corrupt table. Create a new table with the same structure as your
corrupt table, and run

insert into mendedtable
select id
from corrupttable
where id <= 999
or id >= 1001
... etc

Then use a data pumping tool to pump the information from the
mendedtable into a new structure.

However in this case, there seems to be a lot of damage and it may not
be possible or practical to take this approach.

Adam