Обсуждение: how to replicate database

Поиск
Список
Период
Сортировка

how to replicate database

От
Caroline Yong
Дата:
Is there a way to replicate one-off(a copy of
duplicate) of an existing Postgres database.

regards,
caroline


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

Re: how to replicate database

От
Oliver Elphick
Дата:
On Thu, 2003-09-11 at 09:15, Caroline Yong wrote:
> Is there a way to replicate one-off(a copy of
> duplicate) of an existing Postgres database.

pg_dump mydatabase > some_file

move some_file to another machine (or to duplicate the database on the
same server, use a new database name below)

createdb mydatabase
psql -d mydatabase < some_file

--
Oliver Elphick                                Oliver.Elphick@lfix.co.uk
Isle of Wight, UK                             http://www.lfix.co.uk/oliver
GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A 614D 4C34 3E1D 0C1C
                 ========================================
     "I am crucified with Christ; nevertheless I live; yet
      not I, but Christ liveth in me; and the life which I
      now live in the flesh I live by the faith of the Son
      of God, who loved me, and gave himself for me."
                                         Galatians 2:20


Re: how to replicate database

От
Caroline Yong
Дата:
i am having problem of running pg_dump. i am using
winXP home here. postgreSQL requested me to re-install
the application again as can't found cygz.dll file.

do u have any idea?

--- Oliver Elphick <olly@lfix.co.uk> wrote:
> On Thu, 2003-09-11 at 09:15, Caroline Yong wrote:
> > Is there a way to replicate one-off(a copy of
> > duplicate) of an existing Postgres database.
>
> pg_dump mydatabase > some_file
>
> move some_file to another machine (or to duplicate
> the database on the
> same server, use a new database name below)
>
> createdb mydatabase
> psql -d mydatabase < some_file
>
> --
> Oliver Elphick
> Oliver.Elphick@lfix.co.uk
> Isle of Wight, UK
> http://www.lfix.co.uk/oliver
> GPG: 1024D/3E1D0C1C: CA12 09E0 E8D5 8870 5839  932A
> 614D 4C34 3E1D 0C1C
>
> ========================================
>      "I am crucified with Christ; nevertheless I
> live; yet
>       not I, but Christ liveth in me; and the life
> which I
>       now live in the flesh I live by the faith of
> the Son
>       of God, who loved me, and gave himself for
> me."
>                                          Galatians
> 2:20
>


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

Re: how to replicate database

От
"Nigel J. Andrews"
Дата:
On Thu, 11 Sep 2003, Caroline Yong wrote:

> Is there a way to replicate one-off(a copy of
> duplicate) of an existing Postgres database.
>
> regards,
> caroline

There's obviously the pg_dump utility (or pg_dumpall which also gets all the
global info like db users). You could also try:

    createdb -T old-db new-db

as an interesting exercise, if you just want another copy in the same
cluster. I've not done that myself but I don't see why it wouldn't work,
someone else might know differently.

--
Nigel Andrews



Re: how to replicate database

От
"Duffey, Kevin"
Дата:
Is there any way to have a fairly accurate replication going on, such as once every hour to a backup db that if the
maindb server or app died, the backup would take over and be fairly accurate? 


---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.501 / Virus Database: 299 - Release Date: 7/14/2003



***************************************************************************
"The information contained in this e-mail message  may be confidential and
protected from disclosure.  If you are not the intended recipient, any
dissemination, distribution or copying is strictly prohibited.  If you think
that you have received this e-mail message in error, please e-mail the
sender at exadmins@marketron.com."
***************************************************************************

Re: how to replicate database

От
Andrew Sullivan
Дата:
On Thu, Sep 11, 2003 at 11:36:24AM -0700, Duffey, Kevin wrote:
> Is there any way to have a fairly accurate replication going on,
> such as once every hour to a backup db that if the main db server
> or app died, the backup would take over and be fairly accurate?

There are several such "async" replication projects.  See
dbmirror, rserv, erserver for examples.

A

--
----
Andrew Sullivan                         204-4141 Yonge Street
Liberty RMS                           Toronto, Ontario Canada
<andrew@libertyrms.info>                              M2P 2A8
                                         +1 416 646 3304 x110