Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Could we use LVM snapshots to backup database servers? Or we can only use it for file system backups?

share|improve this question
    
You can do it when you prepare the state of the DB before the "freeze" (see answers below) - I just want to add that the LVM snapshot should not be your only backup then because there is some more work involved when going to restore the data back. –  initall Apr 5 '11 at 9:12

2 Answers 2

up vote 1 down vote accepted

In my experience, yes. The essence of the process is getting the database into a position where the on-disc contents are self-consistent and from which the database could easily recover, if not simply continue, and to use the snapshot facility to "freeze" that image for backup whilst in fact allowing the database to return to normal operation.

With an Oracle / NetApp combination of database and file server, if memory serves, this involves putting the Oracle tables into hot-backup state before taking a WAFL snapshot; other DB/FS combinations will have their own nomenclature, but the underlying principle is the same.

Once the database is in its stable on-disc image position, take the snapshot, and release the database from this constrained state. Then the file system's snapshot facility can be used to roll the "frozen" on-disc image to tape or other backup medium in a leisurely manner, with the snapshot being released once the roll-off is completed.

share|improve this answer

Yes, for MySQL use or look at mylvmbackup.

I use it as part of my backup procedure. I also run Master - Master Replication and mylvmbackup makes fixing replication a pleasure.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.