New user, restore archive/xlog since last backup?

15 views
Skip to first unread message

Dave

unread,
May 23, 2013, 2:01:01 PM5/23/13
to pg_rman
Trying pg_rman out for the first time, and am having some difficulty.
For testing purposes, I am running hourly full backups, and then
archive backups every five minutes. Running across a scenario I'm not
sure how to handle.

1. Validate full and archive backups
2. Issue a large update to the database.
3. Shutdown pg -m immediate
4. Delete the entire PG data directory
5. pg_rman restore
6. Startup the database.

At this point I'm left with the database state as of the latest
archive backup, so not including the large update from Step #2. How do
I recover that?

So I tried doing the following instead:

1. Validate full and archive backups
2. Issue a large update to the database.
3. Shutdown pg -m immediate
4. Copy the data/pg_xlog contents to a different location
5. Delete the entire PG data directory
6. pg_rman restore
7. Copy the pg_xlog data from step 4 into the PG data/pg_xlog
directory
6. Startup the database

No luck. In the same place as if I hadn't copied and restore the
pg_xlog directory. What am I doing wrong here? How do I backup and
restore the transactional data since the last pg_rman backup?


Tomonari Katsumata

unread,
May 24, 2013, 6:14:38 PM5/24/13
to pg_...@googlegroups.com
Hi,

both cases, original archiveWALs are still left in the directory
specified by "archive_command" ?
if so, PostgreSQL recover archiveWALs restored by pg_rman,
and then recover orginal archiveWALs.
so the state would be newer than the state when you take backup.

regards,
----
Tomonari Katsumata


2013/5/24 Dave <dgrec...@gmail.com>


--
You received this message because you are subscribed to the Google Groups "pg_rman" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pg_rman+u...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.



Dave Greco

unread,
May 25, 2013, 11:45:26 PM5/25/13
to pg_...@googlegroups.com
Think I got it thanks. Copy any unarchived xlogs into the archive dir. The key is that pg_rman by default sets the recovery timeline to its last backup, so just have to modify it to be the latest timeline.


Reply all
Reply to author
Forward
0 new messages