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

    Join Date
    Aug 2007
    Posts
    24
    Rep Power
    0

    How to recover Currupted FB database


    hai everybody
    i have a corrupted small fb database.
    I have tried almost everything to recover the db.but coun't able to recover it.
    i habe also refred this Thread

    but its not helped me.
    i even tried some 3rd part tools like IBFirstAID.unfortunatly , all failed to recover the db.

    any body have any other idea about recover the DB.

    thanks in advance... Sorry for my bad english
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2006
    Location
    Carlsbad, CA
    Posts
    2,057
    Rep Power
    383
    I have tried almost everything
    I don't mean to be awkward; but that does not tell us anything.

    How does the problem show itself?
    What version of FB are you using?
    What have you tried?

    Clive
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2007
    Posts
    24
    Rep Power
    0
    Originally Posted by clivew
    I don't mean to be awkward; but that does not tell us anything.

    Clive
    Sorry for the incomplete post
    I am using FB2.0
    While connecting to the DB I am getting "Not a valid Database" Error

    So i tried to Fix the database using
    gfix.exe -v -full Option

    i got the same error

    Again i give
    Gfix with -mend -full -ignore parameters

    again i got the same result

    So i tried to back up the database with GBAK using the following parameters
    GBAK -b -v -ignore

    It also failed
    I have downloaded Fbcopy from net and tried to pump the data to another DB. it also not helped me. So I downloaded IBFirstAID and try it, but unfortunately it also give same result .

    Please find the attached currupted file (1.9 MB)

    Cr.Zip
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2006
    Location
    Carlsbad, CA
    Posts
    2,057
    Rep Power
    383
    A few more questions before I try and look at the file.
    Sorry if they seem impertinent; but, you know.....

    1. Are you sure the file was a genuine firebird database or are you just taking someone's word?

    2. Is the uploaded file the Original one or one that has already had gfix etc. run on it?

    3. Is there really enough of importance in the database since the previous backup to make all this effort worthwhile?

    Clive
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2007
    Posts
    24
    Rep Power
    0
    Originally Posted by clivew
    1. Are you sure the file was a genuine firebird database or are you just taking someone's word?
    Clive
    No, its a orginal DB. with current data. Its a new database used for small inventory System the db size is almost 14 MB

    Originally Posted by clivew

    2. Is the uploaded file the Original one or one that has already had gfix etc. run on it?
    Clive
    Sorry .. I already run gfix on it. if required i will upload the orginal one

    Originally Posted by clivew
    3. Is there really enough of importance in the database since the previous backup to make all this effort worthwhile?
    Clive
    Not so much important.. I have already restored the backup.
    But the thing is .. I will lose the customer confidence ...

    I am using firebird as backend for some of my products.. So i want know how to recover the data (if the problem happend again)

    I am planning to FB for all my future projects too. Thats why i am so.. curious.

    Thanks
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jan 2006
    Location
    Carlsbad, CA
    Posts
    2,057
    Rep Power
    383
    OK.

    I am not sure what I might do differently or additionally.

    However, given the fact that you have the original corrupted version I am assuming that each of the fixes you tried was on the Original version as well as one that already had other fixes run against it.

    I would try gbak with a number of alternate option settings to see which, if any, could recover anything at all. Always starting with a fresh copy of the original file.

    If you have not got a tool to help, IBExpert has a personal version that includes a GUI for running gbac with various options selectable.

    Clive
  12. #7
  13. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2007
    Posts
    24
    Rep Power
    0
    Thanks Clivew,

    I too using IBexpert.

    Any way, i have restored the Backup. After a discussion with my client, i found that the DB got corrupted just becouse of tha power failure. As you know it is a small DB with 2 concurrent users.

    Why Firebird got corrupted so easly. What can i do to prevent DB from getting Corrupted ? . Please advice me.


    Thanks a lot
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2004
    Location
    Sarajevo, Bosnia
    Posts
    120
    Rep Power
    14
    Firebird DB never gets corrupted easily...
    You probably have ForcedWrites option off. To prevent corruption, set ForcedWrites ON.
    I have tried to examine file you attached, and found that header page of this DB is corrupted...
  16. #9
  17. Modding: Oracle MsSQL Firebird
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jun 2001
    Location
    Outside US
    Posts
    8,527
    Rep Power
    539
  18. #10
  19. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2008
    Posts
    75
    Rep Power
    10
    Originally Posted by fikret
    Firebird DB never gets corrupted easily...
    You probably have ForcedWrites option off. To prevent corruption, set ForcedWrites ON.
    I have tried to examine file you attached, and found that header page of this DB is corrupted...
    My FB installation is with default value.
    I think ForcedWrites is by defult ON.

    Regarding the database, is there any possiblity to recover data from it.
  20. #11
  21. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2008
    Posts
    75
    Rep Power
    10
    Originally Posted by pabloj
    On which filesystem?
    WIN32..NTFS
  22. #12
  23. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2008
    Posts
    1
    Rep Power
    0
    Originally Posted by New_2_DB
    Thanks Clivew,
    Why Firebird got corrupted so easly. What can i do to prevent DB from getting Corrupted ? . Please advice me.
    Any database will get corrupted by power failures, giving the correct circumstances. Any data worth protecting should reside on a UPS-protected server at the very least. With disk-prices as low as they are, RAID has become cheap insurance.

    If I had hired you and you didn't recommend any failure protection for my inventory system, I would lose confidence as well. If I had lost data because of your ignorance, I would have my lawyer examine your liability.

    * Common sense prevails here. At the very least, schedule frequent and regular backups. With nbackup, there's no good excuse not do backups several times a day. BACKUPS NEED TO GO ON A DIFFERENT DRIVE OR PC THAN YOUR DB. Preferably off-site.

    * UPS units cost as little as $30 and provide the critical two minutes to shut down an active database without corruption. Again, if this database is business-critical, there's no excuse not to spend this money.

    * Harddrives are CHEAP. I can get a pair of 320GB SATA drives for less than $100 total, use the RAID-controller found on virtually any motherboard these days, and have a failure tolerant set-up.
  24. #13
  25. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2013
    Posts
    2
    Rep Power
    0
    * disconnect users and disable incoming connections to the database (FAQ #64)
    * make a copy of database file (or two copies) and work on that
    * use GFIX with -v option to validate the database file
    * use GFIX with -v and -f to do full validation
  26. #14
  27. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Dec 2013
    Posts
    1
    Rep Power
    0
    One of the reasons why backup or restore can fail is if some broken database triggers exist, and prevent connection to the database. For example, a database trigger might use some table which has a broken index, etc. To work around this, connect to database with isql tool using -nodbtriggers option and then disable those triggers. You can enable them later when you fix other problems and get a working database again.

IMN logo majestic logo threadwatch logo seochat tools logo