Subject | Corrupt GDB - Re Restore Crisis |
---|---|
Author | rodbracher |
Post date | 2002-09-30T11:38:09Z |
All is fixed - thanks to everybody's responses. I am just going to
post a summary of what happened - as if I had read this before my
crisis it would have been useful.
I had a corrupt GDB. A validate would give messages like :
PROG1 (Server) Sat Sep 28 13:48:14 2002
Database: C:\DELPHDAT\SQF900~1\PPERFECT.GDB
Index 11 is corrupt (missing entries) in table WAYBILL (197)
PROG1 (Server) Sat Sep 28 13:48:15 2002
Database: C:\DELPHDAT\SQF900~1\PPERFECT.GDB
Relation has 1 orphan backversions (0 in use) in table
WAYBILL (197)
I did a backup and restore - all the records were reported there -
but all tables were empty ! The crux was when I discoverd the all
useful -y restorelog.txt switch for GBak. At the end of the restore I
got :
gbak: creating indexes
gbak: ERROR: attempt to store duplicate value (visible to active
transactions) in unique index "RDB$PRIMARY67"
gbak: Index "RDB$PRIMARY67" failed to activate because:
gbak: The unique index has duplicate values or NULLs.
gbak: Delete or Update duplicate values or NULLs, and activate
index with
gbak: ALTER INDEX "RDB$PRIMARY67" ACTIVE;
When I tried to activate the index in IBConsole I got the above same
error. There were no key duplicates in the orig GDB - so I did a
backup-restore but using the -inactive switch on the GBak restore.
Now I had data in my tables. And a query
Select key_field, count(key_field) from table
group by key_field
having count(*) > 1
retuned 4 records.
So back to the orig GDB - I deleted the records ( the ones I could
see ) - and another backup and restore with indexs active worked -
and my database had no validation errors.
Now in the new GDB the other records on the key were there - which I
could delete.
Strange but true.
The corruption was caused by a transfer of the GDB from 1 server to
another - not good.
Thanks
Rod
post a summary of what happened - as if I had read this before my
crisis it would have been useful.
I had a corrupt GDB. A validate would give messages like :
PROG1 (Server) Sat Sep 28 13:48:14 2002
Database: C:\DELPHDAT\SQF900~1\PPERFECT.GDB
Index 11 is corrupt (missing entries) in table WAYBILL (197)
PROG1 (Server) Sat Sep 28 13:48:15 2002
Database: C:\DELPHDAT\SQF900~1\PPERFECT.GDB
Relation has 1 orphan backversions (0 in use) in table
WAYBILL (197)
I did a backup and restore - all the records were reported there -
but all tables were empty ! The crux was when I discoverd the all
useful -y restorelog.txt switch for GBak. At the end of the restore I
got :
gbak: creating indexes
gbak: ERROR: attempt to store duplicate value (visible to active
transactions) in unique index "RDB$PRIMARY67"
gbak: Index "RDB$PRIMARY67" failed to activate because:
gbak: The unique index has duplicate values or NULLs.
gbak: Delete or Update duplicate values or NULLs, and activate
index with
gbak: ALTER INDEX "RDB$PRIMARY67" ACTIVE;
When I tried to activate the index in IBConsole I got the above same
error. There were no key duplicates in the orig GDB - so I did a
backup-restore but using the -inactive switch on the GBak restore.
Now I had data in my tables. And a query
Select key_field, count(key_field) from table
group by key_field
having count(*) > 1
retuned 4 records.
So back to the orig GDB - I deleted the records ( the ones I could
see ) - and another backup and restore with indexs active worked -
and my database had no validation errors.
Now in the new GDB the other records on the key were there - which I
could delete.
Strange but true.
The corruption was caused by a transfer of the GDB from 1 server to
another - not good.
Thanks
Rod