copy the t1.ibd and t1.cfg from backup dir to the db directory
ALTER TABLE t1 IMPORT TABLESPACE
These steps are error-prone and tedious. Imagine a user who wants to import all tables in a specific directory. We want to automate this entire process from xtrabackup () but as part of this work, we will do the most important task required to solve the problem. " How do you get the schema of the table?"
Proposal
Extend the export option during prepare to generate the schema of the table. ie with xtrabackup --prepare --export, generate .sql file for each tablesapce file (IBD file)
Interfaces
No new option introduced. Existing option --export will generate the tablename.sql file
How?
During the prepare phase, xtrabackup deserializes the SDI from IBD
from the SDI, xtrabckup prepares the dd::Table object
Using the dd::Table object, xtrabackup will create the schema of the table
store the schema in the tablename.sql file
Users who wishes to restore the table will follow the above steps (from step 5)
To restore a single table from xtrabackup to a running server, the current process is
Download the backup
Decompress if necessary
prepare the backup with -export option (-prepare --export)
this step creates a .cfg file for every .ibd file
User has to remember the schema of the table being exported at the time of backup (After this improvment PXB-3153, user will no longer need to)
create table with the schema he remembers on the running server
discard tablespace (ALTER TABLE t1 DISCARD TABLESPACE)
copy the t1.ibd and t1.cfg from backup dir to the db directory
ALTER TABLE t1 IMPORT TABLESPACE
These steps are error-prone and tedious. Imagine a user who wants to import all tables in a specific directory. We want to automate this entire process from xtrabackup () but as part of this work, we will do the most important task required to solve the problem. " How do you get the schema of the table?"
Proposal
Extend the export option during prepare to generate the schema of the table. ie with xtrabackup --prepare --export, generate .sql file for each tablesapce file (IBD file)
Interfaces
No new option introduced. Existing option --export will generate the tablename.sql file
How?
During the prepare phase, xtrabackup deserializes the SDI from IBD
from the SDI, xtrabckup prepares the dd::Table object
Using the dd::Table object, xtrabackup will create the schema of the table
store the schema in the tablename.sql file
Users who wishes to restore the table will follow the above steps (from step 5)