Question on Wal time lines

Поиск
Список
Период
Сортировка
Искать

Question on Wal time lines

От:
dabicho <tsukebumi@gmail.com>
Дата:

For restoring a database from wal files, if I omit a target on the recovery.conf file, can I make it so the database continues the time line instead of starting one?
Or is there a tool to pick the most recent time line from a bunch of wal files?

thankyou.

Re: Question on Wal time lines

От:
John R Pierce <pierce@hogranch.com>
Дата:
On 05/03/11 3:07 PM, dabicho wrote:
>
> For restoring a database from wal files, if I omit a target on the 
> recovery.conf file, can I make it so the database continues the time 
> line instead of starting one?
> Or is there a tool to pick the most recent time line from a bunch of 
> wal files?
>
> thankyou.
>

you need to playback all the wal files from when you started the base 
backup.  of course, you need that base backup, too.




Re: Question on Wal time lines

От:
dabicho <tsukebumi@gmail.com>
Дата:


El may 3, 2011 5:59 p.m., "John R Pierce" <pierce@hogranch.com> escribió:
>
> On 05/03/11 3:07 PM, dabicho wrote:
>>
>>
>> For restoring a database from wal files, if I omit a target on the recovery.conf file, can I make it so the database continues the time line instead of starting one?
>> Or is there a tool to pick the most recent time line from a bunch of wal files?
>>
>> thankyou.
>>
>
> you need to playback all the wal files from when you started the base backup.  of course, you need that base backup, too.
>
I did that.
I restored the database, put the recovery file in place along with previous wal files and the last wall files, and after start up there was a new time line.
Am I missing something?
This is postgres 9.0
>
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general

Re: Question on Wal time lines

От:
Greg Smith <greg@2ndquadrant.com>
Дата:
dabicho wrote:
>
> For restoring a database from wal files, if I omit a target on the 
> recovery.conf file, can I make it so the database continues the time 
> line instead of starting one?
> Or is there a tool to pick the most recent time line from a bunch of 
> wal files?
>

When recovery finishes, you get a new timeline.  That way it's always 
possible to distinguish between a server that's exited recovery, and 
started generating new WAL data, from one that is still sync'd to the 
master and running recovery of the original timeline.  If you don't want 
a new timeline, don't let recovery finish.

As for the options you can tweak, see 
http://www.postgresql.org/docs/9.0/static/continuous-archiving.html#BACKUP-TIMELINES 
and the recovery target parameters at 
http://www.postgresql.org/docs/9.0/static/recovery-target-settings.html  
You can navigate among multiple timelines in a set of WAL files using 
recovery_target_timeline and the other target settings.  It really is 
worth the trouble to run some experiments with these ideas to see what 
you can do, before you're forced to do so by an emergency.

-- 
Greg Smith   2ndQuadrant US    greg@2ndQuadrant.com   Baltimore, MD
PostgreSQL Training, Services, and 24x7 Support  www.2ndQuadrant.us
"PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books

FAQ