Recover a single InnoDB table from the Xtraback backup file
Http://blog.sina.com.cn/s/blog_445e807b0101dbgw.html
The ability to recover a table is the premise that the standalone table space is turned on innodb_per_file_table=1
Restore a InnoDB table (innodb_per_file_table)
1> data error, but table not deleted (drop table, TRUNCATE table)
A. Issue this ALTER TABLE statement:
B. ALTER TABLE tbl_name DISCARD tablespace;
Warning: This statement deletes the current. ibd file.
C. Put the backed-up. ibd file back into the appropriate database directory.
D. Issue this ALTER TABLE statement:
E. ALTER TABLE tbl_name IMPORT tablespace;
Note: If the report ID is inconsistent, you can use the Rebuild table method to adjust the ID consistency
2> table is deleted, but you still need to know the table structure
A. mysql> CREATE table saler like students;
B. Turn off the MySQL service (required)
/opt/app/mysql5/share/mysql/mysql.server stop
C. prepare IBD file Apply Log
D. Innobackupex--apply-log--defaults-file=/etc/my.cnf/opt/backup/2013-01-17_14-02-07/
E. Back up the current IBD file (optional)
Cp-a TESTIBD.IBD Testibd.bak
F. Replicating a backup IBD file
CP saler.ibd/opt/app/mysql5/var/nigel/
G. Chown mysql:mysql/opt/app/mysql5/var/nigel/
H. Using the Percona recovery tool to modify the Ibdata
I./opt/src/percona-data-recovery-tool-for-innodb-0.5/ibdconnect-o-f/opt/app/mysql5/var/nigel/saler.ibd-d Nigel- T TESTIBD
J. Re-checksum ibdata with Percona recovery tool
K./opt/src/percona-data-recovery-tool-for-innodb-0.5/innochecksum-f/opt/app/mysql5/innovar/ibdata1
Execute the above command repeatedly until the program outputs "BDATA1".
Recover a single InnoDB table from the Xtraback backup file