Обсуждение: Copy the database..

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

Copy the database..

От
Abandoned
Дата:
Hi..
I want to copy my database..
I have a database which is name db01 and i want to copy it as name
db01copy ?
How can i do this ?
This database is very big 200GB so i want to the fastest way. Also if
you suggest pg_dump how can i remove the dump data after copying ?
Note: I have a root account with ssh if it is necessary i use ssh.
I'm sorry for my bad english.
Kind regards...


Re: Copy the database..

От
Sascha Bohnenkamp
Дата:
if you dump/undump using a pipe there is no temp file ...

Abandoned schrieb:
> On Nov 2, 3:49 pm, Sascha Bohnenkamp <asbohnenk...@gmx.de> wrote:
>> maybe pg_dump | pg_undump could work?
>>
>> I mean pg_dump with the appropriate parameters and undump directly to
>> the other database?
>>
>> This may one of the fastest ways to do it I think.
>>
>> Abandoned schrieb:
>>
>>> Hi..
>>> I want to copy my database..
>>> I have a database which is name db01 and i want to copy it as name
>>> db01copy ?
>>> How can i do this ?
>>> This database is very big 200GB so i want to the fastest way. Also if
>>> you suggest pg_dump how can i remove the dump data after copying ?
>>> Note: I have a root account with ssh if it is necessary i use ssh.
>>> I'm sorry for my bad english.
>>> Kind regards...
>
> Thank you..
> Are there any way to copy database without dump or any temp files ?
> (If there is a temp my harddisk not enough for this operation :(  )
>

Re: Copy the database..

От
Sascha Bohnenkamp
Дата:
maybe pg_dump | pg_undump could work?

I mean pg_dump with the appropriate parameters and undump directly to
the other database?

This may one of the fastest ways to do it I think.


Abandoned schrieb:
> Hi..
> I want to copy my database..
> I have a database which is name db01 and i want to copy it as name
> db01copy ?
> How can i do this ?
> This database is very big 200GB so i want to the fastest way. Also if
> you suggest pg_dump how can i remove the dump data after copying ?
> Note: I have a root account with ssh if it is necessary i use ssh.
> I'm sorry for my bad english.
> Kind regards...
>

Re: Copy the database..

От
Abandoned
Дата:
On Nov 2, 3:49 pm, Sascha Bohnenkamp <asbohnenk...@gmx.de> wrote:
> maybe pg_dump | pg_undump could work?
>
> I mean pg_dump with the appropriate parameters and undump directly to
> the other database?
>
> This may one of the fastest ways to do it I think.
>
> Abandoned schrieb:
>
> > Hi..
> > I want to copy my database..
> > I have a database which is name db01 and i want to copy it as name
> > db01copy ?
> > How can i do this ?
> > This database is very big 200GB so i want to the fastest way. Also if
> > you suggest pg_dump how can i remove the dump data after copying ?
> > Note: I have a root account with ssh if it is necessary i use ssh.
> > I'm sorry for my bad english.
> > Kind regards...

Thank you..
Are there any way to copy database without dump or any temp files ?
(If there is a temp my harddisk not enough for this operation :(  )


Re: Copy the database..

От
Abandoned
Дата:
On Nov 2, 5:30 pm, Sascha Bohnenkamp <asbohnenk...@gmx.de> wrote:
> if you dump/undump using a pipe there is no temp file ...
>
> Abandoned schrieb:
>
>
>
> > On Nov 2, 3:49 pm, Sascha Bohnenkamp <asbohnenk...@gmx.de> wrote:
> >> maybe pg_dump | pg_undump could work?
>
> >> I mean pg_dump with the appropriate parameters and undump directly to
> >> the other database?
>
> >> This may one of the fastest ways to do it I think.
>
> >> Abandoned schrieb:
>
> >>> Hi..
> >>> I want to copy my database..
> >>> I have a database which is name db01 and i want to copy it as name
> >>> db01copy ?
> >>> How can i do this ?
> >>> This database is very big 200GB so i want to the fastest way. Also if
> >>> you suggest pg_dump how can i remove the dump data after copying ?
> >>> Note: I have a root account with ssh if it is necessary i use ssh.
> >>> I'm sorry for my bad english.
> >>> Kind regards...
>
> > Thank you..
> > Are there any way to copy database without dump or any temp files ?
> > (If there is a temp my harddisk not enough for this operation :(  )- Hide quoted text -
>
> - Show quoted text -

I tryed pg_dump but it is very slowly. Are there any faster way to
copy database?


Re: Copy the database..

От
Martijn van Oosterhout
Дата:
On Sat, Nov 03, 2007 at 01:42:09PM -0000, Abandoned wrote:
> I tryed pg_dump but it is very slowly. Are there any faster way to
> copy database?

Have you tried CREATE DATABASE .. TEMPLATE ? (See amual for syntax)

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Those who make peaceful revolution impossible will make violent revolution inevitable.
>  -- John F Kennedy

Вложения

Re: Copy the database..

От
"Scott Marlowe"
Дата:
On 11/3/07, Abandoned <besturk@gmail.com> wrote:
>
> I tryed pg_dump but it is very slowly. Are there any faster way to
> copy database?

Assuming it's all happening on the same db server, yes:

psql template1
create database newdb template olddb