【MySql】innobackupex 增量備份的bug
1 搭建測試環境
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| sbtest |
+----------------+
1 row in set (0.01 sec)
2 全量備份
[root@rac3 mysql]# innobackupex --defaults-file=/etc/my.cnf --user=root /opt/mysql/backup/base
3 建立新的表
mysql> create table t1 as select * from sbtest;
mysql> create table t2 as select * from sbtest limit 1000;
mysql> create table t3 as select * from sbtest limit 1000;
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| sbtest |
| t1 |
| t2 |
| t3 |
+----------------+
4 rows in set (0.00 sec)
4 增量備份:
[root@rac3 mysql]# innobackupex --defaults-file=/etc/my.cnf --user=root --incremental --incremental-basedir=/opt/mysql/backup/base /opt/mysql/backup/delta
5 關閉資料庫,刪除資料
[root@rac3 mysql]# service mysql stop
Shutting down MySQL. [確定]
[root@rac3 mysql]#rm -fr data
6 恢復資料
全量恢復:
[root@rac3 mysql]# innobackupex --defaults-file=/etc/my.cnf --user=root --apply-log --redo-only /opt/mysql/backup/base/2011-12-11_20-47-06
增量恢復:
[root@rac3 mysql]# innobackupex --defaults-file=/etc/my.cnf --user=root --apply-log --redo-only /opt/mysql/backup/base/2011-12-11_21-12-46 --incremental-dir=/opt/mysql/backup/delta/2011-12-11_21-25-50
InnoDB Backup Utility v1.5.1-xtrabackup; Copyright 2003, 2009 Innobase Oy
and Percona Inc 2009-2011. All Rights Reserved.
This software is published under
the GNU GENERAL PUBLIC LICENSE Version 2, June 1991.
IMPORTANT: Please check that the apply-log run completes successfully.
At the end of a successful apply-log run innobackupex
prints "completed OK!".
111211 21:32:15 innobackupex: Starting ibbackup with command: xtrabackup_55 --defaults-file="/etc/my.cnf" --prepare --target-dir=/opt/mysql/backup/base/2011-12-11_21-12-46 --apply-log-only --incremental-dir=/opt/mysql/backup/delta/2011-12-11_21-25-50
xtrabackup_55 version 1.6.3 for Percona Server 5.5.9 Linux (x86_64) (revision id: 292)
incremental backup from 8809430318 is enabled.
xtrabackup: cd to /opt/mysql/backup/base/2011-12-11_21-12-46
xtrabackup: This target seems to be already prepared.
xtrabackup: xtrabackup_logfile detected: size=2097152, start_lsn=(8810280564)
xtrabackup: page size for /opt/mysql/backup/delta/2011-12-11_21-25-50/ibdata1.delta is 16384 bytes
Applying /opt/mysql/backup/delta/2011-12-11_21-25-50/ibdata1.delta ...
xtrabackup: Temporary instance for recovery is set as followings.
xtrabackup: innodb_data_home_dir = ./
xtrabackup: innodb_data_file_path = ibdata1:10M:autoextend
xtrabackup: innodb_log_group_home_dir = /opt/mysql/backup/delta/2011-12-11_21-25-50
xtrabackup: innodb_log_files_in_group = 1
xtrabackup: innodb_log_file_size = 2097152
111211 21:32:15 InnoDB: Using Linux native AIO
xtrabackup: Starting InnoDB instance for recovery.
xtrabackup: Using 104857600 bytes for buffer pool (set by --use-memory parameter)
111211 21:32:15 InnoDB: The InnoDB memory heap is disabled
111211 21:32:15 InnoDB: Mutexes and rw_locks use GCC atomic builtins
111211 21:32:15 InnoDB: Compressed tables use zlib 1.2.3
111211 21:32:15 InnoDB: Using Linux native AIO
111211 21:32:15 InnoDB: Warning: innodb_file_io_threads is deprecated. Please use innodb_read_io_threads and innodb_write_io_threads instead
111211 21:32:15 InnoDB: Initializing buffer pool, size = 100.0M
111211 21:32:15 InnoDB: Completed initialization of buffer pool
111211 21:32:15 InnoDB: highest supported file format is Barracuda.
InnoDB: The log sequence number in ibdata files does not match
InnoDB: the log sequence number in the ib_logfiles!
111211 21:32:15 InnoDB: Database was not shut down normally!
InnoDB: Starting crash recovery.
InnoDB: Reading tablespace information from the .ibd files...
InnoDB: Last MySQL binlog file position 0 321824, file name ./mysql-bin.000001
[notice (again)]
If you use binary log and don't use any hack of group commit,
the binary log position seems to be:
InnoDB: Last MySQL binlog file position 0 321824, file name ./mysql-bin.000001
xtrabackup: starting shutdown with innodb_fast_shutdown = 1
111211 21:32:16 InnoDB: Starting shutdown...
111211 21:32:16 InnoDB: Shutdown completed; log sequence number 8810280564
111211 21:32:16 innobackupex: completed OK!
複製檔案
[root@rac3 test]# innobackupex --defaults-file=/etc/my.cnf --user=root --copy-back /opt/mysql/backup/base/2011-12-11_21-12-46
重啟mysql
[root@rac3 mysql]# service mysql start
Starting MySQL... [確定]
7 進行確認!
mysql> use test;
Database changed
mysql> show tables;
+----------------+
| Tables_in_test |
+----------------+
| sbtest |
| t1 |
+----------------+
2 rows in set (0.00 sec)
透過以上資訊可以看到innobackupex 不能備份全量備份之後到增量備份之前的新建資料物件。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/22664653/viewspace-713127/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- MySQL增量備份的指令碼(innobackupex)MySql指令碼
- mysql innobackupex增量備份恢復MySql
- 【MySql】innobackupex增量備份和恢復MySql
- 【MySql】innobackupex 增量備份和恢復MySql
- mysql之 Innobackupex(全備+增量)備份恢復MySql
- 使用innobackupex線上增量備份和再增量備份及恢復mysql資料庫MySql資料庫
- Mysql備份系列(3)--innobackupex備份mysql大資料(全量+增量)操作記錄MySql大資料
- 透過innobackupex實現對MySQL的增量備份與還原MySql
- innobackupex備份mysql大資料(全量+增量)操作記錄MySql大資料
- mysql innobackupex 物理備份MySql
- mysql innobackupex備份指令碼MySql指令碼
- Mysql增量備份MySql
- INNOBACKUPEX的全備和增量備份恢復學習筆記筆記
- innobackupex 備份MySQL資料庫MySql資料庫
- 使用innobackupex備份mysql資料庫MySql資料庫
- MySQL innobackupex全量備份恢復MySql
- MySQL 定時增量備份MySql
- Percona XtraBackup 2.4 innobackupex全量、增量備份恢復流程
- 【Mysql】innobackupex備份還原單個庫MySql
- innobackupex遠端備份
- innobackupex備份指令碼指令碼
- mysql innobackupex xtrabackup 大資料量 備份 還原MySql大資料
- Oracle的差異增量備份和累積增量備份Oracle
- mysql備份還原-基於binlog的增量備份還原MySql
- innobackupex全備份流程圖流程圖
- Oracle的差異增量備份和累積增量備份(zt)Oracle
- 實戰-MySQL定時增量備份(2)MySql
- Mysql增量備份之Mysqldump& MylvmbackupMySqlLVM
- mysql 利用binlog增量備份、恢復MySql
- MySQL增量備份與恢復例項MySql
- Oracle之差異增量備份與累積增量備份Oracle
- 增量備份 PostgreSQLSQL
- 完全備份、差異備份、增量備份的區別
- XtraBackup完整備份與增量備份的原理
- innobackupex備份恢復實戰
- Mysql備份系列(2)--mysqldump備份(全量+增量)方案操作記錄MySql
- 【Mysql】xbackup全量與增量備份恢復MySql
- rman備份和增量備份指令碼指令碼