Re: [GENERAL] Incremental / Level -1 backup in PG

Поиск
Список
Период
Сортировка
От Stephen Frost
Тема Re: [GENERAL] Incremental / Level -1 backup in PG
Дата
Msg-id 20170322003651.GU9812@tamriel.snowman.net
обсуждение исходный текст
Ответ на [GENERAL] Incremental / Level -1 backup in PG  (Rakesh Kumar <rakeshkumar464@outlook.com>)
Ответы Re: [GENERAL] Incremental / Level -1 backup in PG  (rakeshkumar464 <rakeshkumar464@outlook.com>)
Список pgsql-general
Greetings,

* Rakesh Kumar (rakeshkumar464@outlook.com) wrote:
> PG does not have a concept of incremental  backup. The way it works in Oracle and other RDBMS is that incremental
backuponly backups up changed blocks since the last full backup.  So if only 10% of blocks changed since the last full
backup,incremental backup will be only for 10%. 
> I am wondering whether it is technically feasible to implement it like this:
>
> 1 - At the time of full backup, note the last modified time of each data file in a repository.
> 2 - Next time when incremental backup runs, for every data file it will check the last modified time of it with the
onein the repository to determine whether it has changed since last full backup. If yes, back it up. 
>
> Now on to restore:
>
> 1 - First restore full backup.
> 2 - Restore incremental backup.
>
> My question: Will it work in PG?

The short answer is 'no'.  There are complications around this,
particularly at the edges and because files can be written and rewritten
as you're reading them.  Basically, no file with a timestamp after the
checkpoint before the backup can be omitted from an incremental backup.

I strongly recommend you use one of the existing backup solutions for
PostgreSQL which know how to properly perform incremental backups.  I
know at least pgBackrest and barman do, I'm not sure about others.

Thanks!

Stephen

Вложения

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

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: [GENERAL] Incremental / Level -1 backup in PG
Следующее
От: Stephen Frost
Дата:
Сообщение: Re: [GENERAL] Incremental / Level -1 backup in PG