MLUG: RE: [MLUG] backup
RE: [MLUG] backup
Email address obfuscation in effect -- please click here to turn it off.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

On Wed, 14 May 2003, Mike Miller wrote:

> Just curious -- does it cause a problem to use a "tar | gzip" approach
> when the files being backed up are being written to by other processes?
> It seems to me that it wouldn't really mess up the backup, but I'm not
> sure.  You'd have some incomplete data, but is that worse than blocking
> out the world and having none of that data?

Well, real database administrators are not like most people; they are
paranoid so that we might feel well-adjusted, and diligent so we might
feel lazy and carefree. :-)  One of the major points of an
industrial-strength database is that you design things such that you
*never* have to worry about the database or any of its back-ups being
captured in an inconsistent or otherwise corrupt state.  This is why
transactions must be atomic, why you must be able guarantee that nobody
else is writing what you're writing, reading what you're writing, etc.

Backing up something like this is a bit trickier than you'd think.  
(Obviously, if nothing is happening, then filesystem utilities work.)  
So a utility like pg_dump or pg_dumpall doesn't actually do things through 
the filesystem, but instead queries the (running) database to construct
a script that, when run, would recreate the database (I think up to and 
including pending transactions in some cases).  The point is, from the 
outside, you don't know that there's a MondoTransaction not yet written 
out to disk when you do your cp or tar, but the database itself knows 
this, and you can get that information out, too.

Perhaps that's overkill in some situations, but you can do it.

jking

_______________________________________________
members mailing list
EMAIL:PROTECTED
http://mlug.missouri.edu/mailman/listinfo/members