Page 1 of 1

Hard Disk Failure, best way to salvage database changes?

PostPosted: Fri Jun 27, 2008 4:24 pm
by mooch
The hard drive on my laptop looks like its failing. This seems to have affected some of PostgreSQL files so that I get this error when trying to backup the database

pg_dump: SQL command failed
pg_dump: Error message from server: ERROR: could not read block 206626 of relation 1663/16403/16440: Invalid argument
pg_dump: The command was: COPY public.game_players …

pg_dump: *** aborted because of error


Error 1 has occurred ==== BACKUP FAILED TO COMPLETE!!!

Is there any chance I can repair (even partially) the database and back it up?

My last successful backup was end of last month. I can see all my stats for this month, but if I try to bring up all dates, I get a SQL error, so I figure the corrupted files are pre-this month. Is there anyway to backup only this month’s changes then merge the databases?

If not, I have kept the processed hand histories since the last backup. If I restore from last month’s backup (to new HD) and then re-import this month’s hand histories, what will I be missing … Player notes, Favourites hands? (can I backup/export these separately?)

Re: Hard Disk Failure, best way to salvage database changes?

PostPosted: Fri Jun 27, 2008 4:49 pm
by ptrack pat
You can try reindexing as detailed here
http://www.pokertracker3.com/forums/arc ... ex+pgadmin

Re: Hard Disk Failure, best way to salvage database changes?

PostPosted: Sat Jun 28, 2008 4:04 am
by mooch
Reindexed all tables okay apart from game_players

ERROR: could not read block 206626 of relation 1663/16403/16440: Invalid argument

When I tried backing up again, it was at game_players that the backup failed

pg_dump: dumping contents of table game_players
pg_dump: SQL command failed
pg_dump: Error message from server: ERROR: could not read block 206626 of relation 1663/16403/16440: Invalid argument
pg_dump: The command was: COPY public.game_players …

Re: Hard Disk Failure, best way to salvage database changes?

PostPosted: Sat Jun 28, 2008 9:35 am
by ptrack pat
The only thing you can try to do is to use the Utilities > Export Hand Histories To File option to export the hands since the last backup you have to text files. Then restore the previous backup and reimport those files into the database.

Re: Hard Disk Failure, best way to salvage database changes?

PostPosted: Sun Jun 29, 2008 10:30 am
by mooch
Thanks, I've done as you suggested and exported the hands then restored and reimported to another PC. This new db backs up fine.

Just like to know what else I might be missing. I can only think of player notes and favourites hands. Is there any way for me to export/import these? Is there anything else obvious I might be missing?

Re: Hard Disk Failure, best way to salvage database changes?

PostPosted: Sun Jun 29, 2008 4:42 pm
by ptrack pat
Anything else that was stored in the database like player notes, etc. are going to be gone (i.e. anything not in the old backup) there is no way to recover those.