Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VLudP-0003MA-Qi for pgsql-admin@arkaria.postgresql.org; Tue, 17 Sep 2013 12:44:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VLudP-0000Jl-9C for pgsql-admin@arkaria.postgresql.org; Tue, 17 Sep 2013 12:44:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VLudN-0000I1-FR for pgsql-admin@postgresql.org; Tue, 17 Sep 2013 12:44:01 +0000 Received: from nm39-vm5.bullet.mail.bf1.yahoo.com ([72.30.239.149]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VLudE-0001XS-VS for pgsql-admin@postgresql.org; Tue, 17 Sep 2013 12:44:01 +0000 Received: from [98.139.212.150] by nm39.bullet.mail.bf1.yahoo.com with NNFMP; 17 Sep 2013 12:43:51 -0000 Received: from [98.139.212.224] by tm7.bullet.mail.bf1.yahoo.com with NNFMP; 17 Sep 2013 12:43:51 -0000 Received: from [127.0.0.1] by omp1033.mail.bf1.yahoo.com with NNFMP; 17 Sep 2013 12:43:51 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 416434.54028.bm@omp1033.mail.bf1.yahoo.com Received: (qmail 43581 invoked by uid 60001); 17 Sep 2013 12:43:51 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymail.com; s=s1024; t=1379421831; bh=qj7JTYce/TRZ89O+n+RCGb3klyZ1MhAsf0tkZNLZMUU=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=JQkTLsdE6KorDH5WqJ+oP7KdVQ4Aw/pUjjpp4QyQR4ARWhyRRrn8SUldQNUUemwpyyPKQ90pxHGqUGbD3bHZ30vq0JEn+BVIWQkvSfxhYf5HoX62LiTU/xTnW0i8BvDD3gHBKyn4AmzJT/cS4tSbIbZeZjuYYG+pO3rUfS3rA1Y= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=ymail.com; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:References:Message-ID:Date:From:Reply-To:Subject:To:In-Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=shKzBTW7zpT+7s0pTwxOvymOHW6AJh+tqOy117WtLU6UrIX5eq0gIH5jbUZQNfvJk2DzdZDfMhZoQPvZ+RxR8X/8Q4xx6Xx+8vkAaTwioIHdrWkZGu0FOOw5Ixn3nIoeiqbLNNDdBiW+LOWFAoXSkYmvs0DWTxdGCyGIh3rvtl0=; X-YMail-OSG: 8DcokpUVM1leRhax5.4lU3S1xRwqOuaAWmLpYl7PCix2tKp HjS1YEpL_Tk13s_43iESBgogBsBBONl4ljxDay1JUk1v7QsnPIjMz7o_xeXJ PJirgTk_DzC3aBxpu3rZgr8g8pgP_6c0FA5B_ajuYZ6a1J9OF1j6BrbRSJZB 1uLIcDI0d.s84W8cv3Kr_xU6_Cu3DIIv28srhCFG8kT76cOsb7baQxxqFHX7 IhUmjuCbYD3oodfsXPMVp89McSVuIFnx28YBwRcf56YLfCg7HNiseApeo53b 0FnJWjQ8g.XKnnNxXAafjPA9k4xheudC4J4grFdZfLIZG1IsYLEt7xJBFIti KURCUXZ_O7zyjaki3McRKj6gUoo4yNjavosMTI3pBHfIViqQ2d_DMU1694S8 9RtEArGxVoTco2JpNmvV99MkrDajY6p0Rv5xSEqgkOZjBFFGvkF5tc7QaVJX QxYLWfn9FLq4yjhWp.xeGOsDiiSOsrkougV.wcBkWQ48s.LJZcvz.hY2dYKr 5Ik9.4s2MysMlanpbG_Db_Abiy7MdaLvnD_oVAXAK6UZEzJNvR2kJsbQXQUt IVStmvaDRjJYi61HeqEgsdmhL3JnHmnk6_WjSsR4OFhK5bqiLEin6h0Okwij gNQ-- Received: from [76.255.18.237] by web162902.mail.bf1.yahoo.com via HTTP; Tue, 17 Sep 2013 05:43:50 PDT X-Rocket-MIMEInfo: 002.001, TmF0YWxpZSBXZW56IDxuYXRhbGlld2VuekBlYnVyZWF1LmNvbT4gd3JvdGU6Cgo.IEkgaGF2ZSBhIGxhcmdlIGRhdGFiYXNlIGZyb20gb3VyIHRlc3QgZW52aXJvbm1lbnQgdGhhdCBnb3QgaW50byB0cm91YmxlIHdpdGgKPiBzb21lIGhpZ2ggdm9sdW1lIGFuZCBzb21lIGxvbmctcnVubmluZyBxdWVyaWVzIGFib3V04oCmc2l4IHdlZWtzIGFnbz8gV2UgaGF2ZSBhCj4gYnVmZmVyIG1lY2hhbmlzbSB0aGF0IGhhcyBiZWVuIHN0b3JpbmcgdGhlIG5ldyBkYXRhIHNpbmNlIHRoZSBkYXRhYmFzZSBzdG9wcGVkCj4BMAEBAQE- X-Mailer: YahooMailWebService/0.8.157.561 References: Message-ID: <1379421830.30619.YahooMailNeo@web162902.mail.bf1.yahoo.com> Date: Tue, 17 Sep 2013 05:43:50 -0700 (PDT) From: Kevin Grittner Reply-To: Kevin Grittner Subject: Re: Dumping a database that is not accepting commands? To: Natalie Wenz , "pgsql-admin@postgresql.org" In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Pg-Spam-Score: -2.0 (--) 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 Natalie Wenz wrote: > I have a large database from our test environment that got into trouble w= ith > some high volume and some long-running queries about=E2=80=A6six weeks ag= o? We have a > buffer mechanism that has been storing the new data since the database st= opped > accepting connections, so we haven't really lost any data, which is good. > But the single-user backend vacuum freeze is still grinding away, using 1= 00% cpu > most of the time, except when it's doing a lot of writes. We did cancel t= he > vacuum once so we could stop the database and take a snapshot of the file= system > (we are using ZFS on FreeBSD) and copy the snapshot to another machine. T= his > allowed us to get a fresh database started (with 9.3!) where we could uns= pool > the last six weeks of data into a fresh database, and be able to access a= t least > that much of our data. I'm not sure how you could have done that without dealing with the wraparound before the upgrade. > Now: > I have a copy of the database (with data from all time up until the datab= ase > shut itself down six weeks ago) that I just need the data from. I am beco= ming > impatient with the vacuum, as it appears to have not even started working= on the > files for one of the largest relations in the database (that table was ab= out > 14TB last I saw). I'm trying to find alternatives to waiting another who > knows how many weeks for the vacuum to finish just to have the database i= n a > state where I can dump the data out, since this is no longer the > "live" version. This copy running on hardware with plenty of space to > work with. The database has about a million transactions before it wraps. The copy running on 9.3, or the original? > Is it possible to somehow just dump the data using pg_dump or pg_dumpall?= I > haven't tried to see if those utilities will work when the database is > protecting itself from data loss. If it were possible, would it be wise (= do > those utilities use tons of transactions to dump, or would it be safely w= ithin > the million or so that I have)? I suppose I could use copy? pg_dump uses COPY (by default, anyway), and does all its work in a single transaction.=C2=A0 But it needs to start that transaction. > Would there be any risks if I were to do that? Maybe none of this > is risky at this point because we can always clone the original > snapshot, and try again. I'm not sure that pg_dump followed by restore would be expected to be faster than finishing the VACUUM, unless that is configured to pace itself way too slowly. > Any ideas or suggestions? After getting past this crisis, I would take a close look at your vacuuming regimen -- it sounds like it is not aggressive enough to keep you out of trouble. I'm sorry that I don't have a better suggestion for resolving the crisis than running VACUUM at maximum speed. -- Kevin Grittner EDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company --=20 Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin