Percona 中的 xtrabackup 真是个好工具, 简单的介绍的他的功能:

  1、创建热备份(主要依靠innodb的 crash recovery 功能)

  2、增量备份

  3、直接对备份文件压缩打包

  4、负载小

  在测试最新版本2.0时,发现问题:

   importing  and   exporing  individual tables中这个工具对Oracle 原版的MySQL是不起作用的。

   解释如下:在原版MySQL中是不能任意移动数据库的.idb文件,官方给出的解释是:the table definition that is stored in theInnoDBshared tablespace includes the database name, and becauseInnoDBmust preserve the consistency of transaction IDs and log sequence numbers. 即:表定义存储在innodb 中的共享表空间中,事务id 和日志序列号是放在单个的表空间文件中。(在percona  server 这个限制已经移除)

   经多方咨询:这个工具对于原版MySQL 还是可以用的。具体如下:

   备份单个表:

   innobackupex --tables-file=/tmp/tables.txt  /path/to/backup

   关键是下面这步:

   --export 先使用该选项获得一个完全独立的idb文件(官方未提到)

   innobackupex  --defaults-file=/usr/local/mysql/my.cnf --export  /tmp

   下面是将应用日志而得到一个一致的备份:

    innobackupex  --defaults-file=/usr/local/mysql/my.cnf --export --apply-log  /path/to/backup

    最后是 import TABLESPACE;请参考官方文档:官方文档

    如果遇到独立ibd tableid 与共享表空间里面tableid 不一致,可能是innodb_import_table_from_xtrabackup 或者是  innodb_expand_import  参数没有开启