On Mon, Jun 20, 2005 at 09:15:53AM -0400, Dragan Cvetkovic wrote:
> Andy Smith <[EMAIL PROTECTED]> writes:
> 
> >> Such will be the case when backing up RDBMS dumps and log files.
> >
> > I like LVM snapshots for this purpose.
> >
> > For MySQL in particular you can also run replication to a slave for
> > backup purposes, but I like the LVM snapshot approach as it works
> > for anything.
> 
> Yes, but if you restore that particular snapshot (after your disk crash or
> onto a different machine), it doesn't necessarily mean that MySQL would
> know what to do with it?

Yes, sort of.  Without MySQL's involvement there is no way to be
certain that it isn't half way through a transaction when the
snapshot would take place.

However, it's not as bad as all that.  The most you would lose is
the transactions that were in progress and not know, on restore,
whether they had taken place or not.  There is some theoretical
possiblity of the database structure not being recoverable.  Of
course, that may well not be acceptable.

> Yoou need to bring your DB to some consistent state (some
> checkpoint or similar) before creating a snapshot that you want to
> backup (and restore meaningfully afterwards).

If you want to be sure to never lose any transaction then you need
to do a proper database backup that issues a lock first (so that it
has exclusive use of the DB).

You also have to be using the right table types and be writing your
application to support this, though.  Most of the time you aren't,
so it doesn't really matter.  If you are, then you're probably
already aware of the issues.

Attachment: signature.asc
Description: Digital signature

Reply via email to