Re: PITR Recovery Question

Поиск
Список
Период
Сортировка
От Florian Pflug
Тема Re: PITR Recovery Question
Дата
Msg-id 7B83DD06-04B8-4BE5-8573-3CDD48568F1D@phlo.org
обсуждение исходный текст
Ответ на Re: PITR Recovery Question  ("Gnanakumar" <gnanam@zoniac.com>)
Ответы Re: PITR Recovery Question
Re: PITR Recovery Question
Список pgsql-admin
On Jun 5, 2010, at 9:05 , Gnanakumar wrote:
> Thanks for your valuable suggestion and a detailed step on common way to use
> PITR.  Things are very clear now except that I've some other question in
> connection to this.
>
>> The correct way to clean out pg_xlog therefore is to either disable WAL archiving, or to make sure your
archive_commandsucceeds eventually. 
>
> Probably I would go with the 2nd option, that is allowing archive command to
> run successfully until things are completely clear.
>
> But this question is for my understanding:  In case if I decide to go with
> 1st option, that is disable WAL archiving for a while, will it completely
> clean out files from pg_xlog/ and pg_xlog/archive_status/ directories, so
> that I can start the PITR by taking base backup by enabling WAL archiving
> later?

If you disable WAL archiving by setting archive_command to 'true', it'll surely clean out the files, since postgresql
willactually believe it archived them successfully. I not sure what happens if you set archive_command to '' - that
mightdisable the archiving process completely, and hence prevent the cleanup. 

>> A common way to use PITR is the following.
>
>> 4) You remove all WAL segments that predate the remaining base backups. For that, you find the backup history file
inthe archive directory that corresponds to the oldest remaining base backup and then remove all WAL segments whose
nameis numerically smaller than the <number1> from that backup history file. Keeping older WAL segments buys you
nothing- WAL files without a base backup that *predates* them are worthless. 
>
> Can you share with me any automated shell script that takes care of this
> removal automatically?  Or can you share any systematic way (steps) of doing
> things if I want to do this manually?


Sorry, I don't have a script for this at hand. But a quick search through the pgsql-admin archive brings up this post,
whichcontains such a script. 
http://archives.postgresql.org/pgsql-admin/2006-03/msg00337.php

best regards,
Florian Pflug


В списке pgsql-admin по дате отправления:

Предыдущее
От: mnavahan
Дата:
Сообщение: Re: restore db from other db folder
Следующее
От: RBN
Дата:
Сообщение: fsync tests