Author Topic: database file appears corrupt  (Read 18686 times)

0 Members and 1 Guest are viewing this topic.

Offline Username09

  • Member
  • *
  • Posts: 3
    • View Profile
database file appears corrupt
« on: October 05, 2010, 08:17:28 pm »
Hi, I've been using PVD for some time now and just recently I've been getting

database file appears corrupt ()
bad checksum
checksum error on database page 151257
unsuccessful execution caused by a system error that preludes
successful execution of subsequent statements
Error Code: 15.

Does anyone know how to fix this?

I get it if I try to search by actors, and on clicking certain movie's that I have in my list(only 2 that I've found)

I'm using PVD portable v0.9.21, I have about 2621 movies in my database all with screenshots and info like anyone else and I really don't want to lose any of this but I do need to search by actors when searching for movies to download. I also get this error if I try to export to csv(appears to crash on 213/2621).

Could anyone help me with this problem?

Thanks

Edit: Just wanted to add for the movies that i click on that cause that I can't actually view anything the error will pop up and it will remain on the last movie I was clicked on, If I click ok for the error and edit while still on the effected title then cancel it shows the details again.
« Last Edit: October 05, 2010, 09:31:25 pm by Username09 »

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: database file appears corrupt
« Reply #1 on: October 05, 2010, 09:31:04 pm »
Welcome, 9.

Such errors likely mean the database is physically corrupt—as can happen, for example, when a write operation is interrupted by a power failure. If that is the case, your options are to restore from backup, or attempt to repair the database. Firebird utilities for doing so are available here. There are instructions for using gfix in readme.txt. Run it on a copy of your database.

Offline Username09

  • Member
  • *
  • Posts: 3
    • View Profile
Re: database file appears corrupt
« Reply #2 on: October 05, 2010, 09:36:11 pm »
Welcome, 9.

Such errors likely mean the database is physically corrupt—as can happen, for example, when a write operation is interrupted by a power failure. If that is the case, your options are to restore from backup, or attempt to repair the database. Firebird utilities for doing so are available here. There are instructions for using gfix in readme.txt. Run it on a copy of your database.

Thanks I'll give those tools a run. As for the backup I create a new copy of my database everytime I add more titles(labeled as current # of movies). So I can't really do this as I've also deleted previous copys, except for the last 1 which had the database error's as well. So hopefully the tooks you linked to will fix my issue. Thanks

Edit: hmm the readme file doesn't seem to be very helpful

1. Check if the datbase is corrupt
   gfix -v -f movies.pvd

2. Fix
   gfix -m -i movies.pvd

OR ------------------------------------------------------------------------------


1. Check if the datbase is corrupt
   gfix -v -f movies.pvd

2. Backup
   gbak -b -i -g -ig -user sysdba -pas masterkey movies.pvd movies.pvd.b

3. Restore
   gbak -c -i -g -ig -user sysdba -pas masterkey movies.pvd.bak movies_r.pvd


I tried using run command. I moved my database file to the fb folder and ran
E:\Downloads\fbtools\fbtools/gfix -m -i E:\Downloads\fbtools\fbtools/movies.pvd

I did 1 and 2 for the first 1 but it doesn't seem to do anything other then briefly open a command prompt. Should i be getting a notification or anything if it was successful or not?
« Last Edit: October 05, 2010, 09:55:43 pm by Username09 »

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: database file appears corrupt
« Reply #3 on: October 05, 2010, 11:09:51 pm »
Quote
Should i be getting a notification or anything if it was successful or not?

I don't know. I've never had a corrupt database to try it on. But according to this source...

-v[alidate] – Check database for validity. At the same time, errors are reported and repaired.
-f[ull] – Use with the -v option. Checks all records and pages and releases unassigned record fragments.

...so you should see something reported—if it finds anything.

Quote
it doesn't seem to do anything other then briefly open a command prompt.

If, when running  gfix -v -f movies.pvd, all you get is a flash of a command window, something is wrong. When I try it on my database, it takes 2 - 3 seconds. This would be easier for you to judge if you run it from a command window (run cmd.exe).

Quote
As for the backup I create a new copy of my database every time I add more titles (labeled as current # of movies).

As you now know, that's not an effective form of backup. It's fine for providing a means of recovery from an inherently risky operation or anything you might want to change your mind about. But the chance of a database error happening and you realizing it has occurred (before discarding good backup) are pretty slim. Effective backup should be automatic, regular and retain as many versions as possible. That can be done with a system wide backup routine, or a simple utility that can be scheduled to make regular copies of critical data.

Offline Username09

  • Member
  • *
  • Posts: 3
    • View Profile
Re: database file appears corrupt
« Reply #4 on: October 06, 2010, 07:14:30 am »
Quote
Should i be getting a notification or anything if it was successful or not?

I don't know. I've never had a corrupt database to try it on. But according to this source...

-v[alidate] – Check database for validity. At the same time, errors are reported and repaired.
-f[ull] – Use with the -v option. Checks all records and pages and releases unassigned record fragments.

...so you should see something reported—if it finds anything.

Quote
it doesn't seem to do anything other then briefly open a command prompt.

If, when running  gfix -v -f movies.pvd, all you get is a flash of a command window, something is wrong. When I try it on my database, it takes 2 - 3 seconds. This would be easier for you to judge if you run it from a command window (run cmd.exe).

Quote
As for the backup I create a new copy of my database every time I add more titles (labeled as current # of movies).

As you now know, that's not an effective form of backup. It's fine for providing a means of recovery from an inherently risky operation or anything you might want to change your mind about. But the chance of a database error happening and you realizing it has occurred (before discarding good backup) are pretty slim. Effective backup should be automatic, regular and retain as many versions as possible. That can be done with a system wide backup routine, or a simple utility that can be scheduled to make regular copies of critical data.

I got it working from file directory using cmd and this is what I get when running both commands



I'm not sure what to do now tho. It doesn't seem to have fixed anything, even though I ran the fix command :(

Thanks for taking the time to help. If I ever get this fixed I'll have to come up with a better backup system.

Offline rick.ca

  • Global Moderator
  • *****
  • Posts: 3241
  • "I'm willing to shoot you!"
    • View Profile
Re: database file appears corrupt
« Reply #5 on: October 06, 2010, 08:58:58 am »
Quote
I'm not sure what to do now tho.

Try How to repair a corrupt Firebird database.

 

anything