Bug #56317 | More flexible InnoDB tablespace management (extension of bug #25491) | ||
---|---|---|---|
Submitted: | 27 Aug 2010 0:12 | ||
Reporter: | Roel Van de Paar | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S4 (Feature request) |
Version: | OS: | Any | |
Assigned to: | CPU Architecture: | Any |
[27 Aug 2010 0:12]
Roel Van de Paar
[30 Aug 2010 8:34]
Roel Van de Paar
Two workarounds for people who need to move large chunks of data, want to avoid mysqldump and/or want to obtain client side data in a reusable format: 1. To dump, use SELECT INTO OUTFILE to a network-mapped path (i.e. SELECT * FROM <table> INTO OUTFILE "\\\\somehost\\somepath\\somefile.txt";), then re-import using LOAD DATA INFILE. Note the need for double escaping. 2. mysqldump --tab, then import using LOAD DATA INFILE or mysqlimport. http://dev.mysql.com/doc/refman/5.1/en/mysqldump-delimited-text.html http://dev.mysql.com/doc/refman/5.1/en/reloading-delimited-text-dumps.html
[2 Sep 2010 23:38]
Roel Van de Paar
In regards the workarounds: 1. For Linux, this could be done using NFS or some other technology like sshfs. 2. Using this workaround (--tab) is only possible if mysqldump is being run on the same host as where the database resides.
[3 Sep 2010 6:38]
Simon Mudd
For importing or exporting between innodb instances often you don't want to keep the "files" you are writing out on the source machine (due to disk space issues) so perhaps commands like: innodb_export --defaults-file=/path/to/defaults/file db_name table1 table2 table3 ... - innodb_import --defaults-file=/path/to/defaults/file db_name - would be useful (the last parameter should perhaps go at the front and would represent the filename to use for the import/export and using a - as in normal unix convention would mean stdin/stdout. Authorisation to the db could also be done with parameters such as --user, --passs, --port, --host etc... This would allow for the very convenient form: ssh remote_server innodb_export --defaults-file=/path/to/defaults/file db_name table1 table2 table3 ... - | innodb_import --defaults-file=/path/to/defaults/file db_name - to allow me to move some innodb tables quickly and efficiently between 2 instances over the network. Note: 1. the data sent over would be as much as possible "as stored on disk in the .ibd file" (may require using innodb_file_per_table, though I hope not) 2. may be endian specific if the ondisk storage is endian specific so the import command would need to know if importing from the wrong type of box 3. would not be expected to write to binlogs when importing (may be optional?) So using tools like this do have some caveats but if they are understood it would make moving data over between systems much much easier and quicker.
[3 Sep 2010 6:54]
Simon Mudd
4. Final point which is perhaps worth stating. (a) Ensure the export is consistent (b) Output should of course includes any "dirty pages/data" which might actually not be on the tablespace disks, or require some sort of "flush operation" prior to doing that. (c) if possible this operation (export) should be as non-intrusive as possible to active use of the server.