标签:数据恢复 执行sql 线程 file tab 插入 nod 多线程 替代
问题:备份和冗余有什么区别?
备份是什么?
databases Binlog my.cnf /data/xxx(数据目录)
备份数据库,还有日志文件,还有配置文件,尽可能将数据目录里面的文件全部备份。
备份过程中必须考虑因素:
逻辑备份就是在不停业务的情况下进行备份。
备份的是建表、建库、插入等操作所执行SQL语句(DDL DML DCL),适用于中小型数据库,效率相对较低。
(一般在数据库正常提供服务的前提下进行的);如:mysqldump、mydumper、 into outfile(表的导出导入)等
直接复制数据库文件,适用于大型数据库环境,不受存储引擎的限制,但不能恢复到不同的MySQL版本。
(一般在数据库彻底关闭或者不能完成正常提供服务的前提下进行的备份);如:tar、cp、xtrabackup、lvm snapshot等
在线热备:AB复制(在线实时)(指的是对数据的冗余)
M-S
M-Sn
M-S1-S2
M-M-Sn
Xtrabackup是一个对InnoDB做数据备份的工具,支持在线热备份(备份时不影响数据读写),是商业备份工具InnoDB Hotbackup的一个很好的替代品
Xtrabackup有两个主要的工具:xtrabackup、innobackupex
mydumper 多线程备份工具
https://launchpad.net/mydumper/mydumper-0.9.1.tar.gz 2015-11-06(最后更新时间)
• Sunday
An incremental level 0 backup backs up all blocks that have ever been in use in this database.
• Monday through Saturday
On each day from Monday through Saturday, a differential incremental level 1 backup backs up all blocks that have changed since the most recent incremental backup at level 1 or 0. The Monday backup copies blocks changed since Sunday level 0 backup, the Tuesday backup copies blocks changed since the Monday level 1 backup, and so forth.
• Sunday
An incremental level 0 backup backs up all blocks that have ever been in use in this database.
• Monday - Saturday
A cumulative incremental level 1 backup copies all blocks changed since the most recent level 0 backup. Because the most recent level 0 backup was created on Sunday, the level 1 backup on each day Monday through Saturday backs up all blocks changed since the Sunday backup.
需要掌握的备份方法:
逻辑数据的导入导出(into outfile)、mysqldump、mysqlhotcopy、xtrabackup和innobackupex
lvm-snapshot、mysqlbackup
标签:数据恢复 执行sql 线程 file tab 插入 nod 多线程 替代
原文地址:https://www.cnblogs.com/yanjieli/p/9803200.html