Skip site navigation (1) Skip section navigation (2)

on-line backup questions

From: Tom Davies <tgdavies(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: on-line backup questions
Date: 2007-12-22 02:02:50
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
I've been working on backup restore scripts for a PostgreSQL DB hosted  
on an Amazon EC2 instance. EC2 instances don't have any persistent  
storage, so I archive the WAL files to Amazon S3. I do periodic  
backups, and restore and roll forward when an instance is restarted.

I've followed the excellent documentation at 
  , and everything is working well, but I have a few further questions.

1. Purely out of curiousity, what's the nnnnnnnn.history file which is  
requested from the archive when you restore? I realise that the  
restore process looking for files which don't exist is not a problem,  
I'm just being inquisitive.

2. When I do a backup, Postgres requests archiving of n.m.backup and  
the WAL file n immediately, so I only copy WAL files with numbers > n  
from pg_xlog. I've seen suggestions that I should be copying WAL files  
with numbers >= n -- is there any reason to do so?

3. What's the best thing to do when I deliberately shut down  
PostgreSQL (i.e. pg_ctl stop)? When I start again I will be restoring  
from the most recent backup and rolling forward over the archived WAL  
files. I believe that shutdown leaves me with unarchived WAL files in  
pg_xlog. Can I simply copy these to S3 as if they were WAL files which  
were copied from pg_xlog at the time of the last backup, and then put  
them back into pg_xlog as part of my restore process?

4. I'm using PostgreSQL 8.0 -- are there any significant improvements  
in on-line backups in later versions?



pgsql-admin by date

Next:From: Tom LaneDate: 2007-12-22 02:33:50
Subject: Re: on-line backup questions
Previous:From: Scott MarloweDate: 2007-12-20 22:13:28
Subject: Re: about the performance of autovacuum and vacuumdb?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group