From: | Jesper Krogh <jesper(at)krogh(dot)cc> |
---|---|
To: | pgsql-admin(at)postgresql(dot)org |
Subject: | Untraditional point in time recovery. |
Date: | 2011-11-08 19:24:39 |
Message-ID: | 4EB981F7.5040802@krogh.cc |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-admin |
Hi List.
I have somehow, come up with a postgresql left in this state..
The database crashed today, needing to do a point in time restore that
should stop today before 10:30. I do have wal-files from today - 7 days
available
and I have a scheduled base backup that runs:
pg_start_backup before and pg_stop backup after, once a week. The
last one being -2 days old and the former being -9 days old.
When inspecting the backup I can see that the former backup had
failed to run "pg_stop_backup" so, the pg_start_backup command
of the -2 base backup has failed.
Can I instruct to postgresql to start from the -2 days base backup and
go back to the last "checkpoint" prior to the backup start form the
transaction logs and apply log from that point up until today?
Normally I would just start by the -9 base and apply wal-log from there, but
I am missing a days worth log-file to do that.
So the situation is:
pg_start_backup was run 9 days ago
pg-dirs was copied 2 days ago
pg_stop_backup was run 2 days ago.
I have now-7days worth of archived logs.
It should be safe to just apply "wal-log" from any state prior to -2
days ago?
Can somehow instruct pg to do just that? And reach consistent state
after that.
Should I manually craft a backup_label file?
thanks.
Jesper .. and yes, I'll make sure that the exitstatus from
pg_start_backup gets propagated
correctly back from now on..
From | Date | Subject | |
---|---|---|---|
Next Message | Ruslan A. Bondar | 2011-11-09 11:02:25 | How to deal with corrupted database? |
Previous Message | Kevin Grittner | 2011-11-07 19:00:35 | Re: streaming replication |