MySQL:备份及恢复理论



备份类型理论介绍

物理备份

物理备份是包含数据库目录和文件的raw copies,这种备份方式适合大型的、重要的并且需要在问题发生时快速恢复的数据库。

特点

逻辑备份

逻辑备份保存数据库逻辑结构的信息(CREATE DATABASE, CREATE TABLE)和内容改变信息(INSERT语句或delimited-text文件),这种备份适合小型的你可能要重建数据表结构或重建数据的数据库,并把他部署到另一个不同的机器上。

特点

PS: 相关 热备份 versus 冷备份、本地备份 versus 远程备份等 https://dev.mysql.com/doc/refman/5.5/en/backup-types.html

本次研究重点

完整备份 Versus 增量备份

区别:

增量备份的条件

Incremental backups are made possible by enabling the server’s binary log, which the server uses to record data changes.

完整恢复 Versus Point-in-Time (增量) 恢复

A full recovery restores all data from a full backup. This restores the server instance to the state that it had when the backup was made. If that state is not sufficiently current, a full recovery can be followed by recovery of incremental backups made since the full backup, to bring the server to a more up-to-date state.

Incremental recovery is recovery of changes made during a given time span. This is also called point-in-time recovery because it makes a server’s state current up to a given time. Point-in-time recovery is based on the binary log and typically follows a full recovery from the backup files that restores the server to its state when the backup was made. Then the data changes written in the binary log files are applied as incremental recovery to redo data modifications and bring the server up to the desired point in time.