PDA

View Full Version : Error while vacuuming the database



Azalin
09-29-2008, 06:06 AM
While I was performing a Vacuum/analyze through pgAdmin I received an error (shown on the messages tab on the maintain database window) :

"ERROR: could not read block 651123 of relation 1663/16403/16472: Invalid argument"

That appeared twice and then the vacuum stopped (I dont believe it has finished but I cannot be sure?). Any ideas?

I am using Windows XP pro + postgreSQL 8.3. My HEM version is currently 1.06.03h.

Rvg72
09-29-2008, 05:56 PM
Hi, unfortunately it looks like the database in postgres has become corrupt. The 2 most common causes of this problems are 1) powering off your computer or having your computer lose power while the database is doing something and 2) an old drive with bad sectors on it. Basically what happens is a small portion of a file gets slightly corrupt and then when you reboot and windows goes into that checkdsk procedure it finds the bad section and, thinking it is doing a good thing, removes it. Postgres then loads the table and a portion of it is gone so it doesn’t like that and blocks access to the entire table. Normally when this happens it is on a completely useless file that you'll never even notice is now gone and quite often it will happen to an index in the DB which can easily be rebuilt but in your case it happened to one or more of the tables.

So, to protect against this

1) keep you hands histories in case you do need to reimport
2) use a power bar and avoid hard shutdowns (when you flick the power switch on the pc)
3) if your drive is old consider replacing it with a new one. They are cheap and much faster now than even a few years ago.

You most likely have other issues with the database as well – I’d recommend starting a new database and reimporting your hands.

Roy

Azalin
09-29-2008, 07:34 PM
I have not noticed anything wrong with my database (apart from this problem when I tried to vacuum it). Is there any possible way to avoid reimporting all the hand histories?

My database has more than 13 million hands and it will take a while :/
If there is no other way is it possible to export the hand histories from my database and reimporting them afterwards?

Also, should I uninstall/reinstall postgreSQL or only delete my database and create a new one?

FWIW my computer and hard drive are new and there was no power loss as far as I can remember (but I maybe be wrong).


Thanks for the fast reply

morny
10-01-2008, 05:23 PM
If you just want to play right away just create a new database http://208.109.95.123/faq/afmviewfaq.aspx?faqid=146 and youll be fine.

Then whenever your ready export the HH by following Only the 1st step in this FAQ http://208.109.95.123/faq/afmviewfaq.aspx?faqid=12 (make sure to export from the old database.

then open the new database and reimport the files overnight or whenever you have some free time.