pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hunter Matthews <thm@duke.edu>
To: Nguyen, Dan <danguyen@lsil.com>
Cc: pgsql-admin@postgresql.org
Subject: Re: newbie psql - Backup/Restore - database
Date: 24 Oct 2002 15:05:47 -0400
Message-ID: <1035486347.1253.28.camel@jade.biology.duke.edu> (raw)
In-Reply-To: <EB1DF7EA0D32D611B79C0002A51363F17004F2@exw-ks.ks.lsil.com>
References: <EB1DF7EA0D32D611B79C0002A51363F17004F2@exw-ks.ks.lsil.com>

In my particular enviroment, fast backups were more important than 24
hour operation. I do the following.

1. rsync the raw database files to another directory.
   Note that this is DIRTY, the database is still operational. However, 
   it gets about 95% of the data, WHILE the database is online.

2. Down the database

3. rsync again. Because  we got most of the data the first time, we're 
   averaging about 10-15 seconds here.

4. start the database back up.

Total downtime per night over the last two weeks seems to be about 30
seconds. Which, for us, is nearly perfect.


On Mon, 2002-10-21 at 14:39, Nguyen, Dan wrote:
> Hello all,
> 
> I just convert a MSQL database to PSQL and wondering if someone can help me
> to duplicate or restore a database in a short period.  Here is what I have
> done.
> 
> Backup <users> database:
>    pg_dump -C -D -n -f backupDB.psql users
> 
> Duplicate <users> database:
>    1. createdb test
>    2. edit the backupDB.psql file and remove the first block regarding users
> DATABASE
>    3. psql -a -e -f backupDB.psql test
> 
> 
> Doing this way will take about a hour to duplicate a database with about
> 50,000 records.  Is there any other ways that you can help me to speed up
> the process?
> 
> All of your help will be greatly appreciated.
> 
> Dan   
-- 
Hunter Matthews                          Unix / Network Administrator
Office: BioScience 145/244               Duke Univ. Biology Department
Key: F0F88438 / FFB5 34C0 B350 99A4 BB02  9779 A5DB 8B09 F0F8 8438
Never take candy from strangers. Especially on the internet.




view thread (3+ messages)

Message-ID: <1035486347.1253.28.camel@jade.biology.duke.edu>
Permalink:  ../1035486347.1253.28.camel@jade.biology.duke.edu/
Also on:    postgresql.org/message-id/1035486347.1253.28.camel@jade.biology.duke.edu

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-admin@postgresql.org
  Cc: thm@duke.edu, danguyen@lsil.com
  Subject: Re: newbie psql - Backup/Restore - database
  In-Reply-To: <1035486347.1253.28.camel@jade.biology.duke.edu>
  References: <EB1DF7EA0D32D611B79C0002A51363F17004F2@exw-ks.ks.lsil.com> <1035486347.1253.28.camel@jade.biology.duke.edu>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox