Hard Disk Failure, best way to salvage database changes?

Forum with tips, support, etc, on using the PostgreSQL database with Poker Tracker. Please post any PostgreSQL questions here.

Hard Disk Failure, best way to salvage database changes?

Postby mooch » Fri Jun 27, 2008 4:24 pm

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?)
mooch
 
Posts: 4
Joined: Fri Jun 27, 2008 4:17 pm

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

Postby ptrack pat » Fri Jun 27, 2008 4:49 pm

You can try reindexing as detailed here
http://www.pokertracker3.com/forums/arc ... ex+pgadmin
ptrack pat
 
Posts: 4841
Joined: Sun Dec 09, 2007 12:38 pm

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

Postby mooch » Sat Jun 28, 2008 4:04 am

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 …
mooch
 
Posts: 4
Joined: Fri Jun 27, 2008 4:17 pm

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

Postby ptrack pat » Sat Jun 28, 2008 9:35 am

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.
ptrack pat
 
Posts: 4841
Joined: Sun Dec 09, 2007 12:38 pm

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

Postby mooch » Sun Jun 29, 2008 10:30 am

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?
mooch
 
Posts: 4
Joined: Fri Jun 27, 2008 4:17 pm

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

Postby ptrack pat » Sun Jun 29, 2008 4:42 pm

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.
ptrack pat
 
Posts: 4841
Joined: Sun Dec 09, 2007 12:38 pm


Return to PostgreSQL Forum

Who is online

Users browsing this forum: No registered users and 0 guests