Re: DB corruption.

From: Lukasz Brodziak <lukasz(dot)brodziak(at)gmail(dot)com>
To: Jesper Krogh <jesper(at)krogh(dot)cc>
Cc: pgsql-admin(at)postgresql(dot)org, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: DB corruption.
Date: 2011-10-09 20:33:04
Message-ID: CAGWYGjWXb8jD_f-rbC6BJt4g+AGYrgbaX1bX3N=NF9yfDWahCw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

You may use this:
SET zero_damaged_pages = on;
VACUUM FULL corrupted_table;

Unfortunately zeroing pages will result in losing data written in them(will
be rewritten with zeros).
09-10-2011 19:49 użytkownik "Jesper Krogh" <jesper(at)krogh(dot)cc> napisał:

> On 2011-10-09 17:41, Tom Lane wrote:
>
>> Jesper Krogh<jesper(at)krogh(dot)cc> writes:
>>
>>> I have got a corrupt db.. most likely due to an xfs bug..
>>> pg_dump: SQL command failed
>>> pg_dump: Error message from server: ERROR: invalid page header in block
>>> 14174944 of relation base/16385/58318948
>>> Can I somehow get pg_dump to "ignore" that block and dump everything
>>> else?
>>>
>> The traditional solution is to zero out the bad block, eg using dd from
>> /dev/zero. It's easy to zero more than you intended, so practicing on a
>> scratch copy of the table is recommended.
>>
>> But first you should check what kind of relation that is. If it's an
>> index, you could just REINDEX it instead.
>>
>
> So it is "just" blocknumber * blocksize .. offset, blocksize of zeroes.. ?
> Or is the math harder?
>
> --
> Jesper
>
> --
> Sent via pgsql-admin mailing list (pgsql-admin(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/**mailpref/pgsql-admin<http://www.postgresql.org/mailpref/pgsql-admin>
>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Albe Laurenz 2011-10-10 07:27:56 Re: [GENERAL] how to save a bytea value into a file?
Previous Message Tom Lane 2011-10-09 20:21:56 Re: DB corruption.