X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 9F4C7D6E56 for ; Fri, 30 Sep 2005 12:14:11 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 03445-10 for ; Fri, 30 Sep 2005 15:14:10 +0000 (GMT) Received: from kbi.lt (main.kbi.lt [193.219.74.132]) by svr1.postgresql.org (Postfix) with ESMTP id CA4BCD6DA1 for ; Fri, 30 Sep 2005 12:14:08 -0300 (ADT) Received: from localhost (localhost [127.0.0.1]) by kbi.lt (Postfix) with ESMTP id B6ACB844E5 for ; Fri, 30 Sep 2005 18:07:32 +0000 (UTC) Received: from kbi.lt ([127.0.0.1]) by localhost (kbi [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 11426-03 for ; Fri, 30 Sep 2005 18:07:29 +0000 (UTC) Received: from [127.0.0.1] (unknown [192.168.2.67]) by kbi.lt (Postfix) with ESMTP id 6BBBA844E4 for ; Fri, 30 Sep 2005 18:07:28 +0000 (UTC) Message-ID: <433D6474.5040004@fotofabrikas.lt> Date: Fri, 30 Sep 2005 18:14:44 +0200 From: Rytis User-Agent: Mozilla Thunderbird 1.0.6 (Windows/20050716) X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: data files corruption after server crash Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 0539-0, 2005.09.26), Outbound message X-Antivirus-Status: Clean X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at kbi.lt X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 required=5 tests=[FORGED_RCVD_HELO=0.05] X-Spam-Level: X-Archive-Number: 200510/14 X-Sequence-Number: 19086 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...