pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
DB corruption
3+ messages / 3 participants
[nested] [flat]

* DB corruption
@ 2018-03-23 07:59  Akshay Ballarpure <akshay.ballarpure@tcs.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Akshay Ballarpure @ 2018-03-23 07:59 UTC (permalink / raw)
  To: pgsql-performance@lists.postgresql.org

Hi,
I have a query on DB corruption. Is there any way to recover from it 
without losing data ?

Starting postgresql service: [ OK ]
psql: FATAL: index "pg_authid_rolname_index" contains unexpected zero page 
at block 0
HINT: Please REINDEX it.
psql: FATAL: "base/11564" is not a valid data directory
DETAIL: File "base/11564/PG_VERSION" does not contain valid data.
HINT: You might need to initdb.
psql: FATAL: "base/11564" is not a valid data directory
DETAIL: File "base/11564/PG_VERSION" does not contain valid data.
HINT: You might need to initdb.
psql: FATAL: "base/11564" is not a valid data directory
DETAIL: File "base/11564/PG_VERSION" does not contain valid data.
HINT: You might need to initdb.
psql: FATAL: "base/11564" is not a valid data directory
DETAIL: File "base/11564/PG_VERSION" does not contain valid data.
HINT: You might need to initdb. 

With Best Regards
Akshay

=====-----=====-----=====
Notice: The information contained in this e-mail
message and/or attachments to it may contain 
confidential or privileged information. If you are 
not the intended recipient, any dissemination, use, 
review, distribution, printing or copying of the 
information contained in this e-mail message 
and/or attachments to it are strictly prohibited. If 
you have received this communication in error, 
please notify us by reply e-mail or telephone and 
immediately and permanently delete the message 
and any attachments. Thank you

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: DB corruption
@ 2018-03-23 08:04  Michael Paquier <michael@paquier.xyz>
  parent: Akshay Ballarpure <akshay.ballarpure@tcs.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Michael Paquier @ 2018-03-23 08:04 UTC (permalink / raw)
  To: Akshay Ballarpure <akshay.ballarpure@tcs.com>; +Cc: pgsql-performance@lists.postgresql.org

On Fri, Mar 23, 2018 at 01:29:35PM +0530, Akshay Ballarpure wrote:
> I have a query on DB corruption. Is there any way to recover from it 
> without losing data ?

Corrupted pages which need to be zeroed in order to recover the rest is
data lost forever, except if you have a backup you can rollback to.
Please see here for some global instructions about how to deal with such
situations:
https://wiki.postgresql.org/wiki/Corruption

First take a deep breath, and take the time to read and understand it.

> Notice: The information contained in this e-mail
> message and/or attachments to it may contain 
> confidential or privileged information. If you are 
> not the intended recipient, any dissemination, use, 
> review, distribution, printing or copying of the 
> information contained in this e-mail message 
> and/or attachments to it are strictly prohibited. If 
> you have received this communication in error, 
> please notify us by reply e-mail or telephone and 
> immediately and permanently delete the message 
> and any attachments. Thank you

This is a public mailing list.
--
Michael

Attachments:

  [application/pgp-signature] signature.asc (832B, ../../20180323080455.GC7070@paquier.xyz/2-signature.asc)
  download

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: DB corruption
@ 2018-03-23 15:08  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Akshay Ballarpure <akshay.ballarpure@tcs.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2018-03-23 15:08 UTC (permalink / raw)
  To: Akshay Ballarpure <akshay.ballarpure@tcs.com>; +Cc: pgsql-performance@lists.postgresql.org

Akshay Ballarpure <akshay.ballarpure@tcs.com> writes:
> I have a query on DB corruption. Is there any way to recover from it 
> without losing data ?

You've already lost data, evidently.

> Starting postgresql service: [ OK ]
> psql: FATAL: index "pg_authid_rolname_index" contains unexpected zero page 
> at block 0
> HINT: Please REINDEX it.

This is not good.  It'd be possible to reindex that index, certainly,
but the question is what other files have also been clobbered.

> psql: FATAL: "base/11564" is not a valid data directory
> DETAIL: File "base/11564/PG_VERSION" does not contain valid data.
> HINT: You might need to initdb.

Based on the OID I'm going to guess that this is from an attempt to
connect to the "postgres" database.  (I'm also going to guess that
you're running 8.4.x, because any later PG version would have a higher
OID for "postgres".)  Can you connect to any other databases?  If so,
do their contents seem intact?  If you're really lucky, meaning (a) the
damage is confined to that DB and (b) you didn't keep any important
data in it, then dropping and recreating the "postgres" DB might be
enough to get you out of trouble.  But pg_authid_rolname_index is
a cluster-global index, not specific to the "postgres" DB, so the
fact that it too seems to be damaged is not promising.

TBH your best bet, if the data in this installation is valuable and
you don't have adequate backups, is to hire a professional data
recovery service --- there are several companies that specialize in
getting as much out of a corrupted PG installation as possible.
(See https://www.postgresql.org/support/professional_support/ for
some links.)  You should then plan on updating to some newer PG
release; 8.4.x has been out of support for years, and there are lots
of known-and-unfixed bugs in it.

			regards, tom lane




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2018-03-23 15:08 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2018-03-23 07:59 DB corruption Akshay Ballarpure <akshay.ballarpure@tcs.com>
2018-03-23 08:04 ` Michael Paquier <michael@paquier.xyz>
2018-03-23 15:08 ` Tom Lane <tgl@sss.pgh.pa.us>

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