Richard's Diary

Sunday, December 14, 2008

Recovery worked! file:///usr/share/doc/packages/postgresql/html/continuous-archiving.html#BACKUP-PITR-RECOVERY
Followed instructions noting "Normally, recovery will proceed through all available WAL segments, thereby restoring the database to the current point in time (or as close as we can get given the available WAL segments). So a normal recovery will end with a "file not found" message, the exact text of the error message depending upon your choice of restore_command . You may also see an error message at the start of recovery for a file named something like 00000001.history"

2008-12-14 17:03:18 PST LOG: database system was interrupted; last known up at 2008-12-13 21:54:27 PST
2008-12-14 17:03:18 PST LOG: starting archive recovery
2008-12-14 17:03:18 PST LOG: restore_command = 'cp /var/log/postgresqlwal/%f %p'
2008-12-14 17:03:18 PST LOG: log_restartpoints = true
cp: cannot stat `/var/log/postgresqlwal/00000001.history': No such file or directory
2008-12-14 17:03:18 PST LOG: restored log file "000000010000000000000000.008A9E00.backup" from archive
2008-12-14 17:03:18 PST LOG: restored log file "000000010000000000000000" from archive
2008-12-14 17:03:18 PST LOG: automatic recovery in progress
2008-12-14 17:03:19 PST LOG: redo starts at 0/8A9E48
cp: cannot stat `/var/log/postgresqlwal/000000010000000000000001': No such file or directory
2008-12-14 17:03:19 PST LOG: record with zero length at 0/10000B0
2008-12-14 17:03:19 PST LOG: redo done at 0/1000068
2008-12-14 17:03:19 PST LOG: last completed transaction was at log time 2008-12-13 21:49:49.597163-08
cp: cannot stat `/var/log/postgresqlwal/000000010000000000000001': No such file or directory
cp: cannot stat `/var/log/postgresqlwal/00000002.history': No such file or directory
2008-12-14 17:03:19 PST LOG: selected new timeline ID: 2
cp: cannot stat `/var/log/postgresqlwal/00000001.history': No such file or directory
2008-12-14 17:03:19 PST LOG: archive recovery complete
2008-12-14 17:03:19 PST LOG: checkpoint starting: shutdown immediate
2008-12-14 17:03:19 PST LOG: checkpoint complete: wrote 3 buffers (0.1%); 0 transaction log file(s) added, 0 removed, 0 recycled; write=0.000 s, sync=0.00
1 s, total=0.006 s
2008-12-14 17:03:19 PST LOG: autovacuum launcher started
2008-12-14 17:03:19 PST LOG: database system is ready to accept connections

I checked that phrase I added during backup showed up in recovery and that I was able to add a new phrase, which means that normal database operations resumed perfectly after the restore.

© 2010 Picky Ricky, Inc. originalblog