pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andy Shellam (Mailing Lists) <andy.shellam-lists@mailnetwork.co.uk>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-admin@postgresql.org
Subject: Re: Recovering a deleted database problem
Date: Fri, 05 Jan 2007 15:26:28 +0000
Message-ID: <459E6E24.2090505@mailnetwork.co.uk> (raw)
In-Reply-To: <15671.1168009739@sss.pgh.pa.us>
References: <459E32DC.3030402@mailnetwork.co.uk>
	<15671.1168009739@sss.pgh.pa.us>

Thanks for the info Tom, too much data will have been entered into the 
other databases in the cluster by now so I cannot give it another shot 
on that server, plus all of yesterday's WAL logs will have been purged 
by now by the daily backup routine.

Is it enough to simply have re-copied in the base/xxx directory from the 
base backup, after the PITR recovery had completed (obviously any 
changes made to that database since the base backup won't have been 
restored but thankfully it's backed up nightly and doesn't change too 
often :-) )  All CRUD operations seem to be working on that database OK 
and the app that (I now know) uses it hasn't complained.

What I'll probably do is try to simulate the same process again on a 
different machine to get myself a bit more familiar.  Is there any other 
situations you can think of where this may also be relevant, or is it 
just when dropping a complete database?

Many thanks,

Andy.

Tom Lane wrote:
> "Andy Shellam (Mailing Lists)" <andy.shellam-lists@mailnetwork.co.uk> writes:
>   
>> (Note, after writing this, I tried restoring to a minute earlier (ie. 
>> 18:57:40) and still have the same problem.
>>     
>
> The PITR recovery process in effect rolls forward until it finds
> a transaction-commit record >= the specified time.  Now for normal
> database operations, stopping just short of the commit of the
> transaction is enough to ensure that the transaction has no effect.
> But for the XLOG_DBASE_DROP record, not so --- replaying that means
> "rm -rf base/whatever".  So you've got to make sure the replay stops
> before it reaches that record, and that means you need a stop time
> <= the commit time of some *prior* transaction.  I suppose this was
> a slow time of day and you didn't have any other commits in the prior
> minute :-( ... so take another look in the log and see what was the
> last commit before that, and use that time.
>
> 			regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 2: Don't 'kill -9' the postmaster
>
> !DSPAM:37,459e6a32137101648020742!
>
>
>   


-- 
Andy Shellam
NetServe Support Team

the Mail Network
"an alternative in a standardised world"





view thread (5+ messages)  latest in thread

Message-ID: <459E6E24.2090505@mailnetwork.co.uk>
Permalink:  ../459E6E24.2090505@mailnetwork.co.uk/
Also on:    postgresql.org/message-id/459E6E24.2090505@mailnetwork.co.uk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: andy.shellam-lists@mailnetwork.co.uk, tgl@sss.pgh.pa.us
  Subject: Re: Recovering a deleted database problem
  In-Reply-To: <459E6E24.2090505@mailnetwork.co.uk>
  References: <459E32DC.3030402@mailnetwork.co.uk> <15671.1168009739@sss.pgh.pa.us> <459E6E24.2090505@mailnetwork.co.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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