Project: YugabyteDB (App Definition and Development / Database)
File: mysql-oracle.md

title: MySQL and Oracle source databases linkTitle: MySQL and Oracle headcontent: What to watch out for when migrating data from MySQL or Oracle description: Review limitations and suggested workarounds for migrating data from MySQL or Oracle. menu: preview_yugabyte-voyager: identifier: mysql-oracle-issues parent: known-issues weight: 103 type: docs rightNav: hideH3: true This page documents known issues you may encounter and suggested workarounds when migrating data from MySQL or Oracle to YugabyteDB. GitHub: Description: If you have a table in the source database which is partitioned using any expression/function, that table cannot have a primary or unique key on any of its columns, as it is an invalid syntax in YugabyteDB. Workaround: Remove any primary/unique keys from exported schemas. An example schema on the MySQL source database with primary key is as follows: ```sql / Table definition / CREATE TABLE Sales ( cust_id INT NOT NULL, name VARCHAR(40), store_id VARCHAR(20) NOT NULL, bill_no INT NOT NULL, bill_date DATE NOT NULL, amount DECIMAL(8,2) NOT NULL, PRIMARY KEY (billno,billdate) ) PARTITION BY RANGE (year(bill_date))( PARTITION p0 VALUES LESS THAN (2016), PARTITION p1 VALUES LESS THAN (2017), PARTITION p2 VALUES LESS THAN (2018), PARTITION p3 VALUES LESS THAN (2020) ); ``` The exported schema is as follows: ```sql / Table definition / CREATE TABLE sales ( cust_id bigint NOT NULL, name varchar(40), store_id varchar(20) NOT NULL, bill_no bigint NOT NULL, bill_date timestamp NOT NULL, amount decimal(8,2) NOT NULL, PRIMARY KEY (billno,billdate) ) PARTITION BY RANGE ((extract(year from date(bill_date)))) ; ``` Suggested change to the schema is to remove the primary/unique key from the exported schema as follows: ```sql CREATE TABLE sales ( cust_id bigint NOT NULL, name varchar(40), store_id varchar(20) NOT NULL, bill_no bigint NOT NULL, bill_date timestamp NOT NULL, amount decimal(8,2) NOT NULL ) PARTITION BY RANGE ((extract(year from date(bill_date)))) ; ``` GitHub: Description: In YugabyteDB, you cannot perform a partition by list on multiple columns and exporting the schema results in an error. Workaround: Make the partition a single column partition by list by making suitable changes or choose other supported partitioning methods. Example An example schema on the Oracle source database is as follows: ```sql CREATE TABLE test ( id NUMBER, country_code VARCHAR2(3), record_type VARCHAR2(5), descriptions VARCHAR2(50), CONSTRAINT t1_pk PRIMARY KEY (id) ) PARTITION BY LIST (countrycode, recordtype) ( PARTITION partgbrabc VALUES (('GBR','A'), ('GBR','B'), ('GBR','C')), PARTITION partireab VALUES (('IRE','A'), ('IRE','B')), PARTITION partusaa VALUES (('USA','A')), PARTITION part_others VALUES (DEFAULT) ); ``` The exported schema is as follows: ```sql CREATE TABLE test ( id numeric NOT NULL, country_code varchar(3), record_type varchar(5), descriptions varchar(50), PRIMARY KEY (id) ) PARTITION BY LIST (countrycode, recordtype) ; ``` The preceding schema example will result in an error as follows: ```output ERROR: cannot use "list" partition strategy with more than one column (SQLSTATE 42P17) ```