dbTalk Databases Forums  

lock entire database

comp.databases.postgresql.novice comp.databases.postgresql.novice


Discuss lock entire database in the comp.databases.postgresql.novice forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Tom Lane
 
Posts: n/a

Default Re: lock entire database - 08-10-2004 , 01:01 PM






Benjamin <benjamin (AT) netyantra (DOT) com> writes:
Quote:
My idea was to lock the db on A, scp the required files onto B and then
unlock db on A.
The only adequate "lock" for that sort of thing is to shut down the
postmaster on A. Anything less is simply not trustworthy.

There is support coming up in 8.0 for WAL archiving and point-in-time
recovery. With that, you could do the scp without any lock and then
fix up discrepancies by replaying the WAL archives for the interval that
the scp was running. Furthermore you could continue to ship WAL
segments to B to keep it up to date with A, without needing repeated
full scp's. See
http://developer.postgresql.org/docs...es/backup.html
for some preliminary documentation about this.

Slony looks like a pretty good alternative too, and it's available now.
But don't bother trying to roll your own replication setup. It's
unlikely that you can easily build a reliable one.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly



Reply With Quote
  #12  
Old   
Oliver Fromme
 
Posts: n/a

Default Re: lock entire database - 08-10-2004 , 02:04 PM







Benjamin wrote:
Quote:
Machine A is the Primary, and Machine B is the backup for A.
When B is booting up, it has to duplicate the entire pgsql db from A.
As Ron said, cud do with a pg_dump. But, i guess, pg_dump takes quite
some time. As A is already up, it wud be unwise to lock the db for so
long. Also, even if i do go ahead with pg_dump, and then do a pg_restore
on B, by the time data is being pg_restore'ed on B, a query cud modify/
update the db on A.
My idea was to lock the db on A, scp the required files onto B and then
unlock db on A.
If I understand you correctly, "Slony" will do exactly what you
want, without the need to lock any DB: http://www.slony.org
Slony 1.0 has been released recently, which was mentioned
prominently on PostgreSQL's homepage. It's a master-slave
replication system.

Hope that helps.

Best regards
Oliver

--
Oliver Fromme, secnetix GmbH & Co KG, Oettingenstr. 2, 80538 München
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.

"UNIX was not designed to stop you from doing stupid things,
because that would also stop you from doing clever things."
-- Doug Gwyn

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html



Reply With Quote
  #13  
Old   
Benjamin
 
Posts: n/a

Default Re: lock entire database - 08-11-2004 , 01:50 AM



Oliver Fromme wrote:

Quote:
Benjamin wrote:
Machine A is the Primary, and Machine B is the backup for A.
When B is booting up, it has to duplicate the entire pgsql db from A.
As Ron said, cud do with a pg_dump. But, i guess, pg_dump takes quite
some time. As A is already up, it wud be unwise to lock the db for so
long. Also, even if i do go ahead with pg_dump, and then do a pg_restore
on B, by the time data is being pg_restore'ed on B, a query cud modify/
update the db on A.
My idea was to lock the db on A, scp the required files onto B and then
unlock db on A.

If I understand you correctly, "Slony" will do exactly what you
want, without the need to lock any DB: http://www.slony.org
Slony 1.0 has been released recently, which was mentioned
prominently on PostgreSQL's homepage. It's a master-slave
replication system.

Hope that helps.

Best regards
Oliver

Thanx everyone.
Yea.. slony seems to be good. We just might HAVE to use that in the near
future.
But as of now, we r shutting down pgsql on A, while the duplication is
being done, as Tom suggested.


--

Benjamin Jacob.

Disclaimer :
------------------------------------------------------------------------------
If you are not the intended recipient of this transmission to whom it is
addressed, or have received this transmission in error, you are hereby
notified that any dissemination, distribution or copying of this transmission
is strictly prohibited. Please notify us immediately and delete this e-mail
from your system. The sender does not accept liability for any errors or
omissions in the contents of this message which arise as a result of e-mail
transmission, which cannot be guaranteed to be secure or error-free as
information could be intercepted, corrupted, lost, destroyed, arrive late or
incomplete, arrive at wrong address or contain viruses. If verification
is required please request a hard-copy version. This e-mail contains only the
personal opinions of the sender and does not represent an official
communication from NetYantra of any manner.
------------------------------------------------------------------------------




---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.