Subject | Re: [firebird-support] Database corruption: index inconsistent (204) |
---|---|
Author | Vlad Khorsun |
Post date | 2008-10-07T22:38:34Z |
> one of our databases can no longer be backed up. We always get the following error:You may try to rebuild broken index. Below is not supported way how to do it !
>
> ERROR: internal gds software consistency check (index inconsistent (204), file: btr.cpp line: 4555)
>
> FBFirstAID, GFIX and GBAK do not seem to help in fixing this corruption. In this case, we are using Firebird 2.0.3.
>
> What can we defer from the following errors that GFIX produced in firebird.log:
>
> NIVANT2 (Server) Tue Oct 07 22:10:44 2008
> Database: C:\METADATA.FDB
> Index 3 is corrupt on page 101 level 1. File: \fb2\dev\fb2R2_0_3\firebird2\src\jrd\validation.cpp, line: 1656
> in table RDB$RELATION_FIELDS (5)
>
> NIVANT2 (Server) Tue Oct 07 22:10:44 2008
> Database: C:\METADATA.FDB
> Index 3 is corrupt on page 101 level 1. File: \fb2\dev\fb2R2_0_3\firebird2\src\jrd\validation.cpp, line: 1532
> in table RDB$RELATION_FIELDS (5)
>
> NIVANT2 (Server) Tue Oct 07 22:10:44 2008
> Database: C:\METADATA.FDB
> Index 3 is corrupt on page 101 level 1. File: \fb2\dev\fb2R2_0_3\firebird2\src\jrd\validation.cpp, line: 1646
> in table RDB$RELATION_FIELDS (5)
>
> NIVANT2 (Server) Tue Oct 07 22:10:44 2008
> Database: C:\METADATA.FDB
> Index 3 is corrupt on page 101 level 1. File: \fb2\dev\fb2R2_0_3\firebird2\src\jrd\validation.cpp, line: 1671
> in table RDB$RELATION_FIELDS (5)
>
> These are the only errors. How could we fix this database? It seems that the corruption is minor (one database page only), but the
> tools we have don't seem to be able to fix it.
Use it only on copy of database !
Start isql and connect to the database. It must be the only connection !
Run following :
UPDATE RDB$INDICES SET RDB$INDEX_INACTIVE = -3
WHERE RDB$RELATION_NAME = 'RDB$RELATION_FIELDS'
AND RDB$INDEX_ID = 3;
COMMIT;
SELECT RDB$INDEX_ID FROM RDB$INDICES
WHERE RDB$RELATION_NAME = 'RDB$RELATION_FIELDS';
You must see result : 1, 2, <null>
EXIT; -- exit isql, it is necessary !
Run isql again and connect to the database. Run following :
UPDATE RDB$INDICES SET RDB$INDEX_INACTIVE = 0
WHERE RDB$RELATION_NAME = 'RDB$RELATION_FIELDS'
AND RDB$INDEX_ID = NULL;
COMMIT;
SELECT RDB$INDEX_ID FROM RDB$INDICES
WHERE RDB$RELATION_NAME = 'RDB$RELATION_FIELDS';
You must see result : 1, 2, 3
Now you can backup your database.
Regards,
Vlad