Re: DB fails to start: "Could not read from file "pg_clog/0003" at offset 212992: No error.

From: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>
To: raghu ram <raghuchennuru(at)gmail(dot)com>
Cc: Olga Vingurt <olgavi(at)checkpoint(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>, Ofer Israeli <oferi(at)checkpoint(dot)com>
Subject: Re: DB fails to start: "Could not read from file "pg_clog/0003" at offset 212992: No error.
Date: 2012-07-16 15:09:09
Message-ID: 50042E95.6050109@ringerc.id.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 07/16/2012 09:55 PM, raghu ram wrote:
>
>
> On Mon, Jul 16, 2012 at 5:44 PM, Olga Vingurt <olgavi(at)checkpoint(dot)com
> <mailto:olgavi(at)checkpoint(dot)com>> wrote:
>
> Hi,
>
> We are using PostgreSQL 8.3 on Windows Server.
>
> The db crashed and now it fails to start up.
>

Crashed how? Did the *server* crash, or the database?

When is your last backup from?

Have you made a complete file-system level copy of the database yet? See:

http://wiki.postgresql.org/wiki/Corruption

There's no sign of corruption and an issue with the clog doesn't imply
data coruption, but you should still take a complete copy before
proceeding unless your backups are current and trusted.

Raghu: It may be best to advise people with DB damage issues to make a
full file-system level copy before attempting repair. Once they start
trying to fix things it's much harder to go back to the start if
something breaks worse.

> Please perform below steps:
>
> 1. Backup the current pg_clog/0003 file in different directory
>
> 2. Create a file by assumption of make the uncommitted record as they
> haven't been committed. command as follows:
>
> *dd if=/dev/zero of=<data directory location>/pg_clog/0003 bs=256K
> count=1*

This is just a 256k zero-byte file. Here's one I made earlier:

http://www.postnewspapers.com.au/~craig/0003.zip

I don't know if the above advice is safe, but so long as you've made a
backup of your datadir it's worth a go.

--
Craig Ringer

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Nolan 2012-07-16 15:40:51 Re: Replication/cloning: rsync vs modification dates?
Previous Message Craig Ringer 2012-07-16 14:56:16 Re: Can't figure out how to use now() in default for tsrange column (PG 9.2)