mysql备份之Xtrabackup

Xtrabackup是一个对InnoDB,做数据备份的工具,支持在线热备份(备份时不影响数据读写),是商业备份工具InnoDB Hotbackup的一个很好的替代品。

Xtrabackup中包含两个工具:

    * xtrabackup - 用于热备份innodb, xtradb表的工具,不能备份其他表。
    * innobackupex - 对xtrabackup封装的perl脚本,提供了myisam表备份的能力。

Xtrabackup可以做什么

    * 在线(热)备份整个库的InnoDB, XtraDB表
    * 在xtrabackup的上一次整库备份基础上做增量备份(innodb only)
    * 以流的形式产生备份,可以直接保存到远程机器上(本机硬盘空间不足时很有用)

Xtrabackup如何工作的

    * xtrabackup - 具体原理有待研究。。。
    * innobackupex整库备份
         1. 调用xtrabackup对innodb表空间文件(这一瞬间的映像Time1)备份,而在这个innodb表备份期间数据库是不加锁的,外部可以继续往库里增减数据(这才能叫热备份)。而在Time1和Time2这两个时间点之间的改动由一个线程不断地扫innodb log获得(ChangeSet1)。
         2. 锁所有库。
         3. 以直接拷贝的方式备份frm,MYD,MYI,MRG,TRG,TRN,opt格式的文件。
         4. 步骤3中的数据备份完毕时(Time2),停止扫innodb log的线程,把ChangeSet1的数据拷贝到备份中。
         5. 解锁所有库。
         6. 终止挂起,备份完毕。

注意要点

    * 根据innobackupex的原理可知它不是真正的热备份,MyISAM表越少越小就越有利。要利用Xtrabackup的好处就尽量用innodb表。
    * 还原备份前关闭mysql服务;还原备份后检查数据文件权限是否正确。
    * 性能:备份一个数据目录总大小5.6G,其中ibdata 2G,总时间4分钟,锁表时间2.5分钟。如果用mysqldump做这个库的备份锁表时间是5-8倍。




Xtrabackup备份原理:

     在InnoDB内部会维护一个redo日志文件,我们也可以叫做事务日志文件。事务日志会存储每一个InnoDB表数据的记录修改。当InnoDB启动时,InnoDB会检查数据文件和事务日志,并执行两个步骤:它应用(前滚)已经提交的事务日志到数据文件,并将修改过但没有提交的数据进行回滚操作。

     xtrabackup在启动时会记住log sequence number(LSN),并且复制所有的数据文件。复制过程需要一些时间,所以这期间如果数据文件有改动,那么将会使数据库处于一个不同的时间点。这时,xtrabackup会运行一个后台进程,用于监视事务日志,并从事务日志复制最新的修改。xtrabackup必须持续的做这个操作,是因为事务日志是会轮转重复的写入,并且事务日志可以被重用。所以xtrabackup自启动开始,就不停的将事务日志中每个数据文件的修改都记录下来。

      上面就是xtrabackup的备份过程。接下来是准备(prepare)过程。在这个过程中,xtrabackup使用之前复制的事务日志,对各个数据文件执行灾难恢复(就像MySQL刚启动时要做的一样)。当这个过程结束后,数据库就可以做恢复还原了。

以上的过程在xtrabackup的编译二进制程序中实现。程序innobackupex可以允许我们备份MyISAM表和frm文件从而增加了便捷和功能。Innobackupex会启动xtrabackup,直到xtrabackup复制数据文件后,然后执行FLUSH TABLES WITH READ LOCK来阻止新的写入进来并把MyISAM表数据刷到硬盘上,之后复制MyISAM数据文件,最后释放锁。

       备份MyISAM和InnoDB表最终会处于一致,在准备(prepare)过程结束后,InnoDB表数据已经前滚到整个备份结束的点,而不是回滚到xtrabackup刚开始时的点。这个时间点与执行FLUSH TABLES WITH READ LOCK的时间点相同,所以MyISAM表数据与InnoDB表数据是同步的。类似Oracle的,InnoDB的prepare过程可以称为recover(恢复),MyISAM的数据复制过程可以称为restore(还原)。

        xtrabackup和innobackupex这两个工具都提供了许多前文没有提到的功能特点。手册上有对各个功能都有详细的介绍。简单介绍下,这些工具提供了如流(streaming)备份,增量(incremental)备份等,通过复制数据文件,复制日志文件和提交日志到数据文件(前滚)实现了各种复合备份方式。

如下图所示:

mysql备份之Xtrabackup_第1张图片



案例分析:

一、数据库全备
1、创建配置文件
[root@rh64 ~]# cat /tmp/my.cnf 
[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
# Disabling symbolic-links is recommended to prevent assorted security risks
symbolic-links=0
innodb_data_file_path=ibdata1:12M;ibdata2:10M:autoextend
innodb_log_files_in_group=2
innodb_log_file_size=50331648

2、创建备份目录
[root@rh64 ~]# ls -ld /data/mysql/backup/
drwxrwxrwx. 3 mysql mysql 4096 Oct 15 12:13 /data/mysql/backup/

3、测试
mysql> show databases;

+--------------------+
| Database           |
+--------------------+
| information_schema |
| mysql              |
| performance_schema |
| prod               |
| test               |
+--------------------+
5 rows in set (0.06 sec)

mysql> use prod;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> show tables;
+----------------+
| Tables_in_prod |
+----------------+
| t1             |
| t2             |
| t3             |
+----------------+
3 rows in set (0.00 sec)

mysql> select count(*) from t1;
+----------+
| count(*) |
+----------+
|    49152 |
+----------+
1 row in set (0.13 sec)

插入数据:
mysql> insert into t1 select * from t1;

Query OK, 49152 rows affected (0.69 sec)
Records: 49152  Duplicates: 0  Warnings: 0
mysql> commit;
Query OK, 0 rows affected (0.00 sec)
mysql> select count(*) from t1;
+----------+
| count(*) |
+----------+
|    98304 |
+----------+
1 row in set (0.03 sec)

4、创建备份用户并授权
mysql> create user 'bkusr'@'%' identified by 'oracle';

Query OK, 0 rows affected (0.00 sec)
mysql> grant reload,create tablespace,lock tables ,replication client,super on *.* to 'bakusr'@'%';
Query OK, 0 rows affected (0.00 sec
mysql> create user 'bakusr'@localhost identified by 'oracle';
Query OK, 0 rows affected (0.00 sec)

5、进行数据库全备
[root@rh64 ~]# innobackupex --user=bakusr --password='oracle' --socket=/var/lib/mysql/mysql.sock --defaults-file=/tmp/my.cnf /data/mysql/backup/full

xtrabackup: Error: --defaults-file must be specified first on the command line
----提示配置文件参数必须放在第一位

以root用户备份:
[root@rh64 ~]# innobackupex --defaults-file=/etc/my.cnf --user=root --password='oracle'  --socket=/var/lib/mysql/mysql.sock  /data/mysql/backup/full
[html] view plain copy print ?
  1. 151028 14:18:16 innobackupex: Starting the backup operation  
  2.   
  3. IMPORTANT: Please check that the backup run completes successfully.  
  4.            At the end of a successful backup run innobackupex  
  5.            prints "completed OK!".  
  6. 151028 14:18:16  version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup;mysql_socket=/var/lib/mysql/mysql.sock' as 'bakusr'  (using password: YES).  
  7. 151028 14:18:16  version_check Connected to MySQL server  
  8. 151028 14:18:16  version_check Executing a version check against the server...  
  9. 151028 14:18:16  version_check Done.  
  10. 151028 14:18:16 Connecting to MySQL server host: localhost, user: bakusr, password: set, port: 0, socket: /var/lib/mysql/mysql.sock  
  11. Using server version 5.6.25-73.1  
  12. innobackupex version 2.3.2 based on MySQL server 5.6.24 Linux (x86_64) (revision id: 306a2e0)  
  13. xtrabackup: uses posix_fadvise().  
  14. xtrabackup: cd to /var/lib/mysql  
  15. xtrabackup: open files limit requested 0, set to 1024  
  16. xtrabackup: using the following InnoDB configuration:  
  17. xtrabackup:   innodb_data_home_dir = ./  
  18. xtrabackup:   innodb_data_file_path = ibdata1:12M;ibdata2:10M:autoextend  
  19. xtrabackup:   innodb_log_group_home_dir = ./  
  20. xtrabackup:   innodb_log_files_in_group = 2  
  21. xtrabackup:   innodb_log_file_size = 50331648  
  22. 151028 14:18:16 >> log scanned up to (13254527)  
  23. xtrabackup: Generating a list of tablespaces  
  24. 151028 14:18:16 [01] Copying ./ibdata1 to /data/mysql/backup/full/2015-10-28_14-18-16/ibdata1  
  25. 151028 14:18:17 [01]        ...done  
  26. 151028 14:18:17 [01] Copying ./ibdata2 to /data/mysql/backup/full/2015-10-28_14-18-16/ibdata2  
  27. 151028 14:18:17 >> log scanned up to (13254527)  
  28. 151028 14:18:17 [01]        ...done  
  29. 151028 14:18:17 [01] Copying ./prod/t2.ibd to /data/mysql/backup/full/2015-10-28_14-18-16/prod/t2.ibd  
  30. 151028 14:18:17 [01]        ...done  
  31. 151028 14:18:17 [01] Copying ./prod/t1.ibd to /data/mysql/backup/full/2015-10-28_14-18-16/prod/t1.ibd  
  32. 151028 14:18:18 [01]        ...done  
  33. 151028 14:18:18 >> log scanned up to (13254527)  
  34. 151028 14:18:18 [01] Copying ./prod/t3.ibd to /data/mysql/backup/full/2015-10-28_14-18-16/prod/t3.ibd  
  35. 151028 14:18:18 [01]        ...done  
  36. 151028 14:18:18 [01] Copying ./mysql/slave_worker_info.ibd to /data/mysql/backup/full/2015-10-28_14-18-16/mysql/slave_worker_info.ibd  
  37. 151028 14:18:18 [01]        ...done  
  38. 151028 14:18:18 [01] Copying ./mysql/slave_master_info.ibd to /data/mysql/backup/full/2015-10-28_14-18-16/mysql/slave_master_info.ibd  
  39. 151028 14:18:18 [01]        ...done  
  40. 151028 14:18:18 [01] Copying ./mysql/slave_relay_log_info.ibd to /data/mysql/backup/full/2015-10-28_14-18-16/mysql/slave_relay_log_info.ibd  
  41. 151028 14:18:18 [01]        ...done  
  42. 151028 14:18:18 [01] Copying ./mysql/innodb_index_stats.ibd to /data/mysql/backup/full/2015-10-28_14-18-16/mysql/innodb_index_stats.ibd  
  43. 151028 14:18:19 [01]        ...done  
  44. 151028 14:18:19 [01] Copying ./mysql/innodb_table_stats.ibd to /data/mysql/backup/full/2015-10-28_14-18-16/mysql/innodb_table_stats.ibd  
  45. 151028 14:18:19 [01]        ...done  
  46. ......  
  47. 151028 14:21:39 Executing UNLOCK BINLOG  
  48. 151028 14:21:39 Executing UNLOCK TABLES  
  49. 151028 14:21:39 All tables unlocked  
  50. 151028 14:21:39 Backup created in directory '/data/mysql/backup/full/2015-10-28_14-21-20'  
  51. 151028 14:21:39 [00] Writing backup-my.cnf  
  52. 151028 14:21:39 [00]        ...done  
  53. 151028 14:21:39 [00] Writing xtrabackup_info  
  54. 151028 14:21:39 [00]        ...done  
  55. xtrabackup: Transaction log of lsn (13254537) to (13254537) was copied.  
  56. 151028 14:21:39 completed OK!  
查看备份:
[root@rh64 backup]# ls
bak.sh  full  prod  t.txt
[root@rh64 backup]# cd full
[root@rh64 full]# ls
2015-10-28_14-23-23
[root@rh64 full]# cd 2015-10-28_14-23-23/
[root@rh64 2015-10-28_14-23-23]# ls -lt
total 22560
-rw-r----- 1 root root      507 Oct 28 14:23 xtrabackup_info
-rw-r----- 1 root root      398 Oct 28 14:23 backup-my.cnf
-rw-r----- 1 root root      115 Oct 28 14:23 xtrabackup_checkpoints
-rw-r----- 1 root root     2560 Oct 28 14:23 xtrabackup_logfile
drwx------ 2 root root     4096 Oct 28 14:23 performance_schema
drwx------ 2 root root     4096 Oct 28 14:23 mysql
drwx------ 2 root root     4096 Oct 28 14:23 test
drwx------ 2 root root     4096 Oct 28 14:23 prod
-rw-r----- 1 root root 10485760 Oct 28 14:23 ibdata2
-rw-r----- 1 root root 12582912 Oct 28 14:23 ibdata1
[root@rh64 2015-10-28_14-23-23]# 

使用参数:--no-timestamp
[root@rh64 backup]# innobackupex --defaults-file=/etc/my.cnf --user=root --password='oracle'  --socket=/var/lib/mysql/mysql.sock  /data/mysql/backup/full --no-timestamp

则不建立时间相关的目录:

[root@rh64 backup]# ls
bak.sh  full  prod  t.txt
[root@rh64 backup]# cd full
[root@rh64 full]# ls 
backup-my.cnf  ibdata2  performance_schema  test                    xtrabackup_info
ibdata1        mysql    prod                xtrabackup_checkpoints  xtrabackup_logfile
[root@rh64 full]# ls -l
total 22560
-rw-r----- 1 root root      398 Oct 28 14:25 backup-my.cnf
-rw-r----- 1 root root 12582912 Oct 28 14:25 ibdata1
-rw-r----- 1 root root 10485760 Oct 28 14:25 ibdata2
drwx------ 2 root root     4096 Oct 28 14:25 mysql
drwx------ 2 root root     4096 Oct 28 14:25 performance_schema
drwx------ 2 root root     4096 Oct 28 14:25 prod
drwx------ 2 root root     4096 Oct 28 14:25 test
-rw-r----- 1 root root      115 Oct 28 14:25 xtrabackup_checkpoints
-rw-r----- 1 root root      522 Oct 28 14:25 xtrabackup_info
-rw-r----- 1 root root     2560 Oct 28 14:25 xtrabackup_logfile

使用普通用户备份:
[root@rh64 ~]# innobackupex --defaults-file=/etc/my.cnf --user=bakusr --password='oracle'  --socket=/var/lib/mysql/mysql.sock  /data/mysql/backup/full

Error: failed to execute query LOCK TABLES FOR BACKUP: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation

----提示:缺少reload权限

查看用户权限:
mysql> select user,host,Reload_priv from user where user='bakusr';

+--------+-----------+-------------+
| user   | host      | Reload_priv |
+--------+-----------+-------------+
| bakusr | %         | Y           |
| bakusr | localhost | N           |
+--------+-----------+-------------+
2 rows in set (0.04 sec)

授权:
mysql> grant reload,create tablespace,lock tables ,replication client,super on *.* to 'bakusr'@localhost;

Query OK, 0 rows affected (0.08 sec)

mysql> select user,host,Reload_priv from user where user='bakusr';
+--------+-----------+-------------+
| user   | host      | Reload_priv |
+--------+-----------+-------------+
| bakusr | %         | Y           |
| bakusr | localhost | Y           |
+--------+-----------+-------------+

2 rows in set (0.15 sec)

备份
[root@rh64 ~]# innobackupex --defaults-file=/etc/my.cnf --user=bakusr --password='oracle'  --socket=/var/lib/mysql/mysql.sock  /data/mysql/backup/full  --no-timestamp
[html] view plain copy print ?
  1. 151028 14:26:45 innobackupex: Starting the backup operation  
  2. IMPORTANT: Please check that the backup run completes successfully.  
  3.            At the end of a successful backup run innobackupex  
  4.            prints "completed OK!".  
  5. 151028 14:26:45  version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup;mysql_socket=/var/lib/mysql/mysql.sock' as 'usrbak'  (using password: YES).  
  6. Failed to connect to MySQL server: DBI connect(';mysql_read_default_group=xtrabackup;mysql_socket=/var/lib/mysql/mysql.sock','usrbak',...) failed: Access denied for user 'usrbak'@'localhost' (using password: YES) at - line 1314  
  7. 151028 14:26:45 Connecting to MySQL server host: localhost, user: usrbak, password: set, port: 0, socket: /var/lib/mysql/mysql.sock  
  8. Failed to connect to MySQL server: Access denied for user 'usrbak'@'localhost' (using password: YES).  
  9. [root@rh64 backup]# innobackupex --defaults-file=/etc/my.cnf --user=bakusr --password='oracle'  --socket=/var/lib/mysql/mysql.sock  /data/mysql/backup/full --no-timestamp  
  10. 151028 14:26:59 innobackupex: Starting the backup operation  
  11.   
  12. IMPORTANT: Please check that the backup run completes successfully.  
  13.            At the end of a successful backup run innobackupex  
  14.            prints "completed OK!".  
  15.   
  16. 151028 14:26:59  version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup;mysql_socket=/var/lib/mysql/mysql.sock' as 'bakusr'  (using password: YES).  
  17. 151028 14:26:59  version_check Connected to MySQL server  
  18. 151028 14:26:59  version_check Executing a version check against the server...  
  19. 151028 14:26:59  version_check Done.  
  20. 151028 14:26:59 Connecting to MySQL server host: localhost, user: bakusr, password: set, port: 0, socket: /var/lib/mysql/mysql.sock  
  21. Using server version 5.6.25-73.1  
  22. innobackupex version 2.3.2 based on MySQL server 5.6.24 Linux (x86_64) (revision id: 306a2e0)  
  23. xtrabackup: uses posix_fadvise().  
  24. xtrabackup: cd to /var/lib/mysql  
  25. xtrabackup: open files limit requested 0, set to 1024  
  26. xtrabackup: using the following InnoDB configuration:  
  27. xtrabackup:   innodb_data_home_dir = ./  
  28. xtrabackup:   innodb_data_file_path = ibdata1:12M;ibdata2:10M:autoextend  
  29. xtrabackup:   innodb_log_group_home_dir = ./  
  30. xtrabackup:   innodb_log_files_in_group = 2  
  31. xtrabackup:   innodb_log_file_size = 50331648  
  32. 151028 14:26:59 >> log scanned up to (13254537)  
  33. xtrabackup: Generating a list of tablespaces  
  34. 151028 14:27:00 [01] Copying ./ibdata1 to /data/mysql/backup/full/ibdata1  
  35. 151028 14:27:00 [01]        ...done  
  36. 151028 14:27:00 >> log scanned up to (13254537)  
  37. 151028 14:27:00 [01] Copying ./ibdata2 to /data/mysql/backup/full/ibdata2  
  38. 151028 14:27:01 [01]        ...done  
  39. 151028 14:27:01 [01] Copying ./prod/t2.ibd to /data/mysql/backup/full/prod/t2.ibd  
  40. 151028 14:27:01 [01]        ...done  
  41. 151028 14:27:01 [01] Copying ./prod/t1.ibd to /data/mysql/backup/full/prod/t1.ibd  
  42. 151028 14:27:01 >> log scanned up to (13254537)  
  43. 151028 14:27:01 [01]        ...done  
  44. 151028 14:27:01 [01] Copying ./prod/t3.ibd to /data/mysql/backup/full/prod/t3.ibd  
  45. 151028 14:27:01 [01]        ...done  
  46. 151028 14:27:02 [01] Copying ./mysql/slave_worker_info.ibd to /data/mysql/backup/full/mysql/slave_worker_info.ibd  
  47. 151028 14:27:02 [01]        ...done  
  48. 151028 14:27:02 [01] Copying ./mysql/slave_master_info.ibd to /data/mysql/backup/full/mysql/slave_master_info.ibd  
  49. 151028 14:27:02 [01]        ...done  
  50. 151028 14:27:02 [01] Copying ./mysql/slave_relay_log_info.ibd to /data/mysql/backup/full/mysql/slave_relay_log_info.ibd  
  51. 151028 14:27:02 [01]        ...done  
  52. 151028 14:27:02 [01] Copying ./mysql/innodb_index_stats.ibd to /data/mysql/backup/full/mysql/innodb_index_stats.ibd  
  53. 151028 14:27:02 [01]        ...done  
  54. 151028 14:27:02 [01] Copying ./mysql/innodb_table_stats.ibd to /data/mysql/backup/full/mysql/innodb_table_stats.ibd  
  55. 151028 14:27:02 [01]        ...done  
  56. 151028 14:27:02 >> log scanned up to (13254537)  
  57. Error: failed to execute query LOCK TABLES FOR BACKUP: Access denied; you need (at least one of) the RELOAD privilege(s) for this operation  
  58. [root@rh64 backup]# innobackupex --defaults-file=/etc/my.cnf --user=bakusr --password='oracle'  --socket=/var/lib/mysql/mysql.sock  /data/mysql/backup/full --no-timestamp  
  59. 151028 14:34:47 innobackupex: Starting the backup operation  
  60.   
  61. IMPORTANT: Please check that the backup run completes successfully.  
  62.            At the end of a successful backup run innobackupex  
  63.            prints "completed OK!".  
  64.   
  65. 151028 14:34:47  version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup;mysql_socket=/var/lib/mysql/mysql.sock' as 'bakusr'  (using password: YES).  
  66. 151028 14:34:47  version_check Connected to MySQL server  
  67. 151028 14:34:47  version_check Executing a version check against the server...  
  68. 151028 14:34:47  version_check Done.  
  69. 151028 14:34:47 Connecting to MySQL server host: localhost, user: bakusr, password: set, port: 0, socket: /var/lib/mysql/mysql.sock  
  70. Using server version 5.6.25-73.1  
  71. innobackupex version 2.3.2 based on MySQL server 5.6.24 Linux (x86_64) (revision id: 306a2e0)  
  72. xtrabackup: uses posix_fadvise().  
  73. xtrabackup: cd to /var/lib/mysql  
  74. xtrabackup: open files limit requested 0, set to 1024  
  75. xtrabackup: using the following InnoDB configuration:  
  76. xtrabackup:   innodb_data_home_dir = ./  
  77. xtrabackup:   innodb_data_file_path = ibdata1:12M;ibdata2:10M:autoextend  
  78. xtrabackup:   innodb_log_group_home_dir = ./  
  79. xtrabackup:   innodb_log_files_in_group = 2  
  80. xtrabackup:   innodb_log_file_size = 50331648  
  81. innobackupex: Can't create/write to file '/data/mysql/backup/full/xtrabackup_logfile' (Errcode: 17 - File exists)  
  82. xtrabackup: error: failed to open the target stream for 'xtrabackup_logfile'.  
  83. [root@rh64 backup]# ls  
  84. bak.sh  full  prod  t.txt  
  85. [root@rh64 backup]# rm -rf full  
  86. [root@rh64 backup]# innobackupex --defaults-file=/etc/my.cnf --user=bakusr --password='oracle'  --socket=/var/lib/mysql/mysql.sock  /data/mysql/backup/full --no-timestamp  
  87. 151028 14:35:09 innobackupex: Starting the backup operation  
  88.   
  89. IMPORTANT: Please check that the backup run completes successfully.  
  90.            At the end of a successful backup run innobackupex  
  91.            prints "completed OK!".  
  92. 151028 14:35:09  version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup;mysql_socket=/var/lib/mysql/mysql.sock' as 'bakusr'  (using password: YES).  
  93. 151028 14:35:09  version_check Connected to MySQL server  
  94. 151028 14:35:09  version_check Executing a version check against the server...  
  95. 151028 14:35:09  version_check Done.  
  96. 151028 14:35:09 Connecting to MySQL server host: localhost, user: bakusr, password: set, port: 0, socket: /var/lib/mysql/mysql.sock  
  97. Using server version 5.6.25-73.1  
  98. innobackupex version 2.3.2 based on MySQL server 5.6.24 Linux (x86_64) (revision id: 306a2e0)  
  99. xtrabackup: uses posix_fadvise().  
  100. xtrabackup: cd to /var/lib/mysql  
  101. xtrabackup: open files limit requested 0, set to 1024  
  102. xtrabackup: using the following InnoDB configuration:  
  103. xtrabackup:   innodb_data_home_dir = ./  
  104. xtrabackup:   innodb_data_file_path = ibdata1:12M;ibdata2:10M:autoextend  
  105. xtrabackup:   innodb_log_group_home_dir = ./  
  106. xtrabackup:   innodb_log_files_in_group = 2  
  107. xtrabackup:   innodb_log_file_size = 50331648  
  108. 151028 14:35:09 >> log scanned up to (13254537)  
  109. xtrabackup: Generating a list of tablespaces  
  110. 151028 14:35:09 [01] Copying ./ibdata1 to /data/mysql/backup/full/ibdata1  
  111. 151028 14:35:10 >> log scanned up to (13254537)  
  112. 151028 14:35:10 [01]        ...done  
  113. 151028 14:35:11 [01] Copying ./ibdata2 to /data/mysql/backup/full/ibdata2  
  114. 151028 14:35:11 [01]        ...done  
  115. 151028 14:35:11 >> log scanned up to (13254537)  
  116. 151028 14:35:11 [01] Copying ./prod/t2.ibd to /data/mysql/backup/full/prod/t2.ibd  
  117. 151028 14:35:11 [01]        ...done  
  118. 151028 14:35:11 [01] Copying ./prod/t1.ibd to /data/mysql/backup/full/prod/t1.ibd  
  119. 151028 14:35:12 [01]        ...done  
  120. 151028 14:35:12 [01] Copying ./prod/t3.ibd to /data/mysql/backup/full/prod/t3.ibd  
  121. 151028 14:35:12 >> log scanned up to (13254537)  
  122. 151028 14:35:12 [01]        ...done  
  123. 151028 14:35:12 [01] Copying ./mysql/slave_worker_info.ibd to /data/mysql/backup/full/mysql/slave_worker_info.ibd  
  124. 151028 14:35:12 [01]        ...done  
  125. 151028 14:35:12 [01] Copying ./mysql/slave_master_info.ibd to /data/mysql/backup/full/mysql/slave_master_info.ibd  
  126. 151028 14:35:12 [01]        ...done  
  127. 151028 14:35:12 [01] Copying ./mysql/slave_relay_log_info.ibd to /data/mysql/backup/full/mysql/slave_relay_log_info.ibd  
  128. 151028 14:35:12 [01]        ...done  
  129. 151028 14:35:12 [01] Copying ./mysql/innodb_index_stats.ibd to /data/mysql/backup/full/mysql/innodb_index_stats.ibd  
  130. 151028 14:35:12 [01]        ...done  
  131. 151028 14:35:12 [01] Copying ./mysql/innodb_table_stats.ibd to /data/mysql/backup/full/mysql/innodb_table_stats.ibd  
  132. 151028 14:35:12 [01]        ...done  
  133. 151028 14:35:12 Starting to backup non-InnoDB tables and files  
  134. 151028 14:35:12 [01] Copying ./prod/t1.frm to /data/mysql/backup/full/prod/t1.frm  
  135. 151028 14:35:13 [01]        ...done  
  136. 151028 14:35:13 [01] Copying ./prod/t2.frm to /data/mysql/backup/full/prod/t2.frm  
  137. 151028 14:35:13 [01]        ...done  
  138. 151028 14:35:13 [01] Copying ./prod/t3.frm to /data/mysql/backup/full/prod/t3.frm  
  139. 151028 14:35:13 [01]        ...done  
  140. 151028 14:35:13 [01] Copying ./prod/db.opt to /data/mysql/backup/full/prod/db.opt  
  141. 151028 14:35:13 [01]        ...done  
  142. 151028 14:35:13 >> log scanned up to (13254537)  
  143. 151028 14:35:13 [00] Writing test/db.opt  
  144. 151028 14:35:13 [00]        ...done  
  145. 151028 14:35:13 [01] Copying ./mysql/time_zone_name.MYD to /data/mysql/backup/full/mysql/time_zone_name.MYD  
  146. 151028 14:35:13 [01]        ...done  
  147. 151028 14:35:13 [01] Copying ./mysql/help_topic.frm to /data/mysql/backup/full/mysql/help_topic.frm  
  148. 151028 14:35:13 [01]        ...done  
  149. 151028 14:35:13 [01] Copying ./mysql/event.frm to /data/mysql/backup/full/mysql/event.frm  
  150. 151028 14:35:13 [01]        ...done  
  151. 151028 14:35:13 [01] Copying ./mysql/time_zone.MYD to /data/mysql/backup/full/mysql/time_zone.MYD  
  152. 151028 14:35:13 [01]        ...done  
  153. 151028 14:35:13 [01] Copying ./mysql/slow_log.CSV to /data/mysql/backup/full/mysql/slow_log.CSV  
  154. 151028 14:35:13 [01]        ...done  
  155. 151028 14:35:13 [01] Copying ./mysql/innodb_index_stats.frm to /data/mysql/backup/full/mysql/innodb_index_stats.frm  
  156. 151028 14:35:13 [01]        ...done  
  157. 151028 14:35:14 [01] Copying ./mysql/columns_priv.MYI to /data/mysql/backup/full/mysql/columns_priv.MYI  
  158. 151028 14:35:14 [01]        ...done  
  159. 151028 14:35:14 [01] Copying ./mysql/plugin.MYI to /data/mysql/backup/full/mysql/plugin.MYI  
  160. 151028 14:35:14 [01]        ...done  
  161. 151028 14:35:14 [01] Copying ./mysql/time_zone_leap_second.frm to /data/mysql/backup/full/mysql/time_zone_leap_second.frm  
  162. 151028 14:35:14 [01]        ...done  
  163. 151028 14:35:14 [01] Copying ./mysql/time_zone_transition_type.MYI to /data/mysql/backup/full/mysql/time_zone_transition_type.MYI  
  164. 151028 14:35:14 [01]        ...done  
  165. 151028 14:35:14 >> log scanned up to (13254537)  
  166. 151028 14:35:14 [01] Copying ./mysql/proc.frm to /data/mysql/backup/full/mysql/proc.frm  
  167. 151028 14:35:14 [01]        ...done  
  168. 151028 14:35:14 [01] Copying ./mysql/procs_priv.MYD to /data/mysql/backup/full/mysql/procs_priv.MYD  
  169. 151028 14:35:14 [01]        ...done  
  170. 151028 14:35:14 [01] Copying ./mysql/proxies_priv.MYI to /data/mysql/backup/full/mysql/proxies_priv.MYI  
  171. 151028 14:35:14 [01]        ...done  
  172. 151028 14:35:14 [01] Copying ./mysql/ndb_binlog_index.MYI to /data/mysql/backup/full/mysql/ndb_binlog_index.MYI  
  173. 151028 14:35:14 [01]        ...done  
  174. 151028 14:35:14 [01] Copying ./mysql/servers.MYI to /data/mysql/backup/full/mysql/servers.MYI  
  175. 151028 14:35:14 [01]        ...done  
  176. 151028 14:35:15 [01] Copying ./mysql/slow_log.frm to /data/mysql/backup/full/mysql/slow_log.frm  
  177. 151028 14:35:15 [01]        ...done  
  178. 151028 14:35:15 [01] Copying ./mysql/help_relation.MYD to /data/mysql/backup/full/mysql/help_relation.MYD  
  179. 151028 14:35:15 [01]        ...done  
  180. 151028 14:35:15 [01] Copying ./mysql/user.frm to /data/mysql/backup/full/mysql/user.frm  
  181. 151028 14:35:15 [01]        ...done  
  182. 151028 14:35:15 >> log scanned up to (13254537)  
  183. 151028 14:35:15 [01] Copying ./mysql/plugin.frm to /data/mysql/backup/full/mysql/plugin.frm  
  184. 151028 14:35:15 [01]        ...done  
  185. 151028 14:35:15 [01] Copying ./mysql/time_zone_name.frm to /data/mysql/backup/full/mysql/time_zone_name.frm  
  186. 151028 14:35:15 [01]        ...done  
  187. 151028 14:35:15 [01] Copying ./mysql/user.MYI to /data/mysql/backup/full/mysql/user.MYI  
  188. 151028 14:35:15 [01]        ...done  
  189. 151028 14:35:15 [01] Copying ./mysql/help_relation.frm to /data/mysql/backup/full/mysql/help_relation.frm  
  190. 151028 14:35:15 [01]        ...done  
  191. 151028 14:35:15 [01] Copying ./mysql/slow_log.CSM to /data/mysql/backup/full/mysql/slow_log.CSM  
  192. 151028 14:35:15 [01]        ...done  
  193. 151028 14:35:16 [01] Copying ./mysql/time_zone_transition.MYD to /data/mysql/backup/full/mysql/time_zone_transition.MYD  
  194. 151028 14:35:16 [01]        ...done  
  195. 151028 14:35:16 [01] Copying ./mysql/help_category.MYI to /data/mysql/backup/full/mysql/help_category.MYI  
  196. 151028 14:35:16 [01]        ...done  
  197. 151028 14:35:16 [01] Copying ./mysql/proc.MYD to /data/mysql/backup/full/mysql/proc.MYD  
  198. 151028 14:35:16 [01]        ...done  
  199. 151028 14:35:16 [01] Copying ./mysql/db.MYD to /data/mysql/backup/full/mysql/db.MYD  
  200. 151028 14:35:16 [01]        ...done  
  201. 151028 14:35:16 >> log scanned up to (13254537)  
  202. 151028 14:35:16 [01] Copying ./mysql/tables_priv.MYD to /data/mysql/backup/full/mysql/tables_priv.MYD  
  203. 151028 14:35:16 [01]        ...done  
  204. 151028 14:35:16 [01] Copying ./mysql/time_zone_leap_second.MYI to /data/mysql/backup/full/mysql/time_zone_leap_second.MYI  
  205. 151028 14:35:16 [01]        ...done  
  206. 151028 14:35:16 [01] Copying ./mysql/help_relation.MYI to /data/mysql/backup/full/mysql/help_relation.MYI  
  207. 151028 14:35:16 [01]        ...done  
  208. 151028 14:35:16 [01] Copying ./mysql/ndb_binlog_index.MYD to /data/mysql/backup/full/mysql/ndb_binlog_index.MYD  
  209. 151028 14:35:16 [01]        ...done  
  210. 151028 14:35:16 [01] Copying ./mysql/slave_worker_info.frm to /data/mysql/backup/full/mysql/slave_worker_info.frm  
  211. 151028 14:35:16 [01]        ...done  
  212. 151028 14:35:17 [01] Copying ./mysql/time_zone.frm to /data/mysql/backup/full/mysql/time_zone.frm  
  213. 151028 14:35:17 [01]        ...done  
  214. 151028 14:35:17 [01] Copying ./mysql/slave_relay_log_info.frm to /data/mysql/backup/full/mysql/slave_relay_log_info.frm  
  215. 151028 14:35:17 [01]        ...done  
  216. 151028 14:35:17 [01] Copying ./mysql/columns_priv.MYD to /data/mysql/backup/full/mysql/columns_priv.MYD  
  217. 151028 14:35:17 [01]        ...done  
  218. 151028 14:35:17 >> log scanned up to (13254537)  
  219. 151028 14:35:17 [01] Copying ./mysql/time_zone_transition_type.MYD to /data/mysql/backup/full/mysql/time_zone_transition_type.MYD  
  220. 151028 14:35:17 [01]        ...done  
  221. 151028 14:35:17 [01] Copying ./mysql/user.MYD to /data/mysql/backup/full/mysql/user.MYD  
  222. 151028 14:35:17 [01]        ...done  
  223. 151028 14:35:17 [01] Copying ./mysql/tables_priv.frm to /data/mysql/backup/full/mysql/tables_priv.frm  
  224. 151028 14:35:17 [01]        ...done  
  225. 151028 14:35:17 [01] Copying ./mysql/help_category.MYD to /data/mysql/backup/full/mysql/help_category.MYD  
  226. 151028 14:35:17 [01]        ...done  
  227. 151028 14:35:17 [01] Copying ./mysql/help_keyword.MYD to /data/mysql/backup/full/mysql/help_keyword.MYD  
  228. 151028 14:35:18 [01]        ...done  
  229. 151028 14:35:18 [01] Copying ./mysql/time_zone_transition.frm to /data/mysql/backup/full/mysql/time_zone_transition.frm  
  230. 151028 14:35:18 [01]        ...done  
  231. 151028 14:35:18 [01] Copying ./mysql/servers.frm to /data/mysql/backup/full/mysql/servers.frm  
  232. 151028 14:35:18 [01]        ...done  
  233. 151028 14:35:18 [01] Copying ./mysql/general_log.frm to /data/mysql/backup/full/mysql/general_log.frm  
  234. 151028 14:35:18 [01]        ...done  
  235. 151028 14:35:18 >> log scanned up to (13254537)  
  236. 151028 14:35:18 [01] Copying ./mysql/help_keyword.frm to /data/mysql/backup/full/mysql/help_keyword.frm  
  237. 151028 14:35:18 [01]        ...done  
  238. 151028 14:35:18 [01] Copying ./mysql/time_zone_transition_type.frm to /data/mysql/backup/full/mysql/time_zone_transition_type.frm  
  239. 151028 14:35:18 [01]        ...done  
  240. 151028 14:35:18 [01] Copying ./mysql/columns_priv.frm to /data/mysql/backup/full/mysql/columns_priv.frm  
  241. 151028 14:35:18 [01]        ...done  
  242. 151028 14:35:18 [01] Copying ./mysql/proxies_priv.frm to /data/mysql/backup/full/mysql/proxies_priv.frm  
  243. 151028 14:35:18 [01]        ...done  
  244. 151028 14:35:19 [01] Copying ./mysql/help_keyword.MYI to /data/mysql/backup/full/mysql/help_keyword.MYI  
  245. 151028 14:35:19 [01]        ...done  
  246. 151028 14:35:19 [01] Copying ./mysql/general_log.CSV to /data/mysql/backup/full/mysql/general_log.CSV  
  247. 151028 14:35:19 [01]        ...done  
  248. 151028 14:35:19 [01] Copying ./mysql/event.MYD to /data/mysql/backup/full/mysql/event.MYD  
  249. 151028 14:35:19 [01]        ...done  
  250. 151028 14:35:19 [01] Copying ./mysql/plugin.MYD to /data/mysql/backup/full/mysql/plugin.MYD  
  251. 151028 14:35:19 [01]        ...done  
  252. 151028 14:35:19 [01] Copying ./mysql/proxies_priv.MYD to /data/mysql/backup/full/mysql/proxies_priv.MYD  
  253. 151028 14:35:19 [01]        ...done  
  254. 151028 14:35:19 >> log scanned up to (13254537)  
  255. 151028 14:35:19 [01] Copying ./mysql/servers.MYD to /data/mysql/backup/full/mysql/servers.MYD  
  256. 151028 14:35:19 [01]        ...done  
  257. 151028 14:35:19 [01] Copying ./mysql/event.MYI to /data/mysql/backup/full/mysql/event.MYI  
  258. 151028 14:35:19 [01]        ...done  
  259. 151028 14:35:19 [01] Copying ./mysql/time_zone_transition.MYI to /data/mysql/backup/full/mysql/time_zone_transition.MYI  
  260. 151028 14:35:19 [01]        ...done  
  261. 151028 14:35:19 [01] Copying ./mysql/tables_priv.MYI to /data/mysql/backup/full/mysql/tables_priv.MYI  
  262. 151028 14:35:19 [01]        ...done  
  263. 151028 14:35:19 [01] Copying ./mysql/ndb_binlog_index.frm to /data/mysql/backup/full/mysql/ndb_binlog_index.frm  
  264. 151028 14:35:19 [01]        ...done  
  265. 151028 14:35:20 [01] Copying ./mysql/db.MYI to /data/mysql/backup/full/mysql/db.MYI  
  266. 151028 14:35:20 [01]        ...done  
  267. 151028 14:35:20 [01] Copying ./mysql/time_zone_name.MYI to /data/mysql/backup/full/mysql/time_zone_name.MYI  
  268. 151028 14:35:20 [01]        ...done  
  269. 151028 14:35:20 [01] Copying ./mysql/time_zone_leap_second.MYD to /data/mysql/backup/full/mysql/time_zone_leap_second.MYD  
  270. 151028 14:35:20 [01]        ...done  
  271. 151028 14:35:20 >> log scanned up to (13254537)  
  272. 151028 14:35:20 [01] Copying ./mysql/help_topic.MYD to /data/mysql/backup/full/mysql/help_topic.MYD  
  273. 151028 14:35:20 [01]        ...done  
  274. 151028 14:35:20 [01] Copying ./mysql/help_topic.MYI to /data/mysql/backup/full/mysql/help_topic.MYI  
  275. 151028 14:35:20 [01]        ...done  
  276. 151028 14:35:20 [01] Copying ./mysql/db.frm to /data/mysql/backup/full/mysql/db.frm  
  277. 151028 14:35:20 [01]        ...done  
  278. 151028 14:35:20 [01] Copying ./mysql/func.MYI to /data/mysql/backup/full/mysql/func.MYI  
  279. 151028 14:35:20 [01]        ...done  
  280. 151028 14:35:20 [01] Copying ./mysql/procs_priv.MYI to /data/mysql/backup/full/mysql/procs_priv.MYI  
  281. 151028 14:35:21 [01]        ...done  
  282. 151028 14:35:21 [01] Copying ./mysql/help_category.frm to /data/mysql/backup/full/mysql/help_category.frm  
  283. 151028 14:35:21 [01]        ...done  
  284. 151028 14:35:21 [01] Copying ./mysql/procs_priv.frm to /data/mysql/backup/full/mysql/procs_priv.frm  
  285. 151028 14:35:21 [01]        ...done  
  286. 151028 14:35:21 [01] Copying ./mysql/func.MYD to /data/mysql/backup/full/mysql/func.MYD  
  287. 151028 14:35:21 [01]        ...done  
  288. 151028 14:35:21 >> log scanned up to (13254537)  
  289. 151028 14:35:21 [01] Copying ./mysql/func.frm to /data/mysql/backup/full/mysql/func.frm  
  290. 151028 14:35:21 [01]        ...done  
  291. 151028 14:35:21 [01] Copying ./mysql/proc.MYI to /data/mysql/backup/full/mysql/proc.MYI  
  292. 151028 14:35:21 [01]        ...done  
  293. 151028 14:35:21 [01] Copying ./mysql/general_log.CSM to /data/mysql/backup/full/mysql/general_log.CSM  
  294. 151028 14:35:21 [01]        ...done  
  295. 151028 14:35:21 [01] Copying ./mysql/time_zone.MYI to /data/mysql/backup/full/mysql/time_zone.MYI  
  296. 151028 14:35:21 [01]        ...done  
  297. 151028 14:35:21 [01] Copying ./mysql/slave_master_info.frm to /data/mysql/backup/full/mysql/slave_master_info.frm  
  298. 151028 14:35:21 [01]        ...done  
  299. 151028 14:35:22 [01] Copying ./mysql/innodb_table_stats.frm to /data/mysql/backup/full/mysql/innodb_table_stats.frm  
  300. 151028 14:35:22 [01]        ...done  
  301. 151028 14:35:22 [01] Copying ./performance_schema/users.frm to /data/mysql/backup/full/performance_schema/users.frm  
  302. 151028 14:35:22 [01]        ...done  
  303. 151028 14:35:22 [01] Copying ./performance_schema/events_waits_history_long.frm to /data/mysql/backup/full/performance_schema/events_waits_history_long.frm  
  304. 151028 14:35:22 [01]        ...done  
  305. 151028 14:35:22 >> log scanned up to (13254537)  
  306. 151028 14:35:22 [01] Copying ./performance_schema/events_statements_summary_by_host_by_event_name.frm to /data/mysql/backup/full/performance_schema/events_statements_summary_by_host_by_event_name.frm  
  307. 151028 14:35:22 [01]        ...done  
  308. 151028 14:35:22 [01] Copying ./performance_schema/table_io_waits_summary_by_index_usage.frm to /data/mysql/backup/full/performance_schema/table_io_waits_summary_by_index_usage.frm  
  309. 151028 14:35:22 [01]        ...done  
  310. 151028 14:35:22 [01] Copying ./performance_schema/events_waits_history.frm to /data/mysql/backup/full/performance_schema/events_waits_history.frm  
  311. 151028 14:35:22 [01]        ...done  
  312. 151028 14:35:22 [01] Copying ./performance_schema/host_cache.frm to /data/mysql/backup/full/performance_schema/host_cache.frm  
  313. 151028 14:35:22 [01]        ...done  
  314. 151028 14:35:22 [01] Copying ./performance_schema/events_statements_summary_by_thread_by_event_name.frm to /data/mysql/backup/full/performance_schema/events_statements_summary_by_thread_by_event_name.frm  
  315. 151028 14:35:22 [01]        ...done  
  316. 151028 14:35:23 [01] Copying ./performance_schema/session_connect_attrs.frm to /data/mysql/backup/full/performance_schema/session_connect_attrs.frm  
  317. 151028 14:35:23 [01]        ...done  
  318. 151028 14:35:23 [01] Copying ./performance_schema/objects_summary_global_by_type.frm to /data/mysql/backup/full/performance_schema/objects_summary_global_by_type.frm  
  319. 151028 14:35:23 [01]        ...done  
  320. 151028 14:35:23 [01] Copying ./performance_schema/session_account_connect_attrs.frm to /data/mysql/backup/full/performance_schema/session_account_connect_attrs.frm  
  321. 151028 14:35:23 [01]        ...done  
  322. 151028 14:35:23 >> log scanned up to (13254537)  
  323. 151028 14:35:23 [01] Copying ./performance_schema/socket_summary_by_event_name.frm to /data/mysql/backup/full/performance_schema/socket_summary_by_event_name.frm  
  324. 151028 14:35:23 [01]        ...done  
  325. 151028 14:35:23 [01] Copying ./performance_schema/events_stages_summary_global_by_event_name.frm to /data/mysql/backup/full/performance_schema/events_stages_summary_global_by_event_name.frm  
  326. 151028 14:35:23 [01]        ...done  
  327. 151028 14:35:23 [01] Copying ./performance_schema/rwlock_instances.frm to /data/mysql/backup/full/performance_schema/rwlock_instances.frm  
  328. 151028 14:35:23 [01]        ...done  
  329. 151028 14:35:23 [01] Copying ./performance_schema/events_stages_current.frm to /data/mysql/backup/full/performance_schema/events_stages_current.frm  
  330. 151028 14:35:23 [01]        ...done  
  331. 151028 14:35:23 [01] Copying ./performance_schema/file_summary_by_instance.frm to /data/mysql/backup/full/performance_schema/file_summary_by_instance.frm  
  332. 151028 14:35:23 [01]        ...done  
  333. 151028 14:35:24 [01] Copying ./performance_schema/events_waits_summary_by_host_by_event_name.frm to /data/mysql/backup/full/performance_schema/events_waits_summary_by_host_by_event_name.frm  
  334. 151028 14:35:24 [01]        ...done  
  335. 151028 14:35:24 [01] Copying ./performance_schema/performance_timers.frm to /data/mysql/backup/full/performance_schema/performance_timers.frm  
  336. 151028 14:35:24 [01]        ...done  
  337. 151028 14:35:24 [01] Copying ./performance_schema/events_waits_summary_by_thread_by_event_name.frm to /data/mysql/backup/full/performance_schema/events_waits_summary_by_thread_by_event_name.frm  
  338. 151028 14:35:24 [01]        ...done  
  339. 151028 14:35:24 >> log scanned up to (13254537)  
  340. 151028 14:35:24 [01] Copying ./performance_schema/events_waits_summary_by_user_by_event_name.frm to /data/mysql/backup/full/performance_schema/events_waits_summary_by_user_by_event_name.frm  
  341. 151028 14:35:24 [01]        ...done  
  342. 151028 14:35:24 [01] Copying ./performance_schema/cond_instances.frm to /data/mysql/backup/full/performance_schema/cond_instances.frm  
  343. 151028 14:35:24 [01]        ...done  
  344. 151028 14:35:24 [01] Copying ./performance_schema/events_statements_summary_global_by_event_name.frm to /data/mysql/backup/full/performance_schema/events_statements_summary_global_by_event_name.frm  
  345. 151028 14:35:24 [01]        ...done  
  346. 151028 14:35:24 [01] Copying ./performance_schema/setup_timers.frm to /data/mysql/backup/full/performance_schema/setup_timers.frm  
  347. 151028 14:35:24 [01]        ...done  
  348. 151028 14:35:24 [01] Copying ./performance_schema/hosts.frm to /data/mysql/backup/full/performance_schema/hosts.frm  
  349. 151028 14:35:24 [01]        ...done  
  350. 151028 14:35:25 [01] Copying ./performance_schema/socket_summary_by_instance.frm to /data/mysql/backup/full/performance_schema/socket_summary_by_instance.frm  
  351. 151028 14:35:25 [01]        ...done  
  352. 151028 14:35:25 [01] Copying ./performance_schema/file_instances.frm to /data/mysql/backup/full/performance_schema/file_instances.frm  
  353. 151028 14:35:25 [01]        ...done  
  354. 151028 14:35:25 [01] Copying ./performance_schema/table_lock_waits_summary_by_table.frm to /data/mysql/backup/full/performance_schema/table_lock_waits_summary_by_table.frm  
  355. 151028 14:35:25 [01]        ...done  
  356. 151028 14:35:25 [01] Copying ./performance_schema/events_statements_summary_by_user_by_event_name.frm to /data/mysql/backup/full/performance_schema/events_statements_summary_by_user_by_event_name.frm  
  357. 151028 14:35:25 [01]        ...done  
  358. 151028 14:35:25 [01] Copying ./performance_schema/events_waits_current.frm to /data/mysql/backup/full/performance_schema/events_waits_current.frm  
  359. 151028 14:35:25 >> log scanned up to (13254537)  
  360. 151028 14:35:25 [01]        ...done  
  361. 151028 14:35:25 [01] Copying ./performance_schema/events_statements_summary_by_digest.frm to /data/mysql/backup/full/performance_schema/events_statements_summary_by_digest.frm  
  362. 151028 14:35:25 [01]        ...done  
  363. 151028 14:35:25 [01] Copying ./performance_schema/events_stages_history.frm to /data/mysql/backup/full/performance_schema/events_stages_history.frm  
  364. 151028 14:35:25 [01]        ...done  
  365. 151028 14:35:25 [01] Copying ./performance_schema/file_summary_by_event_name.frm to /data/mysql/backup/full/performance_schema/file_summary_by_event_name.frm  
  366. 151028 14:35:25 [01]        ...done  
  367. 151028 14:35:25 [01] Copying ./performance_schema/table_io_waits_summary_by_table.frm to /data/mysql/backup/full/performance_schema/table_io_waits_summary_by_table.frm  
  368. 151028 14:35:25 [01]        ...done  
  369. 151028 14:35:25 [01] Copying ./performance_schema/events_stages_summary_by_thread_by_event_name.frm to /data/mysql/backup/full/performance_schema/events_stages_summary_by_thread_by_event_name.frm  
  370. 151028 14:35:25 [01]        ...done  
  371. 151028 14:35:26 [01] Copying ./performance_schema/threads.frm to /data/mysql/backup/full/performance_schema/threads.frm  
  372. 151028 14:35:26 [01]        ...done  
  373. 151028 14:35:26 [01] Copying ./performance_schema/accounts.frm to /data/mysql/backup/full/performance_schema/accounts.frm  
  374. 151028 14:35:26 [01]        ...done  
  375. 151028 14:35:26 [01] Copying ./performance_schema/events_waits_summary_global_by_event_name.frm to /data/mysql/backup/full/performance_schema/events_waits_summary_global_by_event_name.frm  
  376. 151028 14:35:26 [01]        ...done  
  377. 151028 14:35:26 >> log scanned up to (13254537)  
  378. 151028 14:35:26 [01] Copying ./performance_schema/setup_objects.frm to /data/mysql/backup/full/performance_schema/setup_objects.frm  
  379. 151028 14:35:26 [01]        ...done  
  380. 151028 14:35:26 [01] Copying ./performance_schema/events_statements_current.frm to /data/mysql/backup/full/performance_schema/events_statements_current.frm  
  381. 151028 14:35:26 [01]        ...done  
  382. 151028 14:35:26 [01] Copying ./performance_schema/socket_instances.frm to /data/mysql/backup/full/performance_schema/socket_instances.frm  
  383. 151028 14:35:26 [01]        ...done  
  384. 151028 14:35:26 [01] Copying ./performance_schema/setup_actors.frm to /data/mysql/backup/full/performance_schema/setup_actors.frm  
  385. 151028 14:35:26 [01]        ...done  
  386. 151028 14:35:27 [01] Copying ./performance_schema/events_stages_summary_by_account_by_event_name.frm to /data/mysql/backup/full/performance_schema/events_stages_summary_by_account_by_event_name.frm  
  387. 151028 14:35:27 [01]        ...done  
  388. 151028 14:35:27 [01] Copying ./performance_schema/events_stages_summary_by_host_by_event_name.frm to /data/mysql/backup/full/performance_schema/events_stages_summary_by_host_by_event_name.frm  
  389. 151028 14:35:27 [01]        ...done  
  390. 151028 14:35:27 [01] Copying ./performance_schema/db.opt to /data/mysql/backup/full/performance_schema/db.opt  
  391. 151028 14:35:27 [01]        ...done  
  392. 151028 14:35:27 [01] Copying ./performance_schema/events_stages_summary_by_user_by_event_name.frm to /data/mysql/backup/full/performance_schema/events_stages_summary_by_user_by_event_name.frm  
  393. 151028 14:35:27 [01]        ...done  
  394. 151028 14:35:27 >> log scanned up to (13254537)  
  395. 151028 14:35:27 [01] Copying ./performance_schema/events_statements_history.frm to /data/mysql/backup/full/performance_schema/events_statements_history.frm  
  396. 151028 14:35:27 [01]        ...done  
  397. 151028 14:35:27 [01] Copying ./performance_schema/events_waits_summary_by_account_by_event_name.frm to /data/mysql/backup/full/performance_schema/events_waits_summary_by_account_by_event_name.frm  
  398. 151028 14:35:27 [01]        ...done  
  399. 151028 14:35:27 [01] Copying ./performance_schema/events_waits_summary_by_instance.frm to /data/mysql/backup/full/performance_schema/events_waits_summary_by_instance.frm  
  400. 151028 14:35:27 [01]        ...done  
  401. 151028 14:35:27 [01] Copying ./performance_schema/setup_consumers.frm to /data/mysql/backup/full/performance_schema/setup_consumers.frm  
  402. 151028 14:35:27 [01]        ...done  
  403. 151028 14:35:28 [01] Copying ./performance_schema/setup_instruments.frm to /data/mysql/backup/full/performance_schema/setup_instruments.frm  
  404. 151028 14:35:28 [01]        ...done  
  405. 151028 14:35:28 [01] Copying ./performance_schema/mutex_instances.frm to /data/mysql/backup/full/performance_schema/mutex_instances.frm  
  406. 151028 14:35:28 [01]        ...done  
  407. 151028 14:35:28 [01] Copying ./performance_schema/events_statements_history_long.frm to /data/mysql/backup/full/performance_schema/events_statements_history_long.frm  
  408. 151028 14:35:28 [01]        ...done  
  409. 151028 14:35:28 [01] Copying ./performance_schema/events_statements_summary_by_account_by_event_name.frm to /data/mysql/backup/full/performance_schema/events_statements_summary_by_account_by_event_name.frm  
  410. 151028 14:35:28 [01]        ...done  
  411. 151028 14:35:28 >> log scanned up to (13254537)  
  412. 151028 14:35:28 [01] Copying ./performance_schema/events_stages_history_long.frm to /data/mysql/backup/full/performance_schema/events_stages_history_long.frm  
  413. 151028 14:35:28 [01]        ...done  
  414. 151028 14:35:28 Finished backing up non-InnoDB tables and files  
  415. 151028 14:35:28 Executing LOCK BINLOG FOR BACKUP...  
  416. 151028 14:35:28 Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS...  
  417. xtrabackup: The latest check point (for incremental): '13254537'  
  418. xtrabackup: Stopping log copying thread.  
  419. .151028 14:35:28 >> log scanned up to (13254537)  
  420.   
  421.   
  422. 151028 14:35:28 Executing UNLOCK BINLOG  
  423. 151028 14:35:28 Executing UNLOCK TABLES  
  424. 151028 14:35:28 All tables unlocked  
  425. 151028 14:35:28 Backup created in directory '/data/mysql/backup/full'  
  426. 151028 14:35:28 [00] Writing backup-my.cnf  
  427. 151028 14:35:28 [00]        ...done  
  428. 151028 14:35:29 [00] Writing xtrabackup_info  
  429. 151028 14:35:29 [00]        ...done  
  430. xtrabackup: Transaction log of lsn (13254537) to (13254537) was copied.  
  431. 151028 14:35:29 completed OK!  
[root@rh64 backup]# ls -l full
total 22560
-rw-r----- 1 root root      398 Oct 28 14:35 backup-my.cnf
-rw-r----- 1 root root 12582912 Oct 28 14:35 ibdata1
-rw-r----- 1 root root 10485760 Oct 28 14:35 ibdata2
drwx------ 2 root root     4096 Oct 28 14:35 mysql
drwx------ 2 root root     4096 Oct 28 14:35 performance_schema
drwx------ 2 root root     4096 Oct 28 14:35 prod
drwx------ 2 root root     4096 Oct 28 14:35 test
-rw-r----- 1 root root      115 Oct 28 14:35 xtrabackup_checkpoints
-rw-r----- 1 root root      524 Oct 28 14:35 xtrabackup_info
-rw-r----- 1 root root     2560 Oct 28 14:35 xtrabackup_logfile

二、数据库恢复

1、测试

关闭数据库,更改datadir目录

[mysql@rh64 ~]$ service mysql stop
Shutting down MySQL (Percona Server)...[  OK  ]
rm: cannot remove `/var/lock/subsys/mysql': Permission denied

[root@rh64 ~]# mv /var/lib/mysql /var/lib/mysql.bak
[root@rh64 ~]# cd /var/lib/mysql.bak
[root@rh64 mysql.bak]# ls
auto.cnf  ibdata2      ib_logfile1    mysql               prod      RPM_UPGRADE_HISTORY      test
ibdata1   ib_logfile0  ib_logfile101  performance_schema  rh64.pid  RPM_UPGRADE_MARKER-LAST

创建新的datadir:
[root@rh64 mysql.bak]# mkdir /var/lib/mysql


数据库恢复:
[root@rh64 backup]# innobackupex --defaults-file=/etc/my.cnf  --copy-back --rsync /data/mysql/backup/full

......
151028 14:35:22 [01] Copying ./performance_schema/events_waits_history.frm to /data/mysql/backup/full/performance_schema/events_waits_history.frm
151028 14:35:22 [01]        ...done
151028 14:35:22 [01] Copying ./performance_schema/host_cache.frm to /data/mysql/backup/full/performance_schema/host_cache.frm
151028 14:35:22 [01]        ...done
151028 14:35:22 [01] Copying ./performance
......
151028 14:41:53 [01]        ...done
151028 14:41:53 [01] Copying ./performance_schema/events_stages_history_long.frm to /var/lib/mysql/performance_schema/events_stages_history_long.frm
151028 14:41:53 [01]        ...done
151028 14:41:53 [01] Copying ./xtrabackup_info to /var/lib/mysql/xtrabackup_info
151028 14:41:53 [01]        ...done
151028 14:41:54 completed OK!

重新授权datadir:
[root@rh64 lib]# ls -ld mysql.bak/
drwxr-xr-x. 6 mysql mysql 4096 Oct 28 14:38 mysql.bak/
[root@rh64 lib]# ls -ld mysql
drwxr-xr-x 6 root root 4096 Oct 28 14:45 mysql
[root@rh64 lib]# ls -l mysql.bak/
total 170020
-rw-rw----. 1 mysql mysql       56 Sep  6 18:08 auto.cnf
-rw-rw----. 1 mysql mysql 12582912 Oct 28 14:38 ibdata1
-rw-rw----. 1 mysql mysql 10485760 Oct 28 14:38 ibdata2
-rw-rw----. 1 mysql mysql 50331648 Oct 28 14:38 ib_logfile0
-rw-rw----. 1 mysql mysql 50331648 Sep  6 18:06 ib_logfile1
-rw-rw----. 1 mysql mysql 50331648 Sep 11 11:50 ib_logfile101
drwx------. 2 mysql mysql     4096 Sep  6 18:06 mysql
drwx------. 2 mysql mysql     4096 Sep  6 18:06 performance_schema
drwx------. 2 mysql mysql     4096 Oct 13 16:41 prod
-rw-rw----. 1 mysql mysql        5 Oct 15 11:36 rh64.pid
-rw-r--r--. 1 root  root       293 Sep  6 18:07 RPM_UPGRADE_HISTORY
-rw-r--r--. 1 mysql mysql      293 Sep  6 18:07 RPM_UPGRADE_MARKER-LAST
drwx------. 2 mysql mysql     4096 Sep  6 18:06 test
[root@rh64 lib]# chown -R mysql.mysql mysql

验证数据恢复:
[root@rh64 lib]# service mysql start

Starting MySQL (Percona Server)....[  OK  ]
[root@rh64 lib]# mysql -u root -p 
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.25-73.1 Percona Server (GPL), Release 73.1, Revision 07b797f
Copyright (c) 2009-2015 Percona LLC and/or its affiliates
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> 

mysql> use prod;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select count(*) from t1;
+----------+
| count(*) |
+----------+
|    98304 |
+----------+
1 row in set (0.04 sec)

---至此,数据恢复成功!!!

在MySQL中进行增量备份时,首先要进行一次全量备份,第一次增量备份是基于全备的,之后的增量备份是基于上一次的增量备份。

备份案例:
一、建立增量备份
1、构建测试环境
[root@rh64 full]# service mysql start
Starting MySQL (Percona Server)[  OK  ]
[root@rh64 full]# mysql -u root -p
Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.25-73.1 Percona Server (GPL), Release 73.1, Revision 07b797f
Copyright (c) 2009-2015 Percona LLC and/or its affiliates
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use prod;
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select count(*) from t1;
+----------+
| count(*) |
+----------+
|    98304 |
+----------+
1 row in set (0.12 sec)

对数据库做一次全备:
【root@rh64 ~]# innobackupex --defaults-file=/etc/my.cnf --user=bakusr --password='oracle'  --socket=/var/lib/mysql/mysql.sock  /data/mysql/backup/full  --no-timestamp
2、插入新的数据,做增量备份
mysql> insert into t1 select * from t1 order by 1 limit 10000;
Query OK, 10000 rows affected (0.46 sec)
Records: 10000  Duplicates: 0  Warnings: 0
mysql> commit;
Query OK, 0 rows affected (0.00 sec)
mysql>  select count(*) from t1;
+----------+
| count(*) |
+----------+
|   108304 |
+----------+
1 row in set (0.03 sec)

第一次增量备份:
[root@rh64 full]# innobackupex --defaults-file=/tmp/my.cnf --user=bakusr --password='oracle'  --socket=/var/lib/mysql/mysql.sock --incremental-basedir=/data/mysql/backup/full --incremental /data/mysql/backup/inc_1 --no-timestamp --parallel=2
[html] view plain copy print ?
  1. .....  
  2. 151029 15:11:38 [01] Copying ./performance_schema/events_statements_summary_by_account_by_event_name.frm to /data/mysql/backup/inc_1/performance_schema/events_statements_summary_by_account_by_event_name.frm  
  3. 151029 15:11:38 [01]        ...done  
  4. 151029 15:11:38 [01] Copying ./performance_schema/events_stages_history_long.frm to /data/mysql/backup/inc_1/performance_schema/events_stages_history_long.frm  
  5. 151029 15:11:38 [01]        ...done  
  6. 151029 15:11:38 Finished backing up non-InnoDB tables and files  
  7. 151029 15:11:38 Executing LOCK BINLOG FOR BACKUP...  
  8. 151029 15:11:38 Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS...  
  9. xtrabackup: The latest check point (for incremental): '13869220'  
  10. xtrabackup: Stopping log copying thread.  
  11. .151029 15:11:38 >> log scanned up to (13869220)  
  12. ......  
  13. 151029 15:11:38 Executing UNLOCK BINLOG  
  14. 151029 15:11:38 Executing UNLOCK TABLES  
  15. 151029 15:11:38 All tables unlocked  
  16. 151029 15:11:38 Backup created in directory '/data/mysql/backup/inc_1'  
  17. 151029 15:11:38 [00] Writing backup-my.cnf  
  18. 151029 15:11:38 [00]        ...done  
  19. 151029 15:11:38 [00] Writing xtrabackup_info  
  20. 151029 15:11:38 [00]        ...done  
  21. xtrabackup: Transaction log of lsn (13869220) to (13869220) was copied.  
  22. 151029 15:11:38 completed OK!  
查看全备的信息:
[root@rh64 full]# cat xtrabackup_checkpoints

backup_type = full-backuped
from_lsn = 0
to_lsn = 13254537
last_lsn = 13254537
compact = 0
recover_binlog_info = 0

[root@rh64 full]# cat xtrabackup_info
uuid = 14899a5d-7d3e-11e5-acbc-0800273dfa7f
name = 
tool_name = innobackupex
tool_command = --defaults-file=/etc/my.cnf --user=bakusr --password=... --socket=/var/lib/mysql/mysql.sock /data/mysql/backup/full --no-timestamp
tool_version = 2.3.2
ibbackup_version = 2.3.2
server_version = 5.6.25-73.1
start_time = 2015-10-28 14:35:09
end_time = 2015-10-28 14:35:29
lock_time = 0
binlog_pos = (null)
innodb_from_lsn = 0
innodb_to_lsn = 13254537
partial = N
incremental = N
format = file
compact = N
compressed = N
encrypted = N

查看增量的备份信息:
[root@rh64 inc_1]# cat xtrabackup_checkpoints

backup_type = incremental
from_lsn = 13254537
to_lsn = 13869220
last_lsn = 13869220
compact = 0
recover_binlog_info = 0

[root@rh64 inc_1]# cat xtrabackup_info
uuid = 4c3a7567-7e0c-11e5-ba68-0800273dfa7f
name = 
tool_name = innobackupex
tool_command = --defaults-file=/tmp/my.cnf --user=bakusr --password=... --socket=/var/lib/mysql/mysql.sock --incremental-basedir=/data/mysql/backup/full --incremental /data/mysql/backup/inc_1 --no-timestamp --parallel=2
tool_version = 2.3.2
ibbackup_version = 2.3.2
server_version = 5.6.25-73.1
start_time = 2015-10-29 15:11:19
end_time = 2015-10-29 15:11:38
lock_time = 0
binlog_pos = (null)


第二次增量备份:
mysql> insert into t1 select * from t1 order by 1 limit 10000;

Query OK, 10000 rows affected (0.43 sec)
Records: 10000  Duplicates: 0  Warnings: 0
mysql> commit;
Query OK, 0 rows affected (0.00 sec)
mysql> select count(*) from t1;
+----------+
| count(*) |
+----------+
|   118304 |
+----------+
1 row in set (0.03 sec)

[root@rh64 full]# innobackupex --defaults-file=/tmp/my.cnf --user=bakusr --password='oracle'  --socket=/var/lib/mysql/mysql.sock --incremental-basedir=/data/mysql/backup/inc_1 --incremental /data/mysql/backup/inc_2 --no-timestamp --parallel=2

[html] view plain copy print ?
  1. 151029 15:18:07 [01] Copying ./performance_schema/events_stages_history_long.frm to /data/mysql/backup/inc_2/performance_schema/events_stages_history_long.frm  
  2. 151029 15:18:07 [01]        ...done  
  3. 151029 15:18:07 Finished backing up non-InnoDB tables and files  
  4. 151029 15:18:07 Executing LOCK BINLOG FOR BACKUP...  
  5. 151029 15:18:07 Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS...  
  6. xtrabackup: The latest check point (for incremental): '14484422'  
  7. xtrabackup: Stopping log copying thread.  
  8. .151029 15:18:07 >> log scanned up to (14484422)  
  9. ......  
  10. 151029 15:18:08 Executing UNLOCK BINLOG  
  11. 151029 15:18:08 Executing UNLOCK TABLES  
  12. 151029 15:18:08 All tables unlocked  
  13. 151029 15:18:08 Backup created in directory '/data/mysql/backup/inc_2'  
  14. 151029 15:18:08 [00] Writing backup-my.cnf  
  15. 151029 15:18:08 [00]        ...done  
  16. 151029 15:18:08 [00] Writing xtrabackup_info  
  17. 151029 15:18:08 [00]        ...done  
  18. xtrabackup: Transaction log of lsn (14484422) to (14484422) was copied.  
  19. 151029 15:18:08 completed OK!  
第二次增量备份信息:
[root@rh64 inc_2]# cat xtrabackup_checkpoints

backup_type = incremental
from_lsn = 13869220
to_lsn = 14484422
last_lsn = 14484422
compact = 0
recover_binlog_info = 0

[root@rh64 inc_2]# cat xtrabackup_info
uuid = 3456821a-7e0d-11e5-ba68-0800273dfa7f
name = 
tool_name = innobackupex
tool_command = --defaults-file=/tmp/my.cnf --user=bakusr --password=... --socket=/var/lib/mysql/mysql.sock --incremental-basedir=/data/mysql/backup/inc_1 --incremental /data/mysql/backup/inc_2 --no-timestamp --parallel=2
tool_version = 2.3.2
ibbackup_version = 2.3.2
server_version = 5.6.25-73.1
start_time = 2015-10-29 15:17:48
end_time = 2015-10-29 15:18:08
lock_time = 0
binlog_pos = (null)
innodb_from_lsn = 13869220
innodb_to_lsn = 14484422
partial = N
incremental = Y
format = file
compact = N
compressed = N
encrypted = N
[root@rh64 inc_2]# 
innodb_from_lsn = 13254537
innodb_to_lsn = 13869220
partial = N
incremental = Y
format = file
compact = N
compressed = N
encrypted = N



二、通过备份恢复数据

增量备份的恢复大体分为三个步骤:
1、恢复基础备份(全备)
2、恢复增量备份到基础备份(开始恢复的增量备份要添加--redo-only参数,到最后一次增量备份去掉--redo-only参数)
3、对整体基础备份进行恢复,回滚那些未提交的数据

1、测试环境

数据被误删除:
mysql> truncate table t1;

Query OK, 0 rows affected (0.60 sec)

mysql> select count(*) from t1;
+----------+
| count(*) |
+----------+
|        0 |
+----------+
1 row in set (0.00 sec)


2、数据恢复:

基础恢复prepare:
[root@rh64 inc_2]# innobackupex --apply-log --redo-only --use-memory=1g /data/mysql/backup/full

[html] view plain copy print ?
  1. 151029 15:27:00 innobackupex: Starting the apply-log operation  
  2. IMPORTANT: Please check that the apply-log run completes successfully.  
  3.            At the end of a successful apply-log run innobackupex  
  4.            prints "completed OK!".  
  5. innobackupex version 2.3.2 based on MySQL server 5.6.24 Linux (x86_64) (revision id: 306a2e0)  
  6. xtrabackup: cd to /data/mysql/backup/full  
  7. xtrabackup: This target seems to be not prepared yet.  
  8. xtrabackup: xtrabackup_logfile detected: size=2097152start_lsn=(13254537)  
  9. xtrabackup: using the following InnoDB configuration for recovery:  
  10. xtrabackup:   innodb_data_home_dir = ./  
  11. xtrabackup:   innodb_data_file_path = ibdata1:12M;ibdata2:10M:autoextend  
  12. xtrabackup:   innodb_log_group_home_dir = ./  
  13. xtrabackup:   innodb_log_files_in_group = 1  
  14. xtrabackup:   innodb_log_file_size = 2097152  
  15. xtrabackup: using the following InnoDB configuration for recovery:  
  16. xtrabackup:   innodb_data_home_dir = ./  
  17. xtrabackup:   innodb_data_file_path = ibdata1:12M;ibdata2:10M:autoextend  
  18. xtrabackup:   innodb_log_group_home_dir = ./  
  19. xtrabackup:   innodb_log_files_in_group = 1  
  20. xtrabackup:   innodb_log_file_size = 2097152  
  21. xtrabackup: Starting InnoDB instance for recovery.  
  22. xtrabackup: Using 1073741824 bytes for buffer pool (set by --use-memory parameter)  
  23. InnoDB: Using atomics to ref count buffer pool pages  
  24. InnoDB: The InnoDB memory heap is disabled  
  25. InnoDB: Mutexes and rw_locks use GCC atomic builtins  
  26. InnoDB: Memory barrier is not used  
  27. InnoDB: Compressed tables use zlib 1.2.3  
  28. InnoDB: Using CPU crc32 instructions  
  29. InnoDB: Initializing buffer pool, size = 1.0G  
  30. InnoDB: Completed initialization of buffer pool  
  31. InnoDB: Highest supported file format is Barracuda.  
  32. InnoDB: The log sequence numbers 13254527 and 13254527 in ibdata files do not match the log sequence number 13254537 in the ib_logfiles!  
  33. InnoDB: Database was not shutdown normally!  
  34. InnoDB: Starting crash recovery.  
  35. InnoDB: Reading tablespace information from the .ibd files...  
  36. InnoDB: Restoring possible half-written data pages   
  37. InnoDB: from the doublewrite buffer...  
  38. InnoDB: 128 rollback segment(s) are active.  
  39. InnoDB: Waiting for purge to start  
  40. InnoDB: 5.6.24 started; log sequence number 13254537  
  41.   
  42. xtrabackup: starting shutdown with innodb_fast_shutdown = 1  
  43. InnoDB: FTS optimize thread exiting.  
  44. InnoDB: Starting shutdown...  
  45. InnoDB: Shutdown completed; log sequence number 13254547  
  46. xtrabackup: using the following InnoDB configuration for recovery:  
  47. xtrabackup:   innodb_data_home_dir = ./  
  48. xtrabackup:   innodb_data_file_path = ibdata1:12M;ibdata2:10M:autoextend  
  49. xtrabackup:   innodb_log_group_home_dir = ./  
  50. xtrabackup:   innodb_log_files_in_group = 2  
  51. xtrabackup:   innodb_log_file_size = 50331648  
  52. InnoDB: Using atomics to ref count buffer pool pages  
  53. InnoDB: The InnoDB memory heap is disabled  
  54. InnoDB: Mutexes and rw_locks use GCC atomic builtins  
  55. InnoDB: Memory barrier is not used  
  56. InnoDB: Compressed tables use zlib 1.2.3  
  57. InnoDB: Using CPU crc32 instructions  
  58. InnoDB: Initializing buffer pool, size = 1.0G  
  59. InnoDB: Completed initialization of buffer pool  
  60. InnoDB: Setting log file ./ib_logfile101 size to 48 MB  
  61. InnoDB: Setting log file ./ib_logfile1 size to 48 MB  
  62. InnoDB: Renaming log file ./ib_logfile101 to ./ib_logfile0  
  63. InnoDB: New log files created, LSN=13254547  
  64. InnoDB: Highest supported file format is Barracuda.  
  65. InnoDB: 128 rollback segment(s) are active.  
  66. InnoDB: Waiting for purge to start  
  67. InnoDB: 5.6.24 started; log sequence number 13254668  
  68. xtrabackup: starting shutdown with innodb_fast_shutdown = 1  
  69. InnoDB: FTS optimize thread exiting.  
  70. InnoDB: Starting shutdown...  
  71. InnoDB: Shutdown completed; log sequence number 13254678  
  72. 151029 15:27:07 completed OK!  

将增量备份inc_1应用到基础备份full:(使用redo-only参数,只应用那些已经提交的事物,而不回滚那些未提交的事务)

[root@rh64 inc_2]# innobackupex --user='bakusr' --password='oracle' --apply-log  --use-memory=1g /data/mysql/backup/full --redo-only --incremental-dir=/data/mysql/backup/inc_1

[html] view plain copy print ?
  1. 151029 15:37:54 [01] Copying ./performance_schema/events_statements_history_long.frm to /data/mysql/backup/full/2015-10-29_15-37-38/performance_schema/events_statements_history_long.frm  
  2. 151029 15:37:54 [01]        ...done  
  3. 151029 15:37:54 [01] Copying ./performance_schema/events_statements_summary_by_account_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-37-38/performance_schema/events_statements_summary_by_account_by_event_name.frm  
  4. 151029 15:37:54 [01]        ...done  
  5. 151029 15:37:54 [01] Copying ./performance_schema/events_stages_history_long.frm to /data/mysql/backup/full/2015-10-29_15-37-38/performance_schema/events_stages_history_long.frm  
  6. 151029 15:37:54 [01]        ...done  
  7. 151029 15:37:55 Finished backing up non-InnoDB tables and files  
  8. 151029 15:37:55 Executing LOCK BINLOG FOR BACKUP...  
  9. 151029 15:37:55 Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS...  
  10. xtrabackup: The latest check point (for incremental): '14489531'  
  11. xtrabackup: Stopping log copying thread.  
  12. .151029 15:37:55 >> log scanned up to (14489531)  
  13.   
  14. 151029 15:37:55 Executing UNLOCK BINLOG  
  15. 151029 15:37:55 Executing UNLOCK TABLES  
  16. 151029 15:37:55 All tables unlocked  
  17. 151029 15:37:55 Backup created in directory '/data/mysql/backup/full/2015-10-29_15-37-38'  
  18. 151029 15:37:55 [00] Writing backup-my.cnf  
  19. 151029 15:37:55 [00]        ...done  
  20. 151029 15:37:55 [00] Writing xtrabackup_info  
  21. 151029 15:37:55 [00]        ...done  
  22. xtrabackup: Transaction log of lsn (14489531) to (14489531) was copied.  
  23. 151029 15:37:55 completed OK!  

将增量备份inc_2应用到全备full(不使用redo-only,回滚那些未提交的事务):
[root@rh64 inc_2]# innobackupex --user='bakusr' --password='oracle' --apply-log --use-memory=1g /data/mysql/backup/full --incremental-dir=/data/mysql/backup/inc_2

[html] view plain copy print ?
  1. 51029 15:39:38 innobackupex: Starting the backup operation  
  2. IMPORTANT: Please check that the backup run completes successfully.  
  3.            At the end of a successful backup run innobackupex  
  4.            prints "completed OK!".  
  5. 151029 15:39:38  version_check Connecting to MySQL server with DSN 'dbi:mysql:;mysql_read_default_group=xtrabackup;mysql_socket=/var/lib/mysql/mysql.sock' as 'bakusr'  (using password: YES).  
  6. 151029 15:39:38  version_check Connected to MySQL server  
  7. 151029 15:39:38  version_check Executing a version check against the server...  
  8. 151029 15:39:38  version_check Done.  
  9. 151029 15:39:38 Connecting to MySQL server host: localhost, user: bakusr, password: set, port: 0, socket: /var/lib/mysql/mysql.sock  
  10. Using server version 5.6.25-73.1  
  11. innobackupex version 2.3.2 based on MySQL server 5.6.24 Linux (x86_64) (revision id: 306a2e0)  
  12. xtrabackup: uses posix_fadvise().  
  13. xtrabackup: cd to /var/lib/mysql  
  14. xtrabackup: open files limit requested 0, set to 1024  
  15. xtrabackup: using the following InnoDB configuration:  
  16. xtrabackup:   innodb_data_home_dir = ./  
  17. xtrabackup:   innodb_data_file_path = ibdata1:12M;ibdata2:10M:autoextend  
  18. xtrabackup:   innodb_log_group_home_dir = ./  
  19. xtrabackup:   innodb_log_files_in_group = 2  
  20. xtrabackup:   innodb_log_file_size = 50331648  
  21. 151029 15:39:38 >> log scanned up to (14489531)  
  22. xtrabackup: Generating a list of tablespaces  
  23. 151029 15:39:38 [01] Copying ./ibdata1 to /data/mysql/backup/full/2015-10-29_15-39-38/ibdata1  
  24. 151029 15:39:39 >> log scanned up to (14489531)  
  25. 151029 15:39:39 [01]        ...done  
  26. 151029 15:39:39 [01] Copying ./ibdata2 to /data/mysql/backup/full/2015-10-29_15-39-38/ibdata2  
  27. 151029 15:39:39 [01]        ...done  
  28. 151029 15:39:40 [01] Copying ./prod/t2.ibd to /data/mysql/backup/full/2015-10-29_15-39-38/prod/t2.ibd  
  29. 151029 15:39:40 [01]        ...done  
  30. 151029 15:39:40 >> log scanned up to (14489531)  
  31. 151029 15:39:40 [01] Copying ./prod/t1.ibd to /data/mysql/backup/full/2015-10-29_15-39-38/prod/t1.ibd  
  32. 151029 15:39:40 [01]        ...done  
  33. 151029 15:39:40 [01] Copying ./prod/t3.ibd to /data/mysql/backup/full/2015-10-29_15-39-38/prod/t3.ibd  
  34. 151029 15:39:40 [01]        ...done  
  35. 151029 15:39:40 [01] Copying ./mysql/slave_worker_info.ibd to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/slave_worker_info.ibd  
  36. 151029 15:39:40 [01]        ...done  
  37. 151029 15:39:40 [01] Copying ./mysql/slave_master_info.ibd to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/slave_master_info.ibd  
  38. 151029 15:39:40 [01]        ...done  
  39. 151029 15:39:40 [01] Copying ./mysql/slave_relay_log_info.ibd to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/slave_relay_log_info.ibd  
  40. 151029 15:39:40 [01]        ...done  
  41. 151029 15:39:40 [01] Copying ./mysql/innodb_index_stats.ibd to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/innodb_index_stats.ibd  
  42. 151029 15:39:40 [01]        ...done  
  43. 151029 15:39:41 [01] Copying ./mysql/innodb_table_stats.ibd to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/innodb_table_stats.ibd  
  44. 151029 15:39:41 [01]        ...done  
  45. 151029 15:39:41 >> log scanned up to (14489531)  
  46. 151029 15:39:41 Starting to backup non-InnoDB tables and files  
  47. 151029 15:39:41 [01] Copying ./prod/t1.frm to /data/mysql/backup/full/2015-10-29_15-39-38/prod/t1.frm  
  48. 151029 15:39:41 [01]        ...done  
  49. 151029 15:39:41 [01] Copying ./prod/t2.frm to /data/mysql/backup/full/2015-10-29_15-39-38/prod/t2.frm  
  50. 151029 15:39:41 [01]        ...done  
  51. 151029 15:39:41 [01] Copying ./prod/t3.frm to /data/mysql/backup/full/2015-10-29_15-39-38/prod/t3.frm  
  52. 151029 15:39:41 [01]        ...done  
  53. 151029 15:39:42 [01] Copying ./prod/db.opt to /data/mysql/backup/full/2015-10-29_15-39-38/prod/db.opt  
  54. 151029 15:39:42 [01]        ...done  
  55. 151029 15:39:42 [01] Copying ./test/db.opt to /data/mysql/backup/full/2015-10-29_15-39-38/test/db.opt  
  56. 151029 15:39:42 [01]        ...done  
  57. 151029 15:39:42 [01] Copying ./mysql/time_zone_name.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/time_zone_name.MYD  
  58. 151029 15:39:42 [01]        ...done  
  59. 151029 15:39:42 [01] Copying ./mysql/help_topic.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/help_topic.frm  
  60. 151029 15:39:42 [01]        ...done  
  61. 151029 15:39:42 >> log scanned up to (14489531)  
  62. 151029 15:39:42 [01] Copying ./mysql/event.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/event.frm  
  63. 151029 15:39:42 [01]        ...done  
  64. 151029 15:39:42 [01] Copying ./mysql/time_zone.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/time_zone.MYD  
  65. 151029 15:39:42 [01]        ...done  
  66. 151029 15:39:42 [01] Copying ./mysql/slow_log.CSV to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/slow_log.CSV  
  67. 151029 15:39:42 [01]        ...done  
  68. 151029 15:39:42 [01] Copying ./mysql/innodb_index_stats.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/innodb_index_stats.frm  
  69. 151029 15:39:42 [01]        ...done  
  70. 151029 15:39:42 [01] Copying ./mysql/columns_priv.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/columns_priv.MYI  
  71. 151029 15:39:42 [01]        ...done  
  72. 151029 15:39:42 [01] Copying ./mysql/plugin.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/plugin.MYI  
  73. 151029 15:39:42 [01]        ...done  
  74. 151029 15:39:43 [01] Copying ./mysql/time_zone_leap_second.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/time_zone_leap_second.frm  
  75. 151029 15:39:43 [01]        ...done  
  76. 151029 15:39:43 [01] Copying ./mysql/time_zone_transition_type.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/time_zone_transition_type.MYI  
  77. 151029 15:39:43 [01]        ...done  
  78. 151029 15:39:43 [01] Copying ./mysql/proc.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/proc.frm  
  79. 151029 15:39:43 >> log scanned up to (14489531)  
  80. 151029 15:39:43 [01]        ...done  
  81. 151029 15:39:43 [01] Copying ./mysql/procs_priv.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/procs_priv.MYD  
  82. 151029 15:39:43 [01]        ...done  
  83. 151029 15:39:43 [01] Copying ./mysql/proxies_priv.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/proxies_priv.MYI  
  84. 151029 15:39:43 [01]        ...done  
  85. 151029 15:39:43 [01] Copying ./mysql/ndb_binlog_index.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/ndb_binlog_index.MYI  
  86. 151029 15:39:43 [01]        ...done  
  87. 151029 15:39:43 [01] Copying ./mysql/servers.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/servers.MYI  
  88. 151029 15:39:43 [01]        ...done  
  89. 151029 15:39:43 [01] Copying ./mysql/slow_log.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/slow_log.frm  
  90. 151029 15:39:43 [01]        ...done  
  91. 151029 15:39:44 [01] Copying ./mysql/help_relation.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/help_relation.MYD  
  92. 151029 15:39:44 [01]        ...done  
  93. 151029 15:39:44 [01] Copying ./mysql/user.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/user.frm  
  94. 151029 15:39:44 [01]        ...done  
  95. 151029 15:39:44 [01] Copying ./mysql/plugin.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/plugin.frm  
  96. 151029 15:39:44 [01]        ...done  
  97. 151029 15:39:44 >> log scanned up to (14489531)  
  98. 151029 15:39:44 [01] Copying ./mysql/time_zone_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/time_zone_name.frm  
  99. 151029 15:39:44 [01]        ...done  
  100. 151029 15:39:44 [01] Copying ./mysql/user.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/user.MYI  
  101. 151029 15:39:44 [01]        ...done  
  102. 151029 15:39:44 [01] Copying ./mysql/help_relation.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/help_relation.frm  
  103. 151029 15:39:44 [01]        ...done  
  104. 151029 15:39:44 [01] Copying ./mysql/slow_log.CSM to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/slow_log.CSM  
  105. 151029 15:39:44 [01]        ...done  
  106. 151029 15:39:44 [01] Copying ./mysql/time_zone_transition.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/time_zone_transition.MYD  
  107. 151029 15:39:44 [01]        ...done  
  108. 151029 15:39:44 [01] Copying ./mysql/help_category.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/help_category.MYI  
  109. 151029 15:39:44 [01]        ...done  
  110. 151029 15:39:45 [01] Copying ./mysql/proc.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/proc.MYD  
  111. 151029 15:39:45 [01]        ...done  
  112. 151029 15:39:45 [01] Copying ./mysql/db.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/db.MYD  
  113. 151029 15:39:45 [01]        ...done  
  114. 151029 15:39:45 [01] Copying ./mysql/tables_priv.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/tables_priv.MYD  
  115. 151029 15:39:45 [01]        ...done  
  116. 151029 15:39:45 >> log scanned up to (14489531)  
  117. 151029 15:39:45 [01] Copying ./mysql/time_zone_leap_second.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/time_zone_leap_second.MYI  
  118. 151029 15:39:45 [01]        ...done  
  119. 151029 15:39:45 [01] Copying ./mysql/help_relation.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/help_relation.MYI  
  120. 151029 15:39:46 [01]        ...done  
  121. 151029 15:39:46 [01] Copying ./mysql/ndb_binlog_index.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/ndb_binlog_index.MYD  
  122. 151029 15:39:46 [01]        ...done  
  123. 151029 15:39:46 [01] Copying ./mysql/slave_worker_info.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/slave_worker_info.frm  
  124. 151029 15:39:46 [01]        ...done  
  125. 151029 15:39:46 >> log scanned up to (14489531)  
  126. 151029 15:39:46 [01] Copying ./mysql/time_zone.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/time_zone.frm  
  127. 151029 15:39:46 [01]        ...done  
  128. 151029 15:39:46 [01] Copying ./mysql/slave_relay_log_info.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/slave_relay_log_info.frm  
  129. 151029 15:39:46 [01]        ...done  
  130. 151029 15:39:46 [01] Copying ./mysql/columns_priv.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/columns_priv.MYD  
  131. 151029 15:39:46 [01]        ...done  
  132. 151029 15:39:47 [01] Copying ./mysql/time_zone_transition_type.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/time_zone_transition_type.MYD  
  133. 151029 15:39:47 [01]        ...done  
  134. 151029 15:39:47 [01] Copying ./mysql/user.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/user.MYD  
  135. 151029 15:39:47 [01]        ...done  
  136. 151029 15:39:47 [01] Copying ./mysql/tables_priv.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/tables_priv.frm  
  137. 151029 15:39:47 [01]        ...done  
  138. 151029 15:39:47 >> log scanned up to (14489531)  
  139. 151029 15:39:47 [01] Copying ./mysql/help_category.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/help_category.MYD  
  140. 151029 15:39:47 [01]        ...done  
  141. 151029 15:39:47 [01] Copying ./mysql/help_keyword.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/help_keyword.MYD  
  142. 151029 15:39:47 [01]        ...done  
  143. 151029 15:39:47 [01] Copying ./mysql/time_zone_transition.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/time_zone_transition.frm  
  144. 151029 15:39:47 [01]        ...done  
  145. 151029 15:39:47 [01] Copying ./mysql/servers.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/servers.frm  
  146. 151029 15:39:47 [01]        ...done  
  147. 151029 15:39:47 [01] Copying ./mysql/general_log.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/general_log.frm  
  148. 151029 15:39:47 [01]        ...done  
  149. 151029 15:39:48 [01] Copying ./mysql/help_keyword.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/help_keyword.frm  
  150. 151029 15:39:48 [01]        ...done  
  151. 151029 15:39:48 [01] Copying ./mysql/time_zone_transition_type.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/time_zone_transition_type.frm  
  152. 151029 15:39:48 [01]        ...done  
  153. 151029 15:39:48 [01] Copying ./mysql/columns_priv.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/columns_priv.frm  
  154. 151029 15:39:48 [01]        ...done  
  155. 151029 15:39:48 >> log scanned up to (14489531)  
  156. 151029 15:39:48 [01] Copying ./mysql/proxies_priv.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/proxies_priv.frm  
  157. 151029 15:39:48 [01]        ...done  
  158. 151029 15:39:48 [01] Copying ./mysql/help_keyword.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/help_keyword.MYI  
  159. 151029 15:39:48 [01]        ...done  
  160. 151029 15:39:48 [01] Copying ./mysql/general_log.CSV to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/general_log.CSV  
  161. 151029 15:39:48 [01]        ...done  
  162. 151029 15:39:48 [01] Copying ./mysql/event.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/event.MYD  
  163. 151029 15:39:48 [01]        ...done  
  164. 151029 15:39:48 [01] Copying ./mysql/plugin.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/plugin.MYD  
  165. 151029 15:39:48 [01]        ...done  
  166. 151029 15:39:48 [01] Copying ./mysql/proxies_priv.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/proxies_priv.MYD  
  167. 151029 15:39:48 [01]        ...done  
  168. 151029 15:39:49 [01] Copying ./mysql/servers.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/servers.MYD  
  169. 151029 15:39:49 [01]        ...done  
  170. 151029 15:39:49 [01] Copying ./mysql/event.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/event.MYI  
  171. 151029 15:39:49 [01]        ...done  
  172. 151029 15:39:49 [01] Copying ./mysql/time_zone_transition.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/time_zone_transition.MYI  
  173. 151029 15:39:49 [01]        ...done  
  174. 151029 15:39:49 >> log scanned up to (14489531)  
  175. 151029 15:39:49 [01] Copying ./mysql/tables_priv.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/tables_priv.MYI  
  176. 151029 15:39:49 [01]        ...done  
  177. 151029 15:39:49 [01] Copying ./mysql/ndb_binlog_index.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/ndb_binlog_index.frm  
  178. 151029 15:39:49 [01]        ...done  
  179. 151029 15:39:49 [01] Copying ./mysql/db.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/db.MYI  
  180. 151029 15:39:49 [01]        ...done  
  181. 151029 15:39:49 [01] Copying ./mysql/time_zone_name.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/time_zone_name.MYI  
  182. 151029 15:39:49 [01]        ...done  
  183. 151029 15:39:49 [01] Copying ./mysql/time_zone_leap_second.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/time_zone_leap_second.MYD  
  184. 151029 15:39:49 [01]        ...done  
  185. 151029 15:39:49 [01] Copying ./mysql/help_topic.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/help_topic.MYD  
  186. 151029 15:39:49 [01]        ...done  
  187. 151029 15:39:50 [01] Copying ./mysql/help_topic.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/help_topic.MYI  
  188. 151029 15:39:50 [01]        ...done  
  189. 151029 15:39:50 [01] Copying ./mysql/db.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/db.frm  
  190. 151029 15:39:50 [01]        ...done  
  191. 151029 15:39:50 >> log scanned up to (14489531)  
  192. 151029 15:39:50 [01] Copying ./mysql/func.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/func.MYI  
  193. 151029 15:39:50 [01]        ...done  
  194. 151029 15:39:50 [01] Copying ./mysql/procs_priv.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/procs_priv.MYI  
  195. 151029 15:39:50 [01]        ...done  
  196. 151029 15:39:50 [01] Copying ./mysql/help_category.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/help_category.frm  
  197. 151029 15:39:50 [01]        ...done  
  198. 151029 15:39:50 [01] Copying ./mysql/procs_priv.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/procs_priv.frm  
  199. 151029 15:39:50 [01]        ...done  
  200. 151029 15:39:50 [01] Copying ./mysql/func.MYD to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/func.MYD  
  201. 151029 15:39:50 [01]        ...done  
  202. 151029 15:39:50 [01] Copying ./mysql/func.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/func.frm  
  203. 151029 15:39:50 [01]        ...done  
  204. 151029 15:39:51 [01] Copying ./mysql/proc.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/proc.MYI  
  205. 151029 15:39:51 [01]        ...done  
  206. 151029 15:39:51 [01] Copying ./mysql/general_log.CSM to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/general_log.CSM  
  207. 151029 15:39:51 [01]        ...done  
  208. 151029 15:39:51 [01] Copying ./mysql/time_zone.MYI to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/time_zone.MYI  
  209. 151029 15:39:51 >> log scanned up to (14489531)  
  210. 151029 15:39:51 [01]        ...done  
  211. 151029 15:39:51 [01] Copying ./mysql/slave_master_info.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/slave_master_info.frm  
  212. 151029 15:39:51 [01]        ...done  
  213. 151029 15:39:51 [01] Copying ./mysql/innodb_table_stats.frm to /data/mysql/backup/full/2015-10-29_15-39-38/mysql/innodb_table_stats.frm  
  214. 151029 15:39:51 [01]        ...done  
  215. 151029 15:39:51 [01] Copying ./performance_schema/users.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/users.frm  
  216. 151029 15:39:51 [01]        ...done  
  217. 151029 15:39:51 [01] Copying ./performance_schema/events_waits_history_long.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_waits_history_long.frm  
  218. 151029 15:39:51 [01]        ...done  
  219. 151029 15:39:51 [01] Copying ./performance_schema/events_statements_summary_by_host_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_statements_summary_by_host_by_event_name.frm  
  220. 151029 15:39:51 [01]        ...done  
  221. 151029 15:39:51 [01] Copying ./performance_schema/table_io_waits_summary_by_index_usage.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/table_io_waits_summary_by_index_usage.frm  
  222. 151029 15:39:51 [01]        ...done  
  223. 151029 15:39:52 [01] Copying ./performance_schema/events_waits_history.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_waits_history.frm  
  224. 151029 15:39:52 [01]        ...done  
  225. 151029 15:39:52 [01] Copying ./performance_schema/host_cache.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/host_cache.frm  
  226. 151029 15:39:52 [01]        ...done  
  227. 151029 15:39:52 [01] Copying ./performance_schema/events_statements_summary_by_thread_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_statements_summary_by_thread_by_event_name.frm  
  228. 151029 15:39:52 [01]        ...done  
  229. 151029 15:39:52 >> log scanned up to (14489531)  
  230. 151029 15:39:52 [01] Copying ./performance_schema/session_connect_attrs.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/session_connect_attrs.frm  
  231. 151029 15:39:52 [01]        ...done  
  232. 151029 15:39:52 [01] Copying ./performance_schema/objects_summary_global_by_type.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/objects_summary_global_by_type.frm  
  233. 151029 15:39:52 [01]        ...done  
  234. 151029 15:39:52 [01] Copying ./performance_schema/session_account_connect_attrs.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/session_account_connect_attrs.frm  
  235. 151029 15:39:52 [01]        ...done  
  236. 151029 15:39:52 [01] Copying ./performance_schema/socket_summary_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/socket_summary_by_event_name.frm  
  237. 151029 15:39:52 [01]        ...done  
  238. 151029 15:39:52 [01] Copying ./performance_schema/events_stages_summary_global_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_stages_summary_global_by_event_name.frm  
  239. 151029 15:39:52 [01]        ...done  
  240. 151029 15:39:53 [01] Copying ./performance_schema/rwlock_instances.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/rwlock_instances.frm  
  241. 151029 15:39:53 [01]        ...done  
  242. 151029 15:39:53 [01] Copying ./performance_schema/events_stages_current.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_stages_current.frm  
  243. 151029 15:39:53 [01]        ...done  
  244. 151029 15:39:53 [01] Copying ./performance_schema/file_summary_by_instance.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/file_summary_by_instance.frm  
  245. 151029 15:39:53 [01]        ...done  
  246. 151029 15:39:53 >> log scanned up to (14489531)  
  247. 151029 15:39:53 [01] Copying ./performance_schema/events_waits_summary_by_host_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_waits_summary_by_host_by_event_name.frm  
  248. 151029 15:39:53 [01]        ...done  
  249. 151029 15:39:53 [01] Copying ./performance_schema/performance_timers.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/performance_timers.frm  
  250. 151029 15:39:53 [01]        ...done  
  251. 151029 15:39:53 [01] Copying ./performance_schema/events_waits_summary_by_thread_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_waits_summary_by_thread_by_event_name.frm  
  252. 151029 15:39:53 [01]        ...done  
  253. 151029 15:39:53 [01] Copying ./performance_schema/events_waits_summary_by_user_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_waits_summary_by_user_by_event_name.frm  
  254. 151029 15:39:53 [01]        ...done  
  255. 151029 15:39:53 [01] Copying ./performance_schema/cond_instances.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/cond_instances.frm  
  256. 151029 15:39:53 [01]        ...done  
  257. 151029 15:39:53 [01] Copying ./performance_schema/events_statements_summary_global_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_statements_summary_global_by_event_name.frm  
  258. 151029 15:39:53 [01]        ...done  
  259. 151029 15:39:54 [01] Copying ./performance_schema/setup_timers.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/setup_timers.frm  
  260. 151029 15:39:54 [01]        ...done  
  261. 151029 15:39:54 [01] Copying ./performance_schema/hosts.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/hosts.frm  
  262. 151029 15:39:54 [01]        ...done  
  263. 151029 15:39:54 >> log scanned up to (14489531)  
  264. 151029 15:39:54 [01] Copying ./performance_schema/socket_summary_by_instance.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/socket_summary_by_instance.frm  
  265. 151029 15:39:54 [01]        ...done  
  266. 151029 15:39:54 [01] Copying ./performance_schema/file_instances.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/file_instances.frm  
  267. 151029 15:39:54 [01]        ...done  
  268. 151029 15:39:54 [01] Copying ./performance_schema/table_lock_waits_summary_by_table.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/table_lock_waits_summary_by_table.frm  
  269. 151029 15:39:54 [01]        ...done  
  270. 151029 15:39:54 [01] Copying ./performance_schema/events_statements_summary_by_user_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_statements_summary_by_user_by_event_name.frm  
  271. 151029 15:39:54 [01]        ...done  
  272. 151029 15:39:54 [01] Copying ./performance_schema/events_waits_current.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_waits_current.frm  
  273. 151029 15:39:55 [01]        ...done  
  274. 151029 15:39:55 [01] Copying ./performance_schema/events_statements_summary_by_digest.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_statements_summary_by_digest.frm  
  275. 151029 15:39:55 [01]        ...done  
  276. 151029 15:39:55 [01] Copying ./performance_schema/events_stages_history.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_stages_history.frm  
  277. 151029 15:39:55 [01]        ...done  
  278. 151029 15:39:55 >> log scanned up to (14489531)  
  279. 151029 15:39:55 [01] Copying ./performance_schema/file_summary_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/file_summary_by_event_name.frm  
  280. 151029 15:39:55 [01]        ...done  
  281. 151029 15:39:55 [01] Copying ./performance_schema/table_io_waits_summary_by_table.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/table_io_waits_summary_by_table.frm  
  282. 151029 15:39:55 [01]        ...done  
  283. 151029 15:39:55 [01] Copying ./performance_schema/events_stages_summary_by_thread_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_stages_summary_by_thread_by_event_name.frm  
  284. 151029 15:39:55 [01]        ...done  
  285. 151029 15:39:55 [01] Copying ./performance_schema/threads.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/threads.frm  
  286. 151029 15:39:55 [01]        ...done  
  287. 151029 15:39:55 [01] Copying ./performance_schema/accounts.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/accounts.frm  
  288. 151029 15:39:55 [01]        ...done  
  289. 151029 15:39:56 [01] Copying ./performance_schema/events_waits_summary_global_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_waits_summary_global_by_event_name.frm  
  290. 151029 15:39:56 [01]        ...done  
  291. 151029 15:39:56 [01] Copying ./performance_schema/setup_objects.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/setup_objects.frm  
  292. 151029 15:39:56 [01]        ...done  
  293. 151029 15:39:56 [01] Copying ./performance_schema/events_statements_current.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_statements_current.frm  
  294. 151029 15:39:56 [01]        ...done  
  295. 151029 15:39:56 >> log scanned up to (14489531)  
  296. 151029 15:39:56 [01] Copying ./performance_schema/socket_instances.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/socket_instances.frm  
  297. 151029 15:39:56 [01]        ...done  
  298. 151029 15:39:56 [01] Copying ./performance_schema/setup_actors.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/setup_actors.frm  
  299. 151029 15:39:56 [01]        ...done  
  300. 151029 15:39:56 [01] Copying ./performance_schema/events_stages_summary_by_account_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_stages_summary_by_account_by_event_name.frm  
  301. 151029 15:39:56 [01]        ...done  
  302. 151029 15:39:56 [01] Copying ./performance_schema/events_stages_summary_by_host_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_stages_summary_by_host_by_event_name.frm  
  303. 151029 15:39:56 [01]        ...done  
  304. 151029 15:39:56 [01] Copying ./performance_schema/db.opt to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/db.opt  
  305. 151029 15:39:56 [01]        ...done  
  306. 151029 15:39:57 [01] Copying ./performance_schema/events_stages_summary_by_user_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_stages_summary_by_user_by_event_name.frm  
  307. 151029 15:39:57 [01]        ...done  
  308. 151029 15:39:57 [01] Copying ./performance_schema/events_statements_history.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_statements_history.frm  
  309. 151029 15:39:57 [01]        ...done  
  310. 151029 15:39:57 [01] Copying ./performance_schema/events_waits_summary_by_account_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_waits_summary_by_account_by_event_name.frm  
  311. 151029 15:39:57 [01]        ...done  
  312. 151029 15:39:57 >> log scanned up to (14489531)  
  313. 151029 15:39:57 [01] Copying ./performance_schema/events_waits_summary_by_instance.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_waits_summary_by_instance.frm  
  314. 151029 15:39:57 [01]        ...done  
  315. 151029 15:39:57 [01] Copying ./performance_schema/setup_consumers.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/setup_consumers.frm  
  316. 151029 15:39:57 [01]        ...done  
  317. 151029 15:39:57 [01] Copying ./performance_schema/setup_instruments.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/setup_instruments.frm  
  318. 151029 15:39:57 [01]        ...done  
  319. 151029 15:39:57 [01] Copying ./performance_schema/mutex_instances.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/mutex_instances.frm  
  320. 151029 15:39:57 [01]        ...done  
  321. 151029 15:39:57 [01] Copying ./performance_schema/events_statements_history_long.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_statements_history_long.frm  
  322. 151029 15:39:57 [01]        ...done  
  323. 151029 15:39:57 [01] Copying ./performance_schema/events_statements_summary_by_account_by_event_name.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_statements_summary_by_account_by_event_name.frm  
  324. 151029 15:39:58 [01]        ...done  
  325. 151029 15:39:58 [01] Copying ./performance_schema/events_stages_history_long.frm to /data/mysql/backup/full/2015-10-29_15-39-38/performance_schema/events_stages_history_long.frm  
  326. 151029 15:39:58 [01]        ...done  
  327. 151029 15:39:58 Finished backing up non-InnoDB tables and files  
  328. 151029 15:39:58 Executing LOCK BINLOG FOR BACKUP...  
  329. 151029 15:39:58 Executing FLUSH NO_WRITE_TO_BINLOG ENGINE LOGS...  
  330. xtrabackup: The latest check point (for incremental): '14489531'  
  331. xtrabackup: Stopping log copying thread.  
  332. .151029 15:39:58 >> log scanned up to (14489531)  
  333.   
  334. 151029 15:39:58 Executing UNLOCK BINLOG  
  335. 151029 15:39:58 Executing UNLOCK TABLES  
  336. 151029 15:39:58 All tables unlocked  
  337. 151029 15:39:58 Backup created in directory '/data/mysql/backup/full/2015-10-29_15-39-38'  
  338. 151029 15:39:58 [00] Writing backup-my.cnf  
  339. 151029 15:39:58 [00]        ...done  
  340. 151029 15:39:58 [00] Writing xtrabackup_info  
  341. 151029 15:39:58 [00]        ...done  
  342. xtrabackup: Transaction log of lsn (14489531) to (14489531) was copied.  
  343. 151029 15:39:58 completed OK!  
把所有那些合在一起的备份进行应用,并回滚未提交的事务:
[root@rh64 full]# innobackupex --user='bakusr' --password='oracle' --apply-log --use-memory=1g /data/mysql/backup/full


[html] view plain copy print ?
  1. 151029 16:31:54 innobackupex: Starting the apply-log operation  
  2. IMPORTANT: Please check that the apply-log run completes successfully.  
  3.            At the end of a successful apply-log run innobackupex  
  4.            prints "completed OK!".  
  5. innobackupex version 2.3.2 based on MySQL server 5.6.24 Linux (x86_64) (revision id: 306a2e0)  
  6. xtrabackup: cd to /data/mysql/backup/full  
  7. xtrabackup: This target seems to be already prepared.  
  8. xtrabackup: notice: xtrabackup_logfile was already used to '--prepare'.  
  9. xtrabackup: using the following InnoDB configuration for recovery:  
  10. xtrabackup:   innodb_data_home_dir = ./  
  11. xtrabackup:   innodb_data_file_path = ibdata1:12M;ibdata2:10M:autoextend  
  12. xtrabackup:   innodb_log_group_home_dir = ./  
  13. xtrabackup:   innodb_log_files_in_group = 2  
  14. xtrabackup:   innodb_log_file_size = 50331648  
  15. xtrabackup: using the following InnoDB configuration for recovery:  
  16. xtrabackup:   innodb_data_home_dir = ./  
  17. xtrabackup:   innodb_data_file_path = ibdata1:12M;ibdata2:10M:autoextend  
  18. xtrabackup:   innodb_log_group_home_dir = ./  
  19. xtrabackup:   innodb_log_files_in_group = 2  
  20. xtrabackup:   innodb_log_file_size = 50331648  
  21. xtrabackup: Starting InnoDB instance for recovery.  
  22. xtrabackup: Using 1073741824 bytes for buffer pool (set by --use-memory parameter)  
  23. InnoDB: Using atomics to ref count buffer pool pages  
  24. InnoDB: The InnoDB memory heap is disabled  
  25. InnoDB: Mutexes and rw_locks use GCC atomic builtins  
  26. InnoDB: Memory barrier is not used  
  27. InnoDB: Compressed tables use zlib 1.2.3  
  28. InnoDB: Using CPU crc32 instructions  
  29. InnoDB: Initializing buffer pool, size = 1.0G  
  30. InnoDB: Completed initialization of buffer pool  
  31. InnoDB: Highest supported file format is Barracuda.  
  32. InnoDB: 128 rollback segment(s) are active.  
  33. InnoDB: Waiting for purge to start  
  34. InnoDB: 5.6.24 started; log sequence number 13254698  
  35.   
  36. xtrabackup: starting shutdown with innodb_fast_shutdown = 1  
  37. InnoDB: FTS optimize thread exiting.  
  38. InnoDB: Starting shutdown...  
  39. InnoDB: Shutdown completed; log sequence number 13254708  
  40. xtrabackup: using the following InnoDB configuration for recovery:  
  41. xtrabackup:   innodb_data_home_dir = ./  
  42. xtrabackup:   innodb_data_file_path = ibdata1:12M;ibdata2:10M:autoextend  
  43. xtrabackup:   innodb_log_group_home_dir = ./  
  44. xtrabackup:   innodb_log_files_in_group = 2  
  45. xtrabackup:   innodb_log_file_size = 50331648  
  46. InnoDB: Using atomics to ref count buffer pool pages  
  47. InnoDB: The InnoDB memory heap is disabled  
  48. InnoDB: Mutexes and rw_locks use GCC atomic builtins  
  49. InnoDB: Memory barrier is not used  
  50. InnoDB: Compressed tables use zlib 1.2.3  
  51. InnoDB: Using CPU crc32 instructions  
  52. InnoDB: Initializing buffer pool, size = 1.0G  
  53. InnoDB: Completed initialization of buffer pool  
  54. InnoDB: Highest supported file format is Barracuda.  
  55. InnoDB: 128 rollback segment(s) are active.  
  56. InnoDB: Waiting for purge to start  
  57. InnoDB: 5.6.24 started; log sequence number 13254708  
  58. xtrabackup: starting shutdown with innodb_fast_shutdown = 1  
  59. InnoDB: FTS optimize thread exiting.  
  60. InnoDB: Starting shutdown...  
  61. InnoDB: Shutdown completed; log sequence number 13254718  
  62. 151029 16:31:58 completed OK!  
3、把恢复完的备份数据拷贝到数据库数据存储的目录下:
1)关闭数据库
[root@rh64 inc_2]# mysqladmin shutdown -u root -p

Enter password: 
[root@rh64 inc_2]# netstat -an |grep :3306
[root@rh64 inc_2]# mysqladmin status

mysqladmin: connect to server at 'localhost' failed
error: 'Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' (2)'
Check that mysqld is running and that the socket: '/var/lib/mysql/mysql.sock' exists!

建立新的数据库存储目录:
[root@rh64 inc_2]# mv mysql  mysql.old
[root@rh64 inc_2]# mkdir -p  /var/lib/mysql

查看最近的备份:
[root@rh64 full]# ls -lt

total 122928
[html] view plain copy print ?
  1. -rw-r----- 1 root root 12582912 Oct 29 16:55 ibdata1  
  2. -rw-r----- 1 root root 10485760 Oct 29 16:55 ibdata2  
  3. -rw-r--r-- 1 root root 50331648 Oct 29 16:55 ib_logfile0  
  4. -rw-r----- 1 root root      115 Oct 29 16:55 xtrabackup_checkpoints  
  5. drwx------ 6 root root     4096 Oct 29 16:54 2015-10-29_16-54-06  
  6. drwx------ 6 root root     4096 Oct 29 16:53 2015-10-29_16-53-16  
  7. drwx------ 4 root root     4096 Oct 29 16:52 2015-10-29_16-52-46  
  8. drwx------ 2 root root     4096 Oct 29 16:51 2015-10-29_16-51-54  
  9. drwx------ 2 root root     4096 Oct 29 16:50 2015-10-29_16-50-51  
  10. -rw-r--r-- 1 root root 50331648 Oct 29 16:49 ib_logfile1  
  11. -rw-r----- 1 root root  2097152 Oct 29 16:49 xtrabackup_logfile  
  12. -rw-r----- 1 root root      524 Oct 29 16:43 xtrabackup_info  
  13. -rw-r----- 1 root root      398 Oct 29 16:43 backup-my.cnf  
  14. drwx------ 2 root root     4096 Oct 29 16:43 performance_schema  
  15. drwx------ 2 root root     4096 Oct 29 16:43 mysql  
  16. drwx------ 2 root root     4096 Oct 29 16:43 test  
  17. drwx------ 2 root root     4096 Oct 29 16:43 prod  
选择最后合成的备份目录:2015-10-29_16-54-06

拷贝备份数据到数据库存储目录:
[root@rh64 lib]# innobackupex --default-files=/tmp/my.cnf --copy-back --resync /data/mysql/backup/full/2015-10-29_16-54-06

[html] view plain copy print ?
  1. 151029 15:45:46 innobackupex: Starting the copy-back operation  
  2. IMPORTANT: Please check that the copy-back run completes successfully.  
  3.            At the end of a successful copy-back run innobackupex  
  4.            prints "completed OK!".  
  5. innobackupex version 2.3.2 based on MySQL server 5.6.24 Linux (x86_64) (revision id: 306a2e0)  
  6. 151029 15:45:46 [01] Copying ib_logfile0 to /var/lib/mysql/ib_logfile0  
  7. 151029 15:45:46 [01]        ...done  
  8. 151029 15:45:47 [01] Copying ib_logfile1 to /var/lib/mysql/ib_logfile1  
  9. 151029 15:45:47 [01]        ...done  
  10. 151029 15:45:48 [01] Copying ibdata1 to /var/lib/mysql/ibdata1  
  11. 151029 15:45:49 [01]        ...done  
  12. 151029 15:45:49 [01] Copying ibdata2 to /var/lib/mysql/ibdata2  
  13. 151029 15:45:49 [01]        ...done  
  14. 151029 15:45:49 [01] Copying ./2015-10-29_15-39-38/xtrabackup_info to /var/lib/mysql/2015-10-29_15-39-38/xtrabackup_info  
  15. 151029 15:45:49 [01]        ...done  
  16. 151029 15:45:49 [01] Copying ./2015-10-29_15-37-38/xtrabackup_info to /var/lib/mysql/2015-10-29_15-37-38/xtrabackup_info  
  17. 151029 15:45:49 [01]        ...done  
  18. 151029 15:45:50 [01] Copying ./prod/t1.frm to /var/lib/mysql/prod/t1.frm  
  19. 151029 15:45:50 [01]        ...done  
  20. 151029 15:45:50 [01] Copying ./prod/t2.ibd to /var/lib/mysql/prod/t2.ibd  
  21. 151029 15:45:50 [01]        ...done  
  22. 151029 15:45:50 [01] Copying ./prod/t2.frm to /var/lib/mysql/prod/t2.frm  
  23. 151029 15:45:50 [01]        ...done  
  24. 151029 15:45:50 [01] Copying ./prod/t1.ibd to /var/lib/mysql/prod/t1.ibd  
  25. 151029 15:45:50 [01]        ...done  
  26. 151029 15:45:51 [01] Copying ./prod/t3.frm to /var/lib/mysql/prod/t3.frm  
  27. 151029 15:45:51 [01]        ...done  
  28. 151029 15:45:51 [01] Copying ./prod/db.opt to /var/lib/mysql/prod/db.opt  
  29. 151029 15:45:51 [01]        ...done  
  30. 151029 15:45:51 [01] Copying ./prod/t3.ibd to /var/lib/mysql/prod/t3.ibd  
  31. 151029 15:45:51 [01]        ...done  
  32. 151029 15:45:51 [01] Creating directory /var/lib/mysql/2015-10-29_15-36-34  
  33. 151029 15:45:51 [01] ...done.151029 15:45:51 [01] Creating directory /var/lib/mysql/2015-10-29_15-34-59  
  34. 151029 15:45:51 [01] ...done.151029 15:45:51 [01] Copying ./test/db.opt to /var/lib/mysql/test/db.opt  
  35. 151029 15:45:51 [01]        ...done  
  36. 151029 15:45:51 [01] Copying ./mysql/time_zone_name.MYD to /var/lib/mysql/mysql/time_zone_name.MYD  
  37. 151029 15:45:51 [01]        ...done  
  38. 151029 15:45:51 [01] Copying ./mysql/help_topic.frm to /var/lib/mysql/mysql/help_topic.frm  
  39. 151029 15:45:51 [01]        ...done  
  40. 151029 15:45:51 [01] Copying ./mysql/event.frm to /var/lib/mysql/mysql/event.frm  
  41. 151029 15:45:51 [01]        ...done  
  42. 151029 15:45:51 [01] Copying ./mysql/time_zone.MYD to /var/lib/mysql/mysql/time_zone.MYD  
  43. 151029 15:45:51 [01]        ...done  
  44. 151029 15:45:51 [01] Copying ./mysql/slow_log.CSV to /var/lib/mysql/mysql/slow_log.CSV  
  45. 151029 15:45:51 [01]        ...done  
  46. 151029 15:45:51 [01] Copying ./mysql/innodb_index_stats.frm to /var/lib/mysql/mysql/innodb_index_stats.frm  
  47. 151029 15:45:51 [01]        ...done  
  48. 151029 15:45:51 [01] Copying ./mysql/columns_priv.MYI to /var/lib/mysql/mysql/columns_priv.MYI  
  49. 151029 15:45:52 [01]        ...done  
  50. 151029 15:45:52 [01] Copying ./mysql/plugin.MYI to /var/lib/mysql/mysql/plugin.MYI  
  51. 151029 15:45:52 [01]        ...done  
  52. 151029 15:45:52 [01] Copying ./mysql/time_zone_leap_second.frm to /var/lib/mysql/mysql/time_zone_leap_second.frm  
  53. 151029 15:45:52 [01]        ...done  
  54. 151029 15:45:52 [01] Copying ./mysql/time_zone_transition_type.MYI to /var/lib/mysql/mysql/time_zone_transition_type.MYI  
  55. 151029 15:45:52 [01]        ...done  
  56. 151029 15:45:52 [01] Copying ./mysql/proc.frm to /var/lib/mysql/mysql/proc.frm  
  57. 151029 15:45:52 [01]        ...done  
  58. 151029 15:45:52 [01] Copying ./mysql/procs_priv.MYD to /var/lib/mysql/mysql/procs_priv.MYD  
  59. 151029 15:45:52 [01]        ...done  
  60. 151029 15:45:52 [01] Copying ./mysql/proxies_priv.MYI to /var/lib/mysql/mysql/proxies_priv.MYI  
  61. 151029 15:45:52 [01]        ...done  
  62. 151029 15:45:52 [01] Copying ./mysql/slave_worker_info.ibd to /var/lib/mysql/mysql/slave_worker_info.ibd  
  63. 151029 15:45:52 [01]        ...done  
  64. 151029 15:45:52 [01] Copying ./mysql/ndb_binlog_index.MYI to /var/lib/mysql/mysql/ndb_binlog_index.MYI  
  65. 151029 15:45:52 [01]        ...done  
  66. 151029 15:45:53 [01] Copying ./mysql/servers.MYI to /var/lib/mysql/mysql/servers.MYI  
  67. 151029 15:45:53 [01]        ...done  
  68. 151029 15:45:53 [01] Copying ./mysql/slow_log.frm to /var/lib/mysql/mysql/slow_log.frm  
  69. 151029 15:45:53 [01]        ...done  
  70. 151029 15:45:53 [01] Copying ./mysql/help_relation.MYD to /var/lib/mysql/mysql/help_relation.MYD  
  71. 151029 15:45:53 [01]        ...done  
  72. 151029 15:45:53 [01] Copying ./mysql/user.frm to /var/lib/mysql/mysql/user.frm  
  73. 151029 15:45:53 [01]        ...done  
  74. 151029 15:45:53 [01] Copying ./mysql/plugin.frm to /var/lib/mysql/mysql/plugin.frm  
  75. 151029 15:45:53 [01]        ...done  
  76. 151029 15:45:53 [01] Copying ./mysql/time_zone_name.frm to /var/lib/mysql/mysql/time_zone_name.frm  
  77. 151029 15:45:53 [01]        ...done  
  78. 151029 15:45:53 [01] Copying ./mysql/user.MYI to /var/lib/mysql/mysql/user.MYI  
  79. 151029 15:45:53 [01]        ...done  
  80. 151029 15:45:53 [01] Copying ./mysql/slave_master_info.ibd to /var/lib/mysql/mysql/slave_master_info.ibd  
  81. 151029 15:45:53 [01]        ...done  
  82. 151029 15:45:54 [01] Copying ./mysql/help_relation.frm to /var/lib/mysql/mysql/help_relation.frm  
  83. 151029 15:45:54 [01]        ...done  
  84. 151029 15:45:54 [01] Copying ./mysql/slow_log.CSM to /var/lib/mysql/mysql/slow_log.CSM  
  85. 151029 15:45:54 [01]        ...done  
  86. 151029 15:45:54 [01] Copying ./mysql/time_zone_transition.MYD to /var/lib/mysql/mysql/time_zone_transition.MYD  
  87. 151029 15:45:54 [01]        ...done  
  88. 151029 15:45:54 [01] Copying ./mysql/help_category.MYI to /var/lib/mysql/mysql/help_category.MYI  
  89. 151029 15:45:54 [01]        ...done  
  90. 151029 15:45:54 [01] Copying ./mysql/proc.MYD to /var/lib/mysql/mysql/proc.MYD  
  91. 151029 15:45:54 [01]        ...done  
  92. 151029 15:45:54 [01] Copying ./mysql/slave_relay_log_info.ibd to /var/lib/mysql/mysql/slave_relay_log_info.ibd  
  93. 151029 15:45:54 [01]        ...done  
  94. 151029 15:45:54 [01] Copying ./mysql/db.MYD to /var/lib/mysql/mysql/db.MYD  
  95. 151029 15:45:54 [01]        ...done  
  96. 151029 15:45:54 [01] Copying ./mysql/tables_priv.MYD to /var/lib/mysql/mysql/tables_priv.MYD  
  97. 151029 15:45:54 [01]        ...done  
  98. 151029 15:45:54 [01] Copying ./mysql/time_zone_leap_second.MYI to /var/lib/mysql/mysql/time_zone_leap_second.MYI  
  99. 151029 15:45:54 [01]        ...done  
  100. 151029 15:45:55 [01] Copying ./mysql/help_relation.MYI to /var/lib/mysql/mysql/help_relation.MYI  
  101. 151029 15:45:55 [01]        ...done  
  102. 151029 15:45:55 [01] Copying ./mysql/ndb_binlog_index.MYD to /var/lib/mysql/mysql/ndb_binlog_index.MYD  
  103. 151029 15:45:55 [01]        ...done  
  104. 151029 15:45:55 [01] Copying ./mysql/slave_worker_info.frm to /var/lib/mysql/mysql/slave_worker_info.frm  
  105. 151029 15:45:55 [01]        ...done  
  106. 151029 15:45:55 [01] Copying ./mysql/time_zone.frm to /var/lib/mysql/mysql/time_zone.frm  
  107. 151029 15:45:55 [01]        ...done  
  108. 151029 15:45:55 [01] Copying ./mysql/slave_relay_log_info.frm to /var/lib/mysql/mysql/slave_relay_log_info.frm  
  109. 151029 15:45:55 [01]        ...done  
  110. 151029 15:45:55 [01] Copying ./mysql/columns_priv.MYD to /var/lib/mysql/mysql/columns_priv.MYD  
  111. 151029 15:45:55 [01]        ...done  
  112. 151029 15:45:55 [01] Copying ./mysql/time_zone_transition_type.MYD to /var/lib/mysql/mysql/time_zone_transition_type.MYD  
  113. 151029 15:45:55 [01]        ...done  
  114. 151029 15:45:55 [01] Copying ./mysql/user.MYD to /var/lib/mysql/mysql/user.MYD  
  115. 151029 15:45:55 [01]        ...done  
  116. 151029 15:45:55 [01] Copying ./mysql/tables_priv.frm to /var/lib/mysql/mysql/tables_priv.frm  
  117. 151029 15:45:55 [01]        ...done  
  118. 151029 15:45:56 [01] Copying ./mysql/help_category.MYD to /var/lib/mysql/mysql/help_category.MYD  
  119. 151029 15:45:56 [01]        ...done  
  120. 151029 15:45:56 [01] Copying ./mysql/help_keyword.MYD to /var/lib/mysql/mysql/help_keyword.MYD  
  121. 151029 15:45:56 [01]        ...done  
  122. 151029 15:45:56 [01] Copying ./mysql/time_zone_transition.frm to /var/lib/mysql/mysql/time_zone_transition.frm  
  123. 151029 15:45:56 [01]        ...done  
  124. 151029 15:45:56 [01] Copying ./mysql/servers.frm to /var/lib/mysql/mysql/servers.frm  
  125. 151029 15:45:56 [01]        ...done  
  126. 151029 15:45:56 [01] Copying ./mysql/general_log.frm to /var/lib/mysql/mysql/general_log.frm  
  127. 151029 15:45:56 [01]        ...done  
  128. 151029 15:45:56 [01] Copying ./mysql/help_keyword.frm to /var/lib/mysql/mysql/help_keyword.frm  
  129. 151029 15:45:56 [01]        ...done  
  130. 151029 15:45:56 [01] Copying ./mysql/time_zone_transition_type.frm to /var/lib/mysql/mysql/time_zone_transition_type.frm  
  131. 151029 15:45:56 [01]        ...done  
  132. 151029 15:45:56 [01] Copying ./mysql/columns_priv.frm to /var/lib/mysql/mysql/columns_priv.frm  
  133. 151029 15:45:56 [01]        ...done  
  134. 151029 15:45:57 [01] Copying ./mysql/proxies_priv.frm to /var/lib/mysql/mysql/proxies_priv.frm  
  135. 151029 15:45:57 [01]        ...done  
  136. 151029 15:45:57 [01] Copying ./mysql/help_keyword.MYI to /var/lib/mysql/mysql/help_keyword.MYI  
  137. 151029 15:45:57 [01]        ...done  
  138. 151029 15:45:57 [01] Copying ./mysql/general_log.CSV to /var/lib/mysql/mysql/general_log.CSV  
  139. 151029 15:45:57 [01]        ...done  
  140. 151029 15:45:57 [01] Copying ./mysql/event.MYD to /var/lib/mysql/mysql/event.MYD  
  141. 151029 15:45:57 [01]        ...done  
  142. 151029 15:45:57 [01] Copying ./mysql/plugin.MYD to /var/lib/mysql/mysql/plugin.MYD  
  143. 151029 15:45:57 [01]        ...done  
  144. 151029 15:45:57 [01] Copying ./mysql/proxies_priv.MYD to /var/lib/mysql/mysql/proxies_priv.MYD  
  145. 151029 15:45:57 [01]        ...done  
  146. 151029 15:45:57 [01] Copying ./mysql/servers.MYD to /var/lib/mysql/mysql/servers.MYD  
  147. 151029 15:45:57 [01]        ...done  
  148. 151029 15:45:57 [01] Copying ./mysql/innodb_index_stats.ibd to /var/lib/mysql/mysql/innodb_index_stats.ibd  
  149. 151029 15:45:57 [01]        ...done  
  150. 151029 15:45:57 [01] Copying ./mysql/event.MYI to /var/lib/mysql/mysql/event.MYI  
  151. 151029 15:45:57 [01]        ...done  
  152. 151029 15:45:58 [01] Copying ./mysql/time_zone_transition.MYI to /var/lib/mysql/mysql/time_zone_transition.MYI  
  153. 151029 15:45:58 [01]        ...done  
  154. 151029 15:45:58 [01] Copying ./mysql/tables_priv.MYI to /var/lib/mysql/mysql/tables_priv.MYI  
  155. 151029 15:45:58 [01]        ...done  
  156. 151029 15:45:58 [01] Copying ./mysql/ndb_binlog_index.frm to /var/lib/mysql/mysql/ndb_binlog_index.frm  
  157. 151029 15:45:58 [01]        ...done  
  158. 151029 15:45:58 [01] Copying ./mysql/db.MYI to /var/lib/mysql/mysql/db.MYI  
  159. 151029 15:45:58 [01]        ...done  
  160. 151029 15:45:58 [01] Copying ./mysql/time_zone_name.MYI to /var/lib/mysql/mysql/time_zone_name.MYI  
  161. 151029 15:45:58 [01]        ...done  
  162. 151029 15:45:58 [01] Copying ./mysql/time_zone_leap_second.MYD to /var/lib/mysql/mysql/time_zone_leap_second.MYD  
  163. 151029 15:45:58 [01]        ...done  
  164. 151029 15:45:58 [01] Copying ./mysql/help_topic.MYD to /var/lib/mysql/mysql/help_topic.MYD  
  165. 151029 15:45:58 [01]        ...done  
  166. 151029 15:45:58 [01] Copying ./mysql/help_topic.MYI to /var/lib/mysql/mysql/help_topic.MYI  
  167. 151029 15:45:58 [01]        ...done  
  168. 151029 15:45:59 [01] Copying ./mysql/db.frm to /var/lib/mysql/mysql/db.frm  
  169. 151029 15:45:59 [01]        ...done  
  170. 151029 15:45:59 [01] Copying ./mysql/func.MYI to /var/lib/mysql/mysql/func.MYI  
  171. 151029 15:45:59 [01]        ...done  
  172. 151029 15:45:59 [01] Copying ./mysql/procs_priv.MYI to /var/lib/mysql/mysql/procs_priv.MYI  
  173. 151029 15:45:59 [01]        ...done  
  174. 151029 15:45:59 [01] Copying ./mysql/help_category.frm to /var/lib/mysql/mysql/help_category.frm  
  175. 151029 15:45:59 [01]        ...done  
  176. 151029 15:45:59 [01] Copying ./mysql/procs_priv.frm to /var/lib/mysql/mysql/procs_priv.frm  
  177. 151029 15:45:59 [01]        ...done  
  178. 151029 15:45:59 [01] Copying ./mysql/func.MYD to /var/lib/mysql/mysql/func.MYD  
  179. 151029 15:45:59 [01]        ...done  
  180. 151029 15:45:59 [01] Copying ./mysql/func.frm to /var/lib/mysql/mysql/func.frm  
  181. 151029 15:45:59 [01]        ...done  
  182. 151029 15:45:59 [01] Copying ./mysql/proc.MYI to /var/lib/mysql/mysql/proc.MYI  
  183. 151029 15:45:59 [01]        ...done  
  184. 151029 15:46:00 [01] Copying ./mysql/innodb_table_stats.ibd to /var/lib/mysql/mysql/innodb_table_stats.ibd  
  185. 151029 15:46:00 [01]        ...done  
  186. 151029 15:46:00 [01] Copying ./mysql/general_log.CSM to /var/lib/mysql/mysql/general_log.CSM  
  187. 151029 15:46:00 [01]        ...done  
  188. 151029 15:46:00 [01] Copying ./mysql/time_zone.MYI to /var/lib/mysql/mysql/time_zone.MYI  
  189. 151029 15:46:00 [01]        ...done  
  190. 151029 15:46:00 [01] Copying ./mysql/slave_master_info.frm to /var/lib/mysql/mysql/slave_master_info.frm  
  191. 151029 15:46:00 [01]        ...done  
  192. 151029 15:46:00 [01] Copying ./mysql/innodb_table_stats.frm to /var/lib/mysql/mysql/innodb_table_stats.frm  
  193. 151029 15:46:00 [01]        ...done  
  194. 151029 15:46:00 [01] Copying ./performance_schema/users.frm to /var/lib/mysql/performance_schema/users.frm  
  195. 151029 15:46:00 [01]        ...done  
  196. 151029 15:46:00 [01] Copying ./performance_schema/events_waits_history_long.frm to /var/lib/mysql/performance_schema/events_waits_history_long.frm  
  197. 151029 15:46:00 [01]        ...done  
  198. 151029 15:46:00 [01] Copying ./performance_schema/events_statements_summary_by_host_by_event_name.frm to /var/lib/mysql/performance_schema/events_statements_summary_by_host_by_event_name.frm  
  199. 151029 15:46:00 [01]        ...done  
  200. 151029 15:46:00 [01] Copying ./performance_schema/table_io_waits_summary_by_index_usage.frm to /var/lib/mysql/performance_schema/table_io_waits_summary_by_index_usage.frm  
  201. 151029 15:46:00 [01]        ...done  
  202. 151029 15:46:01 [01] Copying ./performance_schema/events_waits_history.frm to /var/lib/mysql/performance_schema/events_waits_history.frm  
  203. 151029 15:46:01 [01]        ...done  
  204. 151029 15:46:01 [01] Copying ./performance_schema/host_cache.frm to /var/lib/mysql/performance_schema/host_cache.frm  
  205. 151029 15:46:01 [01]        ...done  
  206. 151029 15:46:01 [01] Copying ./performance_schema/events_statements_summary_by_thread_by_event_name.frm to /var/lib/mysql/performance_schema/events_statements_summary_by_thread_by_event_name.frm  
  207. 151029 15:46:01 [01]        ...done  
  208. 151029 15:46:01 [01] Copying ./performance_schema/session_connect_attrs.frm to /var/lib/mysql/performance_schema/session_connect_attrs.frm  
  209. 151029 15:46:01 [01]        ...done  
  210. 151029 15:46:01 [01] Copying ./performance_schema/objects_summary_global_by_type.frm to /var/lib/mysql/performance_schema/objects_summary_global_by_type.frm  
  211. 151029 15:46:01 [01]        ...done  
  212. 151029 15:46:01 [01] Copying ./performance_schema/session_account_connect_attrs.frm to /var/lib/mysql/performance_schema/session_account_connect_attrs.frm  
  213. 151029 15:46:01 [01]        ...done  
  214. 151029 15:46:01 [01] Copying ./performance_schema/socket_summary_by_event_name.frm to /var/lib/mysql/performance_schema/socket_summary_by_event_name.frm  
  215. 151029 15:46:01 [01]        ...done  
  216. 151029 15:46:01 [01] Copying ./performance_schema/events_stages_summary_global_by_event_name.frm to /var/lib/mysql/performance_schema/events_stages_summary_global_by_event_name.frm  
  217. 151029 15:46:01 [01]        ...done  
  218. 151029 15:46:02 [01] Copying ./performance_schema/rwlock_instances.frm to /var/lib/mysql/performance_schema/rwlock_instances.frm  
  219. 151029 15:46:02 [01]        ...done  
  220. 151029 15:46:02 [01] Copying ./performance_schema/events_stages_current.frm to /var/lib/mysql/performance_schema/events_stages_current.frm  
  221. 151029 15:46:02 [01]        ...done  
  222. 151029 15:46:02 [01] Copying ./performance_schema/file_summary_by_instance.frm to /var/lib/mysql/performance_schema/file_summary_by_instance.frm  
  223. 151029 15:46:02 [01]        ...done  
  224. 151029 15:46:02 [01] Copying ./performance_schema/events_waits_summary_by_host_by_event_name.frm to /var/lib/mysql/performance_schema/events_waits_summary_by_host_by_event_name.frm  
  225. 151029 15:46:02 [01]        ...done  
  226. 151029 15:46:02 [01] Copying ./performance_schema/performance_timers.frm to /var/lib/mysql/performance_schema/performance_timers.frm  
  227. 151029 15:46:02 [01]        ...done  
  228. 151029 15:46:02 [01] Copying ./performance_schema/events_waits_summary_by_thread_by_event_name.frm to /var/lib/mysql/performance_schema/events_waits_summary_by_thread_by_event_name.frm  
  229. 151029 15:46:02 [01]        ...done  
  230. 151029 15:46:02 [01] Copying ./performance_schema/events_waits_summary_by_user_by_event_name.frm to /var/lib/mysql/performance_schema/events_waits_summary_by_user_by_event_name.frm  
  231. 151029 15:46:02 [01]        ...done  
  232. 151029 15:46:02 [01] Copying ./performance_schema/cond_instances.frm to /var/lib/mysql/performance_schema/cond_instances.frm  
  233. 151029 15:46:03 [01]        ...done  
  234. 151029 15:46:03 [01] Copying ./performance_schema/events_statements_summary_global_by_event_name.frm to /var/lib/mysql/performance_schema/events_statements_summary_global_by_event_name.frm  
  235. 151029 15:46:03 [01]        ...done  
  236. 151029 15:46:03 [01] Copying ./performance_schema/setup_timers.frm to /var/lib/mysql/performance_schema/setup_timers.frm  
  237. 151029 15:46:03 [01]        ...done  
  238. 151029 15:46:03 [01] Copying ./performance_schema/hosts.frm to /var/lib/mysql/performance_schema/hosts.frm  
  239. 151029 15:46:03 [01]        ...done  
  240. 151029 15:46:03 [01] Copying ./performance_schema/socket_summary_by_instance.frm to /var/lib/mysql/performance_schema/socket_summary_by_instance.frm  
  241. 151029 15:46:03 [01]        ...done  
  242. 151029 15:46:03 [01] Copying ./performance_schema/file_instances.frm to /var/lib/mysql/performance_schema/file_instances.frm  
  243. 151029 15:46:03 [01]        ...done  
  244. 151029 15:46:03 [01] Copying ./performance_schema/table_lock_waits_summary_by_table.frm to /var/lib/mysql/performance_schema/table_lock_waits_summary_by_table.frm  
  245. 151029 15:46:03 [01]        ...done  
  246. 151029 15:46:03 [01] Copying ./performance_schema/events_statements_summary_by_user_by_event_name.frm to /var/lib/mysql/performance_schema/events_statements_summary_by_user_by_event_name.frm  
  247. 151029 15:46:03 [01]        ...done  
  248. 151029 15:46:04 [01] Copying ./performance_schema/events_waits_current.frm to /var/lib/mysql/performance_schema/events_waits_current.frm  
  249. 151029 15:46:04 [01]        ...done  
  250. 151029 15:46:04 [01] Copying ./performance_schema/events_statements_summary_by_digest.frm to /var/lib/mysql/performance_schema/events_statements_summary_by_digest.frm  
  251. 151029 15:46:04 [01]        ...done  
  252. 151029 15:46:04 [01] Copying ./performance_schema/events_stages_history.frm to /var/lib/mysql/performance_schema/events_stages_history.frm  
  253. 151029 15:46:04 [01]        ...done  
  254. 151029 15:46:04 [01] Copying ./performance_schema/file_summary_by_event_name.frm to /var/lib/mysql/performance_schema/file_summary_by_event_name.frm  
  255. 151029 15:46:04 [01]        ...done  
  256. 151029 15:46:04 [01] Copying ./performance_schema/table_io_waits_summary_by_table.frm to /var/lib/mysql/performance_schema/table_io_waits_summary_by_table.frm  
  257. 151029 15:46:04 [01]        ...done  
  258. 151029 15:46:04 [01] Copying ./performance_schema/events_stages_summary_by_thread_by_event_name.frm to /var/lib/mysql/performance_schema/events_stages_summary_by_thread_by_event_name.frm  
  259. 151029 15:46:04 [01]        ...done  
  260. 151029 15:46:04 [01] Copying ./performance_schema/threads.frm to /var/lib/mysql/performance_schema/threads.frm  
  261. 151029 15:46:04 [01]        ...done  
  262. 151029 15:46:04 [01] Copying ./performance_schema/accounts.frm to /var/lib/mysql/performance_schema/accounts.frm  
  263. 151029 15:46:04 [01]        ...done  
  264. 151029 15:46:05 [01] Copying ./performance_schema/events_waits_summary_global_by_event_name.frm to /var/lib/mysql/performance_schema/events_waits_summary_global_by_event_name.frm  
  265. 151029 15:46:05 [01]        ...done  
  266. 151029 15:46:05 [01] Copying ./performance_schema/setup_objects.frm to /var/lib/mysql/performance_schema/setup_objects.frm  
  267. 151029 15:46:05 [01]        ...done  
  268. 151029 15:46:05 [01] Copying ./performance_schema/events_statements_current.frm to /var/lib/mysql/performance_schema/events_statements_current.frm  
  269. 151029 15:46:05 [01]        ...done  
  270. 151029 15:46:05 [01] Copying ./performance_schema/socket_instances.frm to /var/lib/mysql/performance_schema/socket_instances.frm  
  271. 151029 15:46:05 [01]        ...done  
  272. 151029 15:46:05 [01] Copying ./performance_schema/setup_actors.frm to /var/lib/mysql/performance_schema/setup_actors.frm  
  273. 151029 15:46:05 [01]        ...done  
  274. 151029 15:46:05 [01] Copying ./performance_schema/events_stages_summary_by_account_by_event_name.frm to /var/lib/mysql/performance_schema/events_stages_summary_by_account_by_event_name.frm  
  275. 151029 15:46:05 [01]        ...done  
  276. 151029 15:46:05 [01] Copying ./performance_schema/events_stages_summary_by_host_by_event_name.frm to /var/lib/mysql/performance_schema/events_stages_summary_by_host_by_event_name.frm  
  277. 151029 15:46:05 [01]        ...done  
  278. 151029 15:46:05 [01] Copying ./performance_schema/db.opt to /var/lib/mysql/performance_schema/db.opt  
  279. 151029 15:46:05 [01]        ...done  
  280. 151029 15:46:06 [01] Copying ./performance_schema/events_stages_summary_by_user_by_event_name.frm to /var/lib/mysql/performance_schema/events_stages_summary_by_user_by_event_name.frm  
  281. 151029 15:46:06 [01]        ...done  
  282. 151029 15:46:06 [01] Copying ./performance_schema/events_statements_history.frm to /var/lib/mysql/performance_schema/events_statements_history.frm  
  283. 151029 15:46:06 [01]        ...done  
  284. 151029 15:46:06 [01] Copying ./performance_schema/events_waits_summary_by_account_by_event_name.frm to /var/lib/mysql/performance_schema/events_waits_summary_by_account_by_event_name.frm  
  285. 151029 15:46:06 [01]        ...done  
  286. 151029 15:46:06 [01] Copying ./performance_schema/events_waits_summary_by_instance.frm to /var/lib/mysql/performance_schema/events_waits_summary_by_instance.frm  
  287. 151029 15:46:06 [01]        ...done  
  288. 151029 15:46:06 [01] Copying ./performance_schema/setup_consumers.frm to /var/lib/mysql/performance_schema/setup_consumers.frm  
  289. 151029 15:46:06 [01]        ...done  
  290. 151029 15:46:06 [01] Copying ./performance_schema/setup_instruments.frm to /var/lib/mysql/performance_schema/setup_instruments.frm  
  291. 151029 15:46:06 [01]        ...done  
  292. 151029 15:46:06 [01] Copying ./performance_schema/mutex_instances.frm to /var/lib/mysql/performance_schema/mutex_instances.frm  
  293. 151029 15:46:06 [01]        ...done  
  294. 151029 15:46:07 [01] Copying ./performance_schema/events_statements_history_long.frm to /var/lib/mysql/performance_schema/events_statements_history_long.frm  
  295. 151029 15:46:07 [01]        ...done  
  296. 151029 15:46:07 [01] Copying ./performance_schema/events_statements_summary_by_account_by_event_name.frm to /var/lib/mysql/performance_schema/events_statements_summary_by_account_by_event_name.frm  
  297. 151029 15:46:07 [01]        ...done  
  298. 151029 15:46:07 [01] Copying ./performance_schema/events_stages_history_long.frm to /var/lib/mysql/performance_schema/events_stages_history_long.frm  
  299. 151029 15:46:07 [01]        ...done  
  300. 151029 15:46:07 [01] Copying ./xtrabackup_info to /var/lib/mysql/xtrabackup_info  
  301. 151029 15:46:07 [01]        ...done  
  302. 151029 15:46:07 completed OK!  
备份数据拷贝完成,启动数据库:

更改新的数据存储目录的属性:
[root@rh64 lib]# ls -l mysql

total 120868
[html] view plain copy print ?
  1. drwx------ 2 root root     4096 Oct 29 15:45 2015-10-29_15-34-59  
  2. drwx------ 2 root root     4096 Oct 29 15:45 2015-10-29_15-36-34  
  3. drwx------ 2 root root     4096 Oct 29 15:45 2015-10-29_15-37-38  
  4. drwx------ 2 root root     4096 Oct 29 15:45 2015-10-29_15-39-38  
  5. -rw-r----- 1 root root 12582912 Oct 29 15:45 ibdata1  
  6. -rw-r----- 1 root root 10485760 Oct 29 15:45 ibdata2  
  7. -rw-r----- 1 root root 50331648 Oct 29 15:45 ib_logfile0  
  8. -rw-r----- 1 root root 50331648 Oct 29 15:45 ib_logfile1  
  9. drwx------ 2 root root     4096 Oct 29 15:46 mysql  
  10. drwx------ 2 root root     4096 Oct 29 15:46 performance_schema  
  11. drwx------ 2 root root     4096 Oct 29 15:45 prod  
  12. drwx------ 2 root root     4096 Oct 29 15:45 test  
  13. -rw-r----- 1 root root      524 Oct 29 15:46 xtrabackup_info  
[ root@rh64 lib]# ls -ld mysql.old
drwxr-xr-x 6 mysql mysql 4096 Oct 29 15:43 mysql.old
[root@rh64 lib]# chown -R mysql:mysql mysql
[root@rh64 lib]# ls -l mysql
[html] view plain copy print ?
  1. total 120868  
  2. drwx------ 2 mysql mysql     4096 Oct 29 15:45 2015-10-29_15-34-59  
  3. drwx------ 2 mysql mysql     4096 Oct 29 15:45 2015-10-29_15-36-34  
  4. drwx------ 2 mysql mysql     4096 Oct 29 15:45 2015-10-29_15-37-38  
  5. drwx------ 2 mysql mysql     4096 Oct 29 15:45 2015-10-29_15-39-38  
  6. -rw-r----- 1 mysql mysql 12582912 Oct 29 15:45 ibdata1  
  7. -rw-r----- 1 mysql mysql 10485760 Oct 29 15:45 ibdata2  
  8. -rw-r----- 1 mysql mysql 50331648 Oct 29 15:45 ib_logfile0  
  9. -rw-r----- 1 mysql mysql 50331648 Oct 29 15:45 ib_logfile1  
  10. drwx------ 2 mysql mysql     4096 Oct 29 15:46 mysql  
  11. drwx------ 2 mysql mysql     4096 Oct 29 15:46 performance_schema  
  12. drwx------ 2 mysql mysql     4096 Oct 29 15:45 prod  
  13. drwx------ 2 mysql mysql     4096 Oct 29 15:45 test  
  14. -rw-r----- 1 mysql mysql      524 Oct 29 15:46 xtrabackup_info  
[root@rh64 lib]# service mysql start
Starting MySQL (Percona Server)..[  OK  ]

连接数据库,查看数据恢复:
[root@rh64 lib]# mysql -u root -p

Enter password: 
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.25-73.1 Percona Server (GPL), Release 73.1, Revision 07b797f
Copyright (c) 2009-2015 Percona LLC and/or its affiliates
Copyright (c) 2000, 2015, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> use prod
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A
Database changed
mysql> select count(*) from t1;
+----------+
| count(*) |
+----------+
|   118304 |
+----------+
1 row in set (0.20 sec)

----数据恢复完成 !!!





http://blog.csdn.net/lqx0405/article/details/49470467

你可能感兴趣的:(xtrabackup)