From: Rytis <rytis@fotofabrikas.lt>
To: pgsql-admin@postgresql.org
Subject: data files corruption after server crash
Date: Fri, 30 Sep 2005 18:14:44 +0200
Message-ID: <433D6474.5040004@fotofabrikas.lt> (raw)
Hello,
Our server crashed and some of the pgsql/base files got corrupted. 2 out
of 10 databases now reject all connections with error:
psql: FATAL: "/var/db/pgsql/base/17236" is not a valid data directory
DETAIL: File "/var/db/pgsql/base/17236/PG_VERSION" is missing.
We have dump that's a week old... (I know dumps should be made more
often, suppose now they will be made each night:)
Our try to recover lost information was to create a database from the
old dump and then try to rewrite the files over with the ones left from
corrupted DB, but OID's have changed and after overwritting files we got
nothing. Now the structure remains ok, but when trying to browse the
overwritten tables we get error:
ERROR: invalid page header in block 0 of relation "cart_items"
After that we tried to do that vise versa :) to change 'pg_class' table (relname field) to reflect the change of file that got copied into db dir without changing the name of table file.
Then database said something like (don't have it already so error text goes from memory): ERROR relation not found, file does not exit in /base/19345/23456. If I understand correctly, the DB now can't find primary/foreight keys and relations to that table.
That's the whole situation, the question would be:
Is it possible to restore our lost data?
Is it possible to move files over like I've described, if not... can anyone help, or our data (and time in try to restore it) is just wasted?
P.S. sorry for mistakes if any English is not my mother tongue
Waiting for replies...
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: rytis@fotofabrikas.lt
Subject: Re: data files corruption after server crash
In-Reply-To: <433D6474.5040004@fotofabrikas.lt>
References: <433D6474.5040004@fotofabrikas.lt>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox