Databases Reference
In-Depth Information
to be hot backups. We try to avoid these terms and instead tell you how much a specific
technique or tool interrupts your server.
Two other confusing words are restore and recover . We use them in specific ways in
this chapter. Restoring means retrieving data from a backup and either loading it into
MySQL or placing the files where MySQL expects them to be. Recovery generally means
the entire process of rescuing a system, or part of a system, after something has gone
wrong. This includes restoring data from backups as well as all the steps necessary to
make a server fully functional again, such as restarting MySQL, changing the configu-
ration, warming up the server's caches, and so on.
To many people, recovery just means fixing corrupted tables after a crash. This is not
the same as recovering an entire server. A storage engine's crash recovery reconciles its
data and log files. It makes sure the data files contain only the modifications made by
committed transactions, and it replays transactions from the log files that have not yet
been applied to the data files. This might be part of the overall recovery process, or
even part of making backups. However, it's not the same as the recovery you might
need to do after an accidental DROP TABLE , for example.
Why Backups?
Here are a few reasons that backups are important:
Disaster recovery
Disaster recovery is what you do when hardware fails, a nasty bug corrupts your
data, or your server and its data become unavailable or unusable for some other
reason. You need to be ready for everything from someone accidentally connecting
to the wrong server doing an ALTER TABLE , 1 to the building burning down, to a
malicious attacker or a MySQL bug. Although the odds of any particular disaster
striking are fairly low, taken together they add up.
People changing their minds
You'd be surprised how often people intentionally delete data and then want it
back.
Auditing
Sometimes you need to know what your data or schema looked like at some point
in the past. You might be involved in a lawsuit, for example, or you might discover
a bug in your application and need to see what the code used to do (sometimes
just having your code in version control isn't enough).
1. Baron still remembers his first job after college, where he dropped two columns from the production
server's invoice table at an ecommerce site.
 
Search WWH ::




Custom Search