pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
newbie psql - Backup/Restore - database
3+ messages / 3 participants
[nested] [flat]

* newbie psql - Backup/Restore - database
@ 2002-10-21 18:39  Nguyen, Dan <danguyen@lsil.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Nguyen, Dan @ 2002-10-21 18:39 UTC (permalink / raw)
  To: pgsql-admin

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   

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: newbie psql - Backup/Restore - database
@ 2002-10-23 13:11  Stephan Szabo <sszabo@megazone23.bigpanda.com>
  parent: Nguyen, Dan <danguyen@lsil.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Stephan Szabo @ 2002-10-23 13:11 UTC (permalink / raw)
  To: Nguyen, Dan <danguyen@lsil.com>; +Cc: pgsql-admin

On Mon, 21 Oct 2002, 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?

Not using -D to pg_dump will probably help since that'll use copy rather
than insert.





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: newbie psql - Backup/Restore - database
@ 2002-10-24 19:05  Hunter Matthews <thm@duke.edu>
  parent: Nguyen, Dan <danguyen@lsil.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Hunter Matthews @ 2002-10-24 19:05 UTC (permalink / raw)
  To: Nguyen, Dan <danguyen@lsil.com>; +Cc: pgsql-admin

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.




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2002-10-24 19:05 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-10-21 18:39 newbie psql - Backup/Restore - database Nguyen, Dan <danguyen@lsil.com>
2002-10-23 13:11 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>
2002-10-24 19:05 ` Hunter Matthews <thm@duke.edu>

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