LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 06-09-2010, 12:29 PM   #1
kaplan71
Member
 
Registered: Nov 2003
Posts: 809

Rep: Reputation: 39
restoring a postgres database


Hi there --

We have a disaster recovery solution for our database where a dump file is generated daily at 1:00 AM. We have tested importing the file, along with running another sql file that generates the appropriate database user accounts, into a database on a third-party server.

One question that came up was the following: Suppose the database crashes in the middle of the day, prior to that there were transactions that were entered into the database between the time the dump file was generated, and the crash occurred.

We can restore the dump file to either the main or backup server. How can the transactions that were made between the time of the dump file and the crash be restored as well?

Thanks.
 
Old 06-09-2010, 03:11 PM   #2
TB0ne
LQ Guru
 
Registered: Jul 2003
Location: Birmingham, Alabama
Distribution: SuSE, RedHat, Slack,CentOS
Posts: 26,659

Rep: Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970Reputation: 7970
Quote:
Originally Posted by kaplan71 View Post
Hi there --

We have a disaster recovery solution for our database where a dump file is generated daily at 1:00 AM. We have tested importing the file, along with running another sql file that generates the appropriate database user accounts, into a database on a third-party server.

One question that came up was the following: Suppose the database crashes in the middle of the day, prior to that there were transactions that were entered into the database between the time the dump file was generated, and the crash occurred.

We can restore the dump file to either the main or backup server. How can the transactions that were made between the time of the dump file and the crash be restored as well?

Thanks.
In the scenario you describe, some sort of magic (time machine, Harry Potter, etc.), is needed. Otherwise, think about what you're asking.

Unless you TAKE the snapshot, you won't HAVE the snapshot. So either take snapshots at multiple times during the day, or have your database do hot replication to an offsite server. You can also try a database backup tool (like TDP/RMAN for Tivoli), that can back up individual records/tables, and have it do a hot backup periodically. Otherwise, the best you can do is to restore the backup you've got, and manually re-enter the information that posted in the meantime.
 
Old 06-09-2010, 03:58 PM   #3
Berhanie
Senior Member
 
Registered: Dec 2003
Location: phnom penh
Distribution: Fedora
Posts: 1,625

Rep: Reputation: 165Reputation: 165
Have you read this, particularly the Point-in-Time section?
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
importing database in postgres gnurich Programming 1 01-16-2010 07:19 AM
Query a postgres database with Java cov Linux - Server 1 12-12-2009 09:29 AM
Scripts updating a postgres database ethnicme Programming 1 07-15-2006 10:21 AM
create table in postgres database kranti Linux - Newbie 1 11-15-2005 06:52 PM
Problem with Postgres Database Connection anjani.78 Linux - Software 1 10-07-2005 02:06 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 05:13 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration