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

Re: Corrupt DB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Simpson" <asimpson(at)i-55(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Corrupt DB
Date: 2005-04-18 16:18:17
Message-ID: 22439.1113841097@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-admin
"Simpson" <asimpson(at)i-55(dot)com> writes:
> mydb=# vacuum;
> ERROR:  could not open relation 1663/12649295/16396: No such file or
> directory

> What would be the best way to fix this?

[ checks catalogs... ]  In 8.0.*, 16396 is pg_am which is basically
constant, so you could replace that file by copying it out of another
database, eg
	cp $PGDATA/base/1663/1/16396 $PGDATA/base/1663/12649295/16396
After that I would try a REINDEX DATABASE in a standalone backend,
to repair any damage to the system catalog indexes.  Then start the
postmaster and see if you can pg_dump and reload the database.

VACUUM is *not* a good idea if you have any doubts about the consistency
of the database.

It's quite likely though that there is more damage and that this
procedure will not get you out of trouble :-(.  You apparently have got
either a flaky disk drive or severe kernel bugs, because files don't
just disappear without cause.  The kernel version you mentioned looks a
bit old, so updating to something more recent would be a good idea.

			regards, tom lane

In response to

Responses

  • pg_enconding at 2005-04-18 16:34:37 from Dextra - Gustavo Bartz Guedes

pgsql-admin by date

Next:From: Dextra - Gustavo Bartz GuedesDate: 2005-04-18 16:34:37
Subject: pg_enconding
Previous:From: Bruno Wolff IIIDate: 2005-04-18 15:29:51
Subject: Re: Pg7.1 to Pg7.2 Upgrade

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