Solved

Postgres Backup suggestions

Posted on 2013-01-24
7
1,104 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 40

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
Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

 
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

Backup Solution for AWS

Read about how CloudBerry Backup fully integrates your backups with Amazon S3 and Amazon Glacier to provide military-grade encryption and dramatically cut storage costs on any platform.

Question has a verified solution.

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

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…
Microservice architecture adoption brings many advantages, but can add intricacy. Selecting the right orchestration tool is most important for business specific needs.
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
This tutorial will walk an individual through the steps necessary to install and configure the Windows Server Backup Utility. Directly connect an external storage device such as a USB drive, or CD\DVD burner: If the device is a USB drive, ensure i…

749 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