?
Solved

Postgres Backup suggestions

Posted on 2013-01-24
7
Medium Priority
?
1,125 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 1000 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
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 1000 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

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

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

Lotus Notes has been used since a very long time as an e-mail client and is very popular because of it's unmatched security. In this article we are going to learn about  RRV Bucket corruption and understand various methods to Fix "RRV Bucket Corrupt…
In this article, I’ll look at how you can use a backup to start a secondary instance for MongoDB.
To efficiently enable the rotation of USB drives for backups, storage pools need to be created. This way no matter which USB drive is installed, the backups will successfully write without any administrative intervention. Multiple USB devices need t…
This tutorial will walk an individual through the process of configuring basic necessities in order to use the 2010 version of Data Protection Manager. These include storage, agents, and protection jobs. Launch Data Protection Manager from the deskt…

801 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