Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X7rAk-0002rH-Ok for pgsql-admin@arkaria.postgresql.org; Thu, 17 Jul 2014 19:16:54 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1X7rAk-0004R5-4n for pgsql-admin@arkaria.postgresql.org; Thu, 17 Jul 2014 19:16:54 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1X7rAj-0004Qn-2D for pgsql-admin@postgresql.org; Thu, 17 Jul 2014 19:16:53 +0000 Received: from mail.journyx.com ([209.163.206.41] helo=mail.int.journyx.com) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1X7rAd-0005PO-QW for pgsql-admin@postgresql.org; Thu, 17 Jul 2014 19:16:52 +0000 Received: from localhost (localhost [127.0.0.1]) by mail.int.journyx.com (Postfix) with ESMTP id 61B70300073; Thu, 17 Jul 2014 14:16:40 -0500 (CDT) Received: from mail.int.journyx.com ([127.0.0.1]) by localhost (mail.int.journyx.com [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id znjOUq67wftj; Thu, 17 Jul 2014 14:16:36 -0500 (CDT) Received: from localhost (localhost [127.0.0.1]) by mail.int.journyx.com (Postfix) with ESMTP id 2DCA831D18E; Thu, 17 Jul 2014 14:16:36 -0500 (CDT) X-Virus-Scanned: amavisd-new at mail.int.journyx.com Received: from mail.int.journyx.com ([127.0.0.1]) by localhost (mail.int.journyx.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Tc1g5AooSOWh; Thu, 17 Jul 2014 14:16:35 -0500 (CDT) Received: from mail.int.journyx.com (zimbra.int.journyx.com [192.168.100.5]) by mail.int.journyx.com (Postfix) with ESMTP id EC1CE300073; Thu, 17 Jul 2014 14:16:35 -0500 (CDT) Date: Thu, 17 Jul 2014 14:16:35 -0500 (CDT) From: Scott Whitney Reply-To: Scott Whitney To: John Scalia Cc: pgsql-admin@postgresql.org Message-ID: <984033755.512124.1405624595840.JavaMail.zimbra@mail.int.journyx.com> In-Reply-To: <53C81F98.9070405@gmail.com> References: <53C81F98.9070405@gmail.com> Subject: Re: Trying to recover a corrupted database MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_Part_512123_1538703047.1405624595838" X-Originating-IP: [192.168.100.188] X-Mailer: Zimbra 8.0.7_GA_6021 (ZimbraWebClient - GC35 (Win)/8.0.7_GA_6021) Thread-Topic: Trying to recover a corrupted database Thread-Index: re6OJrUJR5xjCdyDHuRP15+Ig7B3Gw== X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org ------=_Part_512123_1538703047.1405624595838 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit a) How many databases do you have? b) Have you tried to pg_dump the database(s) to see if that succeeds? If you _can_ pg_dump (which you might or might not be able to do), you could re-init the cluster and restore. ----- Original Message ----- > Hi all, > You may have seen my post from yesterday about our production database > getting corrupted. Well, this morning we brought the system down to single > user and ran an fsck which did > report some drive errors. We repeated until no additional errors were > reported. Then, we brought the system back to multi-user status and ran a > successful pg_basebackup on the > broken database. Since then we restarted the database and a ps -ef result > looks like: > /usr/pgsql-9.2/bin/postmaster -D /opt/datacenter -o -c > zero_damaged_pages=true -i -N 384 -p 5431 > After the Db started up, we ran a VACUUM FULL ANALYZE which ran for about 3 > hours, but the database is still showing the same type of errors in its log: > invalid page header in > block 29718... etc. What disturbed me a little, is that I don't think the > zero_damaged_pages got applied. Checking the pg_settings table, we got: > select name, setting, boot_val, reset_val from pg_settings where name = > 'zero_damaged_pages'; > name | setting | boot_val | reset_val > --------------------------------------------------------------------------------- > zero_damaged_pages | on | off | on > Now, my colleague ran this after he tried running some operations again after > I told him how to set zero_damaged_pages again. He swears that that it was > on when the first VACUUM > FULL ANALYZE was run, but I'm not as sure. Plus, I don't understand why the > boot_val shows as off. In any event, as we're still getting log errors like > before, I don't really know > what to try next other than rerunning the VACUUM FULL again. Help? > -- > Jay > -- > Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-admin ------=_Part_512123_1538703047.1405624595838 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: quoted-printable
a) How many databases do yo= u have?
b) Have you tried to pg_dump the database(s) to see if th= at succeeds?

If you _can_ pg_dump (which you might= or might not be able to do), you could re-init the cluster and restore.


Hi all,

You may have seen my pos= t from yesterday about our production database getting corrupted. Well, thi= s morning we brought the system down to single user and ran an fsck which d= id
report some drive errors. We repeated until no additional errors wer= e reported. Then, we brought the system back to multi-user status and ran a= successful pg_basebackup on the
broken database. Since then we restart= ed the database and a ps -ef result looks like:

/usr/pgsq= l-9.2/bin/postmaster -D /opt/datacenter -o -c zero_damaged_pages=3Dtrue -i = -N 384 -p 5431

After the Db started up, we ran a VACUUM F= ULL ANALYZE which ran for about 3 hours, but the database is still showing = the same type of errors in its log: invalid page header in
block 29718.= .. etc. What disturbed me a little, is that I don't think the zero_damaged_= pages got applied. Checking the pg_settings table, we got:

select name, setting, boot_val, reset_val from pg_settings where name =3D= 'zero_damaged_pages';
             &= nbsp;     name             |  = setting  |  boot_val  | reset_val
-----------------------= ----------------------------------------------------------
  z= ero_damaged_pages  |  on          | off =              | on

Now,= my colleague ran this after he tried running some operations again after I= told him how to set zero_damaged_pages again. He swears that that it was o= n when the first VACUUM
FULL ANALYZE was run, but I'm not as sure. Plus= , I don't understand why the boot_val shows as off. In any event, as we're = still getting log errors like before, I don't really know
what to try n= ext other than rerunning the VACUUM FULL again. Help?
--
Jay
=


--
Sent via pgsql-admin mailing list (pgsq= l-admin@postgresql.org)
To make changes to your subscription:
http://= www.postgresql.org/mailpref/pgsql-admin

------=_Part_512123_1538703047.1405624595838--