Re: hardware failure - data recovery - Mailing list pgsql-general

From Rick Gigger
Subject Re: hardware failure - data recovery
Date
Msg-id AE90A768-E700-459E-8FB9-258A6E592038@alpinenetworking.com
Whole thread Raw
In response to Re: hardware failure - data recovery  (Jerry Sievers <jerry@jerrysievers.com>)
List pgsql-general
> Rick Gigger <rick@alpinenetworking.com> writes:
>
>> To make a long story short lets just say that I had a bit of a
>> hardware failure recently.
>>
>> If I got an error like this when trying to dump a db from the mangled
>> data directory is it safe to say it's totally hosed or is there some
>> chance of recovery?
>
> Why don't you try dumping just the critical tables using pg_dump -t?

There was only one table in the db.

> Also perhaps use psql and try looking up in pg_class for the damaged
> tables by OID.  You may be able to drop just a few tables and then
> dump the DB normally.  This assumes the damaged table(s) are
> non-critical...

The table I needed was damaged.  I dropped the indexes from it that
were also damaged but then the table had to be repaired.

> I suggest you stop Pg first, take an FS backup of the entire cluster
> before this so you cahn try various approaches if needed.

That was the first thing I did.

Thanks everyone for the help.  Luckily one of my developers  was able
to patch up the table and get 99% of the data out.  All of the truly
critical data was in another database and was backed up, so the 99%
was enough to get through the crisis.

Thanks,

Rick

pgsql-general by date:

Previous
From: Rick Gigger
Date:
Subject: Re: hardware failure - data recovery
Next
From: "Shane Wright"
Date:
Subject: recovery from xid wraparound