Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id DFA146335A9 for ; Fri, 4 Jun 2010 12:03:02 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 90346-03 for ; Fri, 4 Jun 2010 15:02:55 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mail.postgresql.org (Postfix) with ESMTP id 6C453633530 for ; Fri, 4 Jun 2010 12:02:55 -0300 (ADT) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Fri, 04 Jun 2010 10:02:54 -0500 Message-Id: <4C08CF4D0200002500031F44@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Fri, 04 Jun 2010 10:02:53 -0500 From: "Kevin Grittner" To: , Cc: Subject: Re: PITR Recovery Question References: <001201cb0321$df429d40$9dc7d7c0$@com> <00ca01cb03dc$a9ffe780$fdffb680$@com> In-Reply-To: <00ca01cb03dc$a9ffe780$fdffb680$@com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-4.21 tagged_above=-10 required=5 tests=BAYES_00=-1.9, RCVD_IN_DNSWL_MED=-2.3, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201006/45 X-Sequence-Number: 34823 "Gnanakumar" wrote: > My pg_xlog/ and walarchive/ directory locations are > "/usr/local/pgsql/data/pg_xlog" and "/mnt/pitr/walarchive" > respectively. > > In case, if I decide to clean the old WAL archives and set right > PITR from today onwards by taking base backup, so that I can start > managing and maintaining atleast from now onwards, what is the > correct way/method of removing files from pg_xlog/, > pg_xlog/archive_status/ and /mnt/pitr/walarchive/ directories? It is generally unsafe to delete any WAL files from pg_xlog. If they are there because your archive command has been failing, you need to turn off archiving or (probably more convenient) allow the archive script to return success until things clear. One trick would be to temporarily change your archive_command to 'true', delete all files from your archive, and then change the command back. Doing that without exposing yourself to a period where you have no backup might be tricky, though. If the only problem with the archive command is that the archive fs is full, I would copy the contents of the archive directory to tape or whatever medium you have for long-term storage, delete the contents, and let archive succeed. The pg_xlog directory will eventually clear, and then I would get a fresh PITR base backup (following all the documented steps for doing so). You really want to see WAL files flowing to your archive location before you start the process of getting a new base backup. If there's some other reason that the archive command has been failing, what is it? -Kevin