#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    4
    Rep Power
    0

    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
  2. #2
  3. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Posts
    11
    Rep Power
    0
    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 support@ibexpert.com so we can test the database here
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2006
    Location
    Plovdiv. Bulgaria
    Posts
    224
    Rep Power
    12
    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.
  6. #4
  7. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2013
    Posts
    4
    Rep Power
    0
    Wonderfull.... problem solved!

    Thanks mIRCata!

    Originally Posted by mIRCata
    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.

IMN logo majestic logo threadwatch logo seochat tools logo