- Env >\! cat /etc/*release Oracle Linux Server release 7.1 NAME="Oracle Linux Server" VERSION="7.1" ID="ol" VERSION_ID="7.1" PRETTY_NAME="Oracle Linux Server 7.1" ANSI_COLOR="0;31" CPE_NAME="cpe:/o:oracle:linux:7:1" HOME_URL="https://linux.oracle.com/" BUG_REPORT_URL="https://bugzilla.oracle.com/" ORACLE_BUGZILLA_PRODUCT="Oracle Linux 7" ORACLE_BUGZILLA_PRODUCT_VERSION=7.1 ORACLE_SUPPORT_PRODUCT="Oracle Linux" ORACLE_SUPPORT_PRODUCT_VERSION=7.1 Red Hat Enterprise Linux Server release 7.1 (Maipo) Oracle Linux Server release 7.1 - builds 8_0_13> 8_0_13>\! cat docs/INFO_SRC commit: 3672fb2ad9f6c91cd2527866d46fa583b70bfefd date: 2018-10-07 10:41:27 +0200 build-date: 2018-10-07 10:44:40 +0200 short: 3672fb2 branch: mysql-8.0.13-release MySQL source 8.0.13 8_0_15>\! cat docs/INFO_SRC commit: 44dae513765dfdb0d861cfc34423f0fb407c2047 date: 2019-01-25 23:31:34 +0100 build-date: 2019-01-25 23:33:22 +0100 short: 44dae51 branch: mysql-8.0.15-release MySQL source 8.0.15 - Schema used create database if not exists test; use test; drop table if exists t1; CREATE TABLE t1 (i int) ENGINE = InnoDB PARTITION BY KEY (i) PARTITIONS 3; # https://dev.mysql.com/doc/refman/8.0/en/tablespace-copying.html #### 8.0.13 -> 8.0.15 - no issues observed -- rm -rf 94850_8_0_13/ bin/mysqld --initialize-insecure --basedir=$PWD --datadir=$PWD/94850_8_0_13 --log-error-verbosity=3 --lower_case_table_names=1 bin/mysqld --basedir=$PWD --datadir=$PWD/94850_8_0_13 --core-file --socket=/tmp/mysql_8013.sock --port=3333 --log-error=$PWD/94850_8_0_13/log.err --log-error-verbosity=3 --lower_case_table_names=1 2>&1 & (1)On the source instance, create a partitioned table if one does not exist. In the following example, a table with three partitions (p0, p1, p2) is created: bin/mysql -uroot -S /tmp/mysql_8013.sock --prompt='8_0_13>' Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 8.0.13 MySQL Community Server - GPL Copyright (c) 2000, 2018, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. 8_0_13>show variables like 'lower_case_table_names'; +------------------------+-------+ | Variable_name | Value | +------------------------+-------+ | lower_case_table_names | 1 | +------------------------+-------+ 1 row in set (0.01 sec) 8_0_13>create database if not exists test; Query OK, 1 row affected (0.07 sec) 8_0_13>use test; Database changed 8_0_13>drop table if exists t1; Query OK, 0 rows affected, 1 warning (0.00 sec) 8_0_13>CREATE TABLE t1 (i int) ENGINE = InnoDB PARTITION BY KEY (i) PARTITIONS 3; Query OK, 0 rows affected (0.02 sec) 8_0_13>\! ls -l 94850_8_0_13/test/ total 240 -rw-r----- 1 umshastr common 114688 Apr 10 09:58 t1#P#p0.ibd -rw-r----- 1 umshastr common 114688 Apr 10 09:58 t1#P#p1.ibd -rw-r----- 1 umshastr common 114688 Apr 10 09:58 t1#P#p2.ibd 8_0_13> 8_0_13> - 8.0.15 rm -rf 94850_8_0_15 bin/mysqld --initialize-insecure --basedir=$PWD --datadir=$PWD/94850_8_0_15 --log-error-verbosity=3 --lower_case_table_names=1 bin/mysqld --basedir=$PWD --datadir=$PWD/94850_8_0_15 --core-file --socket=/tmp/mysql_8015.sock --port=9999 --log-error=$PWD/94850_8_0_15/log.err --log-error-verbosity=3 --lower_case_table_names=1 2>&1 & (2) On the destination instance, create the same partitioned table: bin/mysql -uroot -S /tmp/mysql_8015.sock --prompt='8_0_15>' Welcome to the MySQL monitor. Commands end with ; or \g. Your MySQL connection id is 8 Server version: 8.0.15 MySQL Community Server - GPL Copyright (c) 2000, 2019, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. 8_0_15>show variables like 'lower_case_table_names'; +------------------------+-------+ | Variable_name | Value | +------------------------+-------+ | lower_case_table_names | 1 | +------------------------+-------+ 1 row in set (0.01 sec) 8_0_15>create database if not exists test; Query OK, 1 row affected (0.01 sec) 8_0_15>use test; Database changed 8_0_15>drop table if exists t1; Query OK, 0 rows affected, 1 warning (0.00 sec) 8_0_15>CREATE TABLE t1 (i int) ENGINE = InnoDB PARTITION BY KEY (i) PARTITIONS 3; Query OK, 0 rows affected (0.03 sec) 8_0_15>\! ls -l 94850_8_0_15/test/ total 240 -rw-r----- 1 umshastr common 114688 Apr 10 10:02 t1#p#p0.ibd -rw-r----- 1 umshastr common 114688 Apr 10 10:02 t1#p#p1.ibd -rw-r----- 1 umshastr common 114688 Apr 10 10:02 t1#p#p2.ibd 8_0_15> (3) On the destination instance, discard the tablespace for the partitioned table. (Before the tablespace can be imported on the destination instance, the tablespace that is attached to the receiving table must be discarded.) 8_0_15> 8_0_15>ALTER TABLE t1 DISCARD TABLESPACE; Query OK, 0 rows affected (0.02 sec) 8_0_15> (4) On the source instance, run FLUSH TABLES ... FOR EXPORT to quiesce the partitioned table and create the .cfg metadata files: 8_0_13>show variables like 'lower_case_table_names'; +------------------------+-------+ | Variable_name | Value | +------------------------+-------+ | lower_case_table_names | 1 | +------------------------+-------+ 1 row in set (0.01 sec) 8_0_13>FLUSH TABLES t1 FOR EXPORT; Query OK, 0 rows affected (0.04 sec) 8_0_13>\! ls -l 94850_8_0_13/test/ total 252 -rw-r----- 1 umshastr common 576 Apr 10 10:04 t1#P#p0.cfg -rw-r----- 1 umshastr common 114688 Apr 10 09:58 t1#P#p0.ibd -rw-r----- 1 umshastr common 576 Apr 10 10:04 t1#P#p1.cfg -rw-r----- 1 umshastr common 114688 Apr 10 09:58 t1#P#p1.ibd -rw-r----- 1 umshastr common 576 Apr 10 10:04 t1#P#p2.cfg -rw-r----- 1 umshastr common 114688 Apr 10 09:58 t1#P#p2.ibd 8_0_13> (5) Copy the .ibd and .cfg files from the source instance database directory to the destination instance database directory. For example: 8_0_13> 8_0_13>\! cp 94850_8_0_13/test/t1*.{ibd,cfg} /export/umesh/server/binaries/GABuilds/mysql-8.0.15-linux-glibc2.12-x86_64/94850_8_0_15/test 8_0_13> (6) On the source instance, use UNLOCK TABLES to release the locks acquired by FLUSH TABLES ... FOR EXPORT: 8_0_13> 8_0_13>UNLOCK TABLES; Query OK, 0 rows affected (0.00 sec) 8_0_13> (7) On the destination instance, import the tablespace for the partitioned table: 8_0_15> 8_0_15>ALTER TABLE t1 IMPORT TABLESPACE; ERROR 1812 (HY000): Tablespace is missing for table `test`.`t1`. 8_0_15> 8_0_15> 8_0_15> 8_0_15>ALTER TABLE t1 IMPORT TABLESPACE; ERROR 1812 (HY000): Tablespace is missing for table `test`.`t1`. 8_0_15> 8_0_15>show errors; +-------+------+----------------------------------------------+ | Level | Code | Message | +-------+------+----------------------------------------------+ | Error | 1812 | Tablespace is missing for table `test`.`t1`. | +-------+------+----------------------------------------------+ 1 row in set (0.00 sec) - files on destination 8_0_15>\! ls -l 94850_8_0_15/test/ total 348 -rw-r----- 1 umshastr common 576 Apr 10 10:05 t1#P#p0.cfg -rw-r----- 1 umshastr common 114688 Apr 10 10:05 t1#P#p0.ibd -rw-r----- 1 umshastr common 576 Apr 10 10:05 t1#P#p1.cfg -rw-r----- 1 umshastr common 114688 Apr 10 10:05 t1#P#p1.ibd -rw-r----- 1 umshastr common 576 Apr 10 10:05 t1#P#p2.cfg -rw-r----- 1 umshastr common 114688 Apr 10 10:05 t1#P#p2.ibd 8_0_15>