Skip site navigation (1) Skip section navigation (2)

Re: Corrupted database - how to recover

From: Andreas Schmitz <mailinglist(at)longimanus(dot)net>
To: Johann Spies <jspies(at)sun(dot)ac(dot)za>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Corrupted database - how to recover
Date: 2010-05-27 07:54:00
Message-ID: 4BFE2518.3050601@longimanus.net (view raw or flat)
Thread:
Lists: pgsql-admin
hi johann,

maybe you should consider using point in time recovery (pitr) if the 
database is mission critical.

http://www.postgresql.org/docs/8.4/interactive/continuous-archiving.html

regards

andreas



Johann Spies wrote:
> After two disks on our raid-5 system failed causing a filesystem
> failure.
>
> We could get one online again and the filesystem is at present usable
> but  I cannot start postgresql at the moment:
>
> $ /usr/lib/postgresql/8.3/bin/postgres --single -D /etc/postgresql/8.3/main/
> 2010-05-27 09:22:48 SAST FATAL:  could not stat directory "base/16400": Structure needs cleaning
> 2010-05-27 09:22:48 SAST CONTEXT:  xlog redo insert: rel 1663/16400/16438; tid 10960/41
>
> in 'base' I see
>
> drwx------ 10 postgres postgres  102 2010-04-22 15:09 .
> drwx------ 10 postgres postgres 4096 2010-05-27 09:29 ..
> drwx------  2 postgres postgres 4096 2010-05-20 02:11 1
> drwx------  2 postgres postgres 4096 2010-04-22 15:07 11510
> ??????????  ? ?        ?           ?                ? 16388
> drwx------  2 postgres postgres 4096 2010-05-20 02:11 16389
> drwx------  2 postgres postgres 4096 2010-05-20 02:11 16390
> drwx------  2 postgres postgres 4096 2010-05-20 02:11 16391
> ??????????  ? ?        ?           ?                ? 16400
>
> I can just move the data-directory, do an initdb and use an older dump
> to repair the database as it was some time ago.  Fortunately the data is
> not mission critical.  But what if it was.  
>
> How do I recover from a situation like this?
>
> Regards
> Johann
>   


In response to

Responses

pgsql-admin by date

Next:From: Amit jainDate: 2010-05-27 12:25:56
Subject: How to add constraints without validating data.
Previous:From: Johann SpiesDate: 2010-05-27 07:34:04
Subject: Corrupted database - how to recover

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group