Databases Reference
In-Depth Information
Other uses and alternatives
You can use snapshots for more than just backups. For example, as mentioned previ-
ously, they can be a useful way to take a “checkpoint” just before a potentially dan-
gerous action. Some systems let you promote the snapshot to the original filesystem.
This makes it easy to roll back to the point at which you took the snapshot.
Filesystem snapshots aren't the only way to get an instantaneous copy of your data,
either. Another option is a RAID split : if you have a three-disk software RAID mirror,
for example, you can remove one disk from the mirror and mount it separately. There's
no copy-on-write penalty, and it's easy to promote this kind of “snapshot” to be the
master copy if necessary. After adding the disk back to the RAID set, however, it will
have to be resynced. There's no free lunch, sadly.
Recovering from a Backup
How you recover your data depends on how you backed it up. You might need to take
some or all of the following steps:
• Stop the MySQL server.
• Take notes on the server's configuration and file permissions.
• Move the data from the backup into the MySQL data directory.
• Make configuration changes.
• Change file permissions.
• Restart the server with limited access, and wait for it to start fully.
• Reload logical backup files.
• Examine and replay binary logs.
• Verify what you've restored.
• Restart the server with full access.
We demonstrate how to do each of these steps as needed in the following sections. We
also add notes specific to certain backup methods or tools in sections about those
methods or tools later in this chapter.
If there's a chance you'll need the current versions of your files, don't
replace them with the files from the backup . For example, if your backup
includes the binary logs, and you need to replay binary logs for point-
in-time recovery, don't overwrite the current binary logs with older
copies from the backup. Rename them or move them elsewhere if
necessary.
During recovery, it's often important to make MySQL inaccessible to everything except
the recovery process. We like to start MySQL with the --skip-networking and --socket=/
 
Search WWH ::




Custom Search