July 17th, 2013, 08:17 AM
Corrupt Database - gifix doesn't fix
I have a small DB (1,6 Mb) that can't be opened due to corruption. I have no fresh backup copies, so I'd like to try to fix my GDB file.
I tried to backup it with gbak, but received an error "wrong page type".
I checked it with gfix (-v -f): it said "wrong page type".
So I tried to fix it with gfix (-mend -ignore -full)... again program exited with message "database file appears corrupt /n -wrong page type /n -page 390 is of wrong type (expected 3, found 0)"
Is there another way to fix my file? could someone give me a tip?
Thanks in advance
July 17th, 2013, 08:50 AM
if you have a full version of IBExpert, you can use tools-database inside to recreate a new database. If you do not have it, you can send the database to email@example.com so we can test the database here
July 18th, 2013, 01:37 AM
Multiply the wrong page's number by the page size of the database. Convert the number to hex value
Open the database with a hex editor, go to offset - the number you calculated. At that position you will see the wrong number - change it to the right one, save and you are ready to backup restore.
In your case if the page size is 4096(4K)
390 * 4096 = 1597440-> 0x186000 -change the byte from 00 to 03
But if the page type is 0, maybe this is empty page without any data. In that case the error is somewhere else in the database.
If you cant backup restore the database after this correction. Try to use IBExpert and its Extract metadata/data tool to extract all from the database and to import it in new, empty database file.
Last edited by mIRCata; July 18th, 2013 at 01:42 AM.
July 19th, 2013, 06:04 AM
Wonderfull.... problem solved!
Originally Posted by mIRCata