Percona XtraBackup 2.4 xtrabackup全量、增量备份恢复流程
短信预约 -IT技能 免费直播动态提醒
xtrabackup常用参数
--backup 创建备份并将备份存放到--target-dir目录
--defaults-file=[MY.CNF] 配置文件的路径
--target-dir=DIRECTORY 指定备份存放的路径。如果目录不存在,xtrabackup会创建相应的目录
--user 备份账户的用户名
--password 备份账户的密码
--datadir=DIRECTORY 数据目录的路径
--copy-back 将之前做的备份拷贝回他们的起始目录
--xtrabackup全量备份
[root@localhost ~]# /install/percona/percona-xtrabackup-2.4.2-Linux-x86_64/bin/xtrabackup --defaults-file=/etc/my.cnf --backup --datadir=/var/lib/mysql/ --target-dir=/backup/20160722 --user root
--password 'System#2013'
.....
160721 20:30:13 [01] Copying ./mysql/user.frm to /backup/20160722/mysql/user.frm
160721 20:30:13 [01] ...done
160721 20:30:14 [01] Copying ./mysql/proxies_priv.frm to /backup/20160722/mysql/proxies_priv.frm
160721 20:30:14 [01] ...done
160721 20:30:14 [01] Copying ./mysql/proc.MYD to /backup/20160722/mysql/proc.MYD
160721 20:30:14 [01] ...done
160721 20:30:14 [01] Copying ./mysql/help_relation.frm to /backup/20160722/mysql/help_relation.frm
160721 20:30:14 [01] ...done
160721 20:30:14 Finished backing up non-InnoDB tables and files
160721 20:30:14 [00] Writing xtrabackup_binlog_info
160721 20:30:14 [00] ...done
160721 20:30:14 Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS...
xtrabackup: The latest check point (for incremental): '186651619'
xtrabackup: Stopping log copying thread.
.160721 20:30:14 >> log scanned up to (186651628)
160721 20:30:14 Executing UNLOCK TABLES
160721 20:30:14 All tables unlocked
160721 20:30:14 [00] Copying ib_buffer_pool to /backup/20160722/ib_buffer_pool
160721 20:30:14 [00] ...done
160721 20:30:14 Backup created in directory '/backup/20160722'
MySQL binlog position: filename 'production-bin.000002', position '194', GTID of the last change '026dc034-4dc2-11e6-a9cb-000c29631605:1-17,
cf291e84-2c89-11e6-b6f0-000c29631605:1-44'
160721 20:30:14 [00] Writing backup-my.cnf
160721 20:30:14 [00] ...done
160721 20:30:14 [00] Writing xtrabackup_info
160721 20:30:14 [00] ...done
xtrabackup: Transaction log of lsn (186651619) to (186651628) was copied.
160721 20:30:14 completed OK!
--xtrabackup全量恢复
-删除myisam表
mysql> show create table fire.t10\G
*************************** 1. row ***************************
Table: t10
Create Table: CREATE TABLE `t10` (
`f1` int(11) DEFAULT NULL,
`gc` int(11) GENERATED ALWAYS AS ((`f1` + 1)) STORED,
KEY `gc` (`gc`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1 row in set (0.00 sec)
--backup 创建备份并将备份存放到--target-dir目录
--defaults-file=[MY.CNF] 配置文件的路径
--target-dir=DIRECTORY 指定备份存放的路径。如果目录不存在,xtrabackup会创建相应的目录
--user 备份账户的用户名
--password 备份账户的密码
--datadir=DIRECTORY 数据目录的路径
--copy-back 将之前做的备份拷贝回他们的起始目录
--xtrabackup全量备份
[root@localhost ~]# /install/percona/percona-xtrabackup-2.4.2-Linux-x86_64/bin/xtrabackup --defaults-file=/etc/my.cnf --backup --datadir=/var/lib/mysql/ --target-dir=/backup/20160722 --user root
--password 'System#2013'
.....
160721 20:30:13 [01] Copying ./mysql/user.frm to /backup/20160722/mysql/user.frm
160721 20:30:13 [01] ...done
160721 20:30:14 [01] Copying ./mysql/proxies_priv.frm to /backup/20160722/mysql/proxies_priv.frm
160721 20:30:14 [01] ...done
160721 20:30:14 [01] Copying ./mysql/proc.MYD to /backup/20160722/mysql/proc.MYD
160721 20:30:14 [01] ...done
160721 20:30:14 [01] Copying ./mysql/help_relation.frm to /backup/20160722/mysql/help_relation.frm
160721 20:30:14 [01] ...done
160721 20:30:14 Finished backing up non-InnoDB tables and files
160721 20:30:14 [00] Writing xtrabackup_binlog_info
160721 20:30:14 [00] ...done
160721 20:30:14 Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS...
xtrabackup: The latest check point (for incremental): '186651619'
xtrabackup: Stopping log copying thread.
.160721 20:30:14 >> log scanned up to (186651628)
160721 20:30:14 Executing UNLOCK TABLES
160721 20:30:14 All tables unlocked
160721 20:30:14 [00] Copying ib_buffer_pool to /backup/20160722/ib_buffer_pool
160721 20:30:14 [00] ...done
160721 20:30:14 Backup created in directory '/backup/20160722'
MySQL binlog position: filename 'production-bin.000002', position '194', GTID of the last change '026dc034-4dc2-11e6-a9cb-000c29631605:1-17,
cf291e84-2c89-11e6-b6f0-000c29631605:1-44'
160721 20:30:14 [00] Writing backup-my.cnf
160721 20:30:14 [00] ...done
160721 20:30:14 [00] Writing xtrabackup_info
160721 20:30:14 [00] ...done
xtrabackup: Transaction log of lsn (186651619) to (186651628) was copied.
160721 20:30:14 completed OK!
--xtrabackup全量恢复
-删除myisam表
mysql> show create table fire.t10\G
*************************** 1. row ***************************
Table: t10
Create Table: CREATE TABLE `t10` (
`f1` int(11) DEFAULT NULL,
`gc` int(11) GENERATED ALWAYS AS ((`f1` + 1)) STORED,
KEY `gc` (`gc`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
1 row in set (0.00 sec)
mysql> drop table fire.t10;
Query OK, 0 rows affected (0.21 sec)
-第1次准备备份,使备份的数据文件一致
Query OK, 0 rows affected (0.21 sec)
-第1次准备备份,使备份的数据文件一致
免责声明:
① 本站未注明“稿件来源”的信息均来自网络整理。其文字、图片和音视频稿件的所属权归原作者所有。本站收集整理出于非商业性的教育和科研之目的,并不意味着本站赞同其观点或证实其内容的真实性。仅作为临时的测试数据,供内部测试之用。本站并未授权任何人以任何方式主动获取本站任何信息。
② 本站未注明“稿件来源”的临时测试数据将在测试完成后最终做删除处理。有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
Percona XtraBackup 2.4 xtrabackup全量、增量备份恢复流程
下载Word文档到电脑,方便收藏和打印~
下载Word文档
猜你喜欢
2024-04-02
2024-04-02
mysql中xtrabackup全量备份/增量备份及恢复
目录一、测试前准备mysql数据库创建数据库创建备份目录 二、开始测试1、全量备份数据库2、全量备份恢复(先准备,再恢复)三、增量备份 1、先全量备份 2、全量备份之后增加些数据3、第一次增量备份(1)查看全量备份的to_lsn(2)第一次
2024-09-15
2024-04-02
2024-04-02
2024-04-02
2024-04-02
2024-04-02
2024-04-02
2024-04-02
2024-04-02
2024-04-02
MySQL数据库全量、增量备份与恢复
造成数据丢失的原因 程序错误 人为商店 计算机失败 磁盘失败 灾难(如火山、地震)和偷窃 数据库备份的分类 从物理与逻辑的角度,备份可分为: 物理备份:对数据库操作系统的物理文件(如数据文件、日志文件等)的备份 物理备份又可以分为脱机备份(冷
2015-05-05
2024-04-02
2024-04-02
2024-04-02
2024-04-02
MySQLdump增量备份、完全备份与恢复的方法是什么
本篇内容主要讲解“MySQLdump增量备份、完全备份与恢复的方法是什么”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“MySQLdump增量备份、完全备份与恢复的方法是什么”吧!在数据库表丢失或
2023-06-16