Solved

Postgres Backup suggestions

Posted on 2013-01-24
7
1,102 Views
Last Modified: 2013-02-13
Hello,
I have several postgres database clusters which i backup regularly using pg_dump.  This currently is working just fine, as i haven't needed to restore a database after a catastrophic failure, but it is not ideal, as i can only restore the database up to the point at which I took the backup.

I have looked into pg-rman (http://code.google.com/p/pg-rman/) which looks promising, but i was wondering what others have used which would allow me to restore a database, and then apply WAL logs to recover as much data as possible.

Any suggestions are much appreciated, thanks in advance.
0
Comment
Question by:Alex Matzinger
  • 4
  • 2
7 Comments
 
LVL 10

Expert Comment

by:ivanovn
ID: 38815690
If you are able to spare additional hardware, you could setup a warm standby using log shipping. The standby servers are in continuous recovery mode applying the WAL from the primary DB.

For more information check the PostgreSQL documentation: http://www.postgresql.org/docs/9.2/static/warm-standby.html
0
 
LVL 4

Author Comment

by:Alex Matzinger
ID: 38815818
Sorry, i forgot to mention that I am running these databases with warm-standby's.

I would just also like to take regular backups of the database to store elsewhere for recovery(in the event i lost both primary and standby, or if the databases became corrupt).
0
 
LVL 39

Assisted Solution

by:lcohan
lcohan earned 250 total points
ID: 38815886
"I would just also like to take regular backups of the database to store elsewhere for recovery
(in the event i lost both primary and standby, or if the databases became corrupt)."

if you are affraid of data(base) corruption rather than server hardware failure(s) I would make sure to ship my full backup and restore it (idealy) somewher off site and only ship my WAL files there so I can roll them forward on demand to the desired point in time.
0
Back Up Your Microsoft Windows Server®

Back up all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

 
LVL 4

Author Comment

by:Alex Matzinger
ID: 38829151
That would be less than ideal.  I do not have that type of resource.  

I am more looking for tools, or backup strategies that other people have used/use where i can back up my database, store it on a tape or other such large storage device, and then restore the database from that backup, and apply the needed WAL logs.
0
 
LVL 10

Accepted Solution

by:
ivanovn earned 250 total points
ID: 38835729
amatzinger, we implemented similar backup strategy you outlined in your initial question. We performed a full backup whenever we got close to running out of space on the WAL disk partition. Then we would move the full backup onto a slower piece of storage and remove the WAL logs on the partition.

We've never had to restore from this configuration, but in our testing, restoring by setting the DB into restore mode and applying the logs worked just fine, except that the amount of time to restore depended directly on the amount of logs that needed to be applied.

For this reason, we moved to a warm stand-by solution I mentioned in my first comment. Again, we haven't had to restore from it (aka switch to it), but seems to be working pretty well so far.
0
 
LVL 4

Assisted Solution

by:Alex Matzinger
Alex Matzinger earned 0 total points
ID: 38887044
Thank You all for your comments/suggestions.  Here are the tools i've found so far for running backups.

www.postgresql.org/docs/current/static/app-pgbasebackup.html
http://www.pgbarman.org/
http://code.google.com/p/pg-rman/

I believe we are going to keep our warm-standby, and then run daily backups using postgres' pg_basebackup tool.
0
 
LVL 4

Author Closing Comment

by:Alex Matzinger
ID: 38887049
Thank You all again for your help
0

Featured Post

Efficient way to get backups off site to Azure

This user guide provides instructions on how to deploy and configure both a StoneFly Scale Out NAS Enterprise Cloud Drive virtual machine and Veeam Cloud Connect in the Microsoft Azure Cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Can i Import Access Table Into Oracle Using Toad 36 222
Need a starter for ETL protocol? 4 65
constraint check 2 48
Teradata converting character to integer 2 26
VM backup deduplication is a method of reducing the amount of storage space needed to save VM backups. In most organizations, VMs contain many duplicate copies of data, such as VMs deployed from the same template, VMs with the same OS, or VMs that h…
In this article we will learn how to backup a VMware farm using Nakivo Backup & Replication. In this tutorial we will install the software on a Windows 2012 R2 Server.
This tutorial will walk an individual through the process of installing of Data Protection Manager on a server running Windows Server 2012 R2, including the prerequisites. Microsoft .Net 3.5 is required. To install this feature, go to Server Manager…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question