Solved

Postgres Backup suggestions

Posted on 2013-01-24
7
1,088 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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

How to update Firmware and Bios in Dell Equalogic PS6000 Arrays and Hard Disks firmware update.
Shadow IT is coming out of the shadows as more businesses are choosing cloud-based applications. It is now a multi-cloud world for most organizations. Simultaneously, most businesses have yet to consolidate with one cloud provider or define an offic…
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…
This tutorial will walk an individual through setting the global and backup job media overwrite and protection periods in Backup Exec 2012. Log onto the Backup Exec Central Administration Server. Examine the services. If all or most of them are stop…

747 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now