Solved

Postgres Backup suggestions

Posted on 2013-01-24
7
1,112 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

 
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

Comparison of Amazon Drive, Google Drive, OneDrive

What is Best for Backup: Amazon Drive, Google Drive or MS OneDrive? In this free whitepaper we look at their performance, pricing, and platform availability to help you decide which cloud drive is right for your situation. Download and read the results of our testing for free!

Question has a verified solution.

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

As technology users and professionals, we’re always learning. Our universal interest in advancing our knowledge of the trade is unmatched by most industries. It’s a curiosity that makes sense, given the climate of change. Within that, there lies a…
Recently, Microsoft released a best-practice guide for securing Active Directory. It's a whopping 300+ pages long. Those of us tasked with securing our company’s databases and systems would, ideally, have time to devote to learning the ins and outs…
This tutorial will show how to configure a new Backup Exec 2012 server and move an existing database to that server with the use of the BEUtility. Install Backup Exec 2012 on the new server and apply all of the latest hotfixes and service packs. The…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

729 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