Percona-XtraBackup系列三:增量备份恢复
2024-08-21 05:27:25
1:创建测试表和测试库
如果需要快速建立测试表和库的话,参考之前写的这篇博客:
http://www.cnblogs.com/xiaoit/p/3376685.html
create database backup_test;
CREATE TABLE `backup` (
`id` int(11) NOT NULL AUTO_INCREMENT ,
`name` varchar(20) NOT NULL DEFAULT '' ,
`create_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ,
`del` tinyint(1) NOT NULL DEFAULT '0',
PRIMARY KEY (`id`)
) ENGINE=myisam DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
mysql> INSERT INTO backup (name) VALUES ('Hi'),('Hi');
2:全备份
innobackupex --defaults-file=/etc/my.cnf --user=root --password='ge0513' --slave-info /root/
3:再次插入数据
INSERT INTO backup (name) VALUES ('Hi1'),('Hi1'),('Hi1'),('Hi1'),('Hi1'),('Hi1'),('Hi1'),('Hi1'),('Hi1'),('Hi1'),('Hi1'),('Hi1'),('Hi1'),('Hi1'),('Hi1'),('Hi1'),('Hi1'),('Hi1');
4:增量备份
innobackupex --defaults-file=/etc/my.cnf --user=root --password='ge0513' --incremental-basedir=/root/2015-05-25_20-54-39/ --incremental /root/
150525 20:56:05 innobackupex: completed OK!
[root@localhost ~]# ls
2015-05-25_20-54-39 526.sql anaconda-ks.cfg Documents install.log Music Public sql.sql Videos
2015-05-25_20-56-00 all.sql Desktop Downloads install.log.syslog Pictures software Templates
[root@localhost ~]# cd 2015-05-25_20-56-00/
[root@localhost 2015-05-25_20-56-00]# ls
backup-my.cnf ibdata1.delta mysql test xtrabackup_checkpoints xtrabackup_logfile
dbmm ibdata1.meta performance_schema xtrabackup_binlog_info xtrabackup_info
[root@localhost 2015-05-25_20-56-00]# cat xtrabackup_checkpoints
backup_type = incremental
from_lsn = 68178003
to_lsn = 68201658
last_lsn = 68201658
compact = 0
5:进入备份目录查看备份信息
cat xtrabackup_checkpoints
6:增量还原
innobackupex --defaults-file=/etc/my.cnf --user=root --password='ge0513' --apply-log --redo-only /root/2015-05-25_20-54-39/
innobackupex --defaults-file=/etc/my.cnf --user=root --password='ge0513' --redo-only /root/2015-05-25_20-56-00/ --incremental-dir=/root/2015-05-25_20-56-00/
最新文章
- 《Note --- Unreal 4 --- Sample analyze --- StrategyGame(continue...)》
- C++小项目:directx11图形程序(三):graphicsclass
- OK6410移植madplay播放器,王明学learn
- ABBYY如何使用电子邮件发送OCR结果
- AppCan移动技术全景图:创新、协作、支撑
- maven 本地仓库nexus的安装
- git rebase无法处理的问题
- Android 自定义View修炼-自定义HorizontalScrollView视图实现仿ViewPager效果
- iOS RunTime你知道了总得用一下
- [LeetCode] Find Largest Value in Each Tree Row 找树每行最大的结点值
- sybase central 报 NullPointerException 解决
- Appscanner实验还原code1
- [转]在centos 6.4下安装opencv 2.3.1
- python selenium 定制启动Chrome的选项注意事项(十九)
- loadRunner手动关联, web_reg_save_param_regexp()函数正则匹配字符,赋值给变量
- logstash安装与logstash-input-jdbc插件使用
- SNMP代理软件开发
- databinding在android studio2.3版本后不再默认支持使用
- Gitlab CI-3.遇到的问题
- 2018BNU校赛总决赛
热门文章
- java7 NIO2 watching service API
- 如何在 Xcode 中修改应用的名字
- 梅尔罗斯百度云在线观看迅雷下载Patrick Melrose磁力BT下载
- Build Web Apps in Node and Express视频下载
- actuator监控
- HTML5 本地文件操作之FileSystemAPI实例(二)
- 哈,今天终于在电脑上吧oracle给装上了
- postgresql数据库用户名密码验证失败
- [leetcode]Reverse Words in a String @ Python
- Backbone.js 使用模板