Skip site navigation (1) Skip section navigation (2)

WAL file questions - how to relocate on Windows, how to replay after total loss, etc

From: "John T(dot) Dow" <john(at)johntdow(dot)com>
To: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: WAL file questions - how to relocate on Windows, how to replay after total loss, etc
Date: 2008-08-28 14:57:40
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general

Recently I had some questions about doing backups and received very helpful replies. I have now put together a BAT file to do a routine backup, using pg_dumpall with the -g option to get the roles, and pg_dump with the custom format to get all the data.

I am now testing this process to make sure it is possible to recover data up to the last minute in the event of a catastrophic server failure.

I should mention that I'm running PostgreSQL 8.2 on a Windows computer (Win2K for testing) and that I am developing and testing this procedure because I do software development for clients using PG at my recommendation. They are small companies who don't use Unix. In fact, the PG server is likely to be one of the office workstations.

To test, I ran my backup procedure, added a row to a table, then pressed reset on the workstation/server to simulate the catastrophe.

When the computer booted, the server started automatically, so I shut it down. I then renamed the data folder to simulate complete loss of the computer, and I created a new cluster and database and did a restore of the roles and then the data. (My data had an invalid UTF8 character so, thanks to help given here, I extracted that table to plain text, ran iconv on it, and loaded the problem table.)

So now I have everything back except that row I added after doing the backup.


How to replay WAL files: Now that I have a freshly created and reloaded database, how do I replay the WAL files from the pretend crashed server, now in a renamed folder? I understand I create a recover.conf file and restart the server. But I don't understand the process. I am to put a copy command in the file to copy wal files from the renamed folder, but how does the server know what files to copy? Is something else needed in the recover.conf file? By the way, when I restarted the server, the file was renamed to recover.done but the missing row didn't appear.

On Windows, is it possible to relocate the wal files to another hard drive?

Does pg_dump do a checkpoint?

How do I make sure the wal files are not discarded before another backup is done?

How to release wal files after the backup is done?

The first two questions I could find no answer to. The others I admit I haven't researched very long as I was more interested in the first question.




pgsql-general by date

Next:From: Gregory StarkDate: 2008-08-28 14:57:58
Subject: Re: indexes on functions and create or replace function
Previous:From: Joao Ferreira gmailDate: 2008-08-28 14:47:23
Subject: Re: Vaccuum best practice: cronjob or autovaccuum?

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group