pg recovery

From: Bernhard D Rohrer <graylion(at)sm-wg(dot)net>
To: pgsql-admin(at)postgresql(dot)org
Subject: pg recovery
Date: 2007-12-31 11:34:04
Message-ID: 4778D3AC.7080108@sm-wg.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Hi folks

I have a broken database and not much clue about postgres, sorry for the
n00b questions :(

I have my old raid drive which contains the databases but backup did not
work, so we don't have one ...

looking at the old database directory I get this:

root(at)collab:/var/lib/postgresql/8.1/main#
/usr/lib/postgresql/8.1/bin/pg_controldata .
WARNING: Calculated CRC checksum does not match value stored in file.
Either the file is corrupt, or it has a different layout than this program
is expecting. The results below are untrustworthy.

pg_control version number: 812
Catalog version number: 200510211
Database system identifier: 5005219046698704127
Database cluster state: shut down
pg_control last modified: Thu 26 Dec 13946 17:27:28 GMT
Current log file ID: 0
Next log file segment: 1474589828
Latest checkpoint location: 0/57E47440
Prior checkpoint location: 0/57E47484
Latest checkpoint's REDO location: 0/0
Latest checkpoint's UNDO location: 1/231175
Latest checkpoint's TimeLineID: 177739
Latest checkpoint's NextXID: 1
Latest checkpoint's NextOID: 0
Latest checkpoint's NextMultiXactId: 1197559863
Latest checkpoint's NextMultiOffset: 4
Time of latest checkpoint: Thu 11 Jan 1116953 02:46:31 GMT
Maximum data alignment: 131072
Database block size: 1
Blocks per segment of large relation: 128
Bytes per WAL segment: 1230990949
Maximum length of identifiers: 1414868549
Maximum columns in an index: 3681606
Date/time type storage: floating-point numbers
Maximum length of locale name: 0
LC_COLLATE:
LC_CTYPE:

if i run

postgres(at)collab:~/8.1/main$ /usr/lib/postgresql/8.1/bin/pg_resetxlog -n .
pg_resetxlog: pg_control exists but has invalid CRC; proceed with caution
Guessed pg_control values:

pg_control version number: 812
Catalog version number: 200510211
Database system identifier: 5005219046698704127
Current log file ID: 0
Next log file segment: 1474589828
Latest checkpoint's TimeLineID: 177739
Latest checkpoint's NextXID: 1
Latest checkpoint's NextOID: 0
Latest checkpoint's NextMultiXactId: 1197559863
Latest checkpoint's NextMultiOffset: 4
Maximum data alignment: 131072
Database block size: 1
Blocks per segment of large relation: 128
Maximum length of identifiers: 1414868549
Maximum columns in an index: 3681606
Date/time type storage: floating-point numbers
Maximum length of locale name: 0
LC_COLLATE:
LC_CTYPE:

I end up with no locale and hence understandably a database server that
won't start ...

I have not yet found a way to set the locale and ctype. hex editor maybe?

any help is appreciated

have a good new year!

thanks

Bernhard
--
Graylion's Fetish & Fashion Store
Goth and Kinky Boots, Clothing and Jewellery
http://www.graylion.net

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Tom Lane 2007-12-31 15:34:33 Re: pg recovery
Previous Message Suresh Gupta VG 2007-12-31 06:21:38 Need some help in psql Configuration