X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 6CE119FA261 for ; Wed, 3 May 2006 04:56:09 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 88338-01 for ; Wed, 3 May 2006 04:56:00 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from sand4.gxn.net (sand4.gxn.net [195.147.249.239]) by postgresql.org (Postfix) with ESMTP id 07D6D9FA5F6 for ; Wed, 3 May 2006 04:55:59 -0300 (ADT) Received: from [62.232.55.118] (helo=[192.168.0.2]) by sand4.gxn.net with esmtp (Exim 4.50) id 1FbCC1-0000Y4-UP; Wed, 03 May 2006 08:54:42 +0100 Subject: Re: Backing up large databases From: Simon Riggs To: Steve Burrows Cc: pgsql-admin@postgresql.org In-Reply-To: <44523B85.4020605@jla.com> References: <44523B85.4020605@jla.com> Content-Type: text/plain Date: Wed, 03 May 2006 08:55:57 +0100 Message-Id: <1146642957.449.11.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 (2.2.3-4.fc4) Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200605/23 X-Sequence-Number: 21555 On Fri, 2006-04-28 at 15:57 +0000, Steve Burrows wrote: > I am struggling to find an acceptable way of backing up a PostgreSQL > 7.4 database. > > The database is quite large, currently it occupies about 180GB, > divided into two elements, a set of active tables and a set of archive > tables which are only used for insertions. > > I ran pg_dump -Fc recently, it took 23.5 hours to run, and output a > single file of 126GB. Obviously as the database continues to grow it > will soon be so large that it cannot be pg_dumped within a day. > Running rsync to do a complete fresh copy of the pgsql file structure > took 4 hours, but later that day running another iteration of rsync > (which should have only copied changed files) took 3 hours, and I > cannot afford to have the db down that long. > > Anybody with any ideas? You need not backup the whole database in one go. You can copy only changed data out of the tables using your knowledge of the mail store. That way you'll not need to have such a long running backup and it won't be so large either. You can then reassemble the pieces later into a new table in case of recovery. -- Simon Riggs EnterpriseDB http://www.enterprisedb.com