Recover a single InnoDB table from the Xtraback backup file

Source: Internet
Author: User
Tags percona

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.