data files corruption after server crash

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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...


---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
      subscribe-nomail command to majordomo@xxxxxxxxxxxxxx so that your
      message can get through to the mailing list cleanly

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux