View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0005063 | SymmetricDS | Bug | public | 2021-07-21 09:25 | 2024-11-13 18:37 |
Reporter | rjna | Assigned To | |||
Priority | low | ||||
Status | new | Resolution | open | ||
Product Version | 3.12.11 | ||||
Summary | 0005063: Unable to import Oracle DB schema and data into MariaDB | ||||
Description | I was able to export the schema and data from my Oracle DB using the command: bin/dbexport -p /path_to_my_oracle_properties_file --schema myschema > my_output.sql Then, bin/dbexport --help lists some arguments to be used with the compatible option: db2, db2zos, derby, firebird, greenplum, h2, hsqldb, hsqldb2, informix, interbase, mssql, mysql, oracle, postgres and sybase. Since MariaDB is not listed as an argument, I tried to use mysql. Then I tried to import the my_output.sql file into my MariaDB: bin/dbimport -p path_to_my_mariaDB_properties_file my_output.sql This works up to a point (e.g. some tables are created), but it gives the following error: [] - DefaultDatabaseWriter - Failed to run the following sql: ALTER TABLE `HR`.`EMPLOYEES` ADD CONSTRAINT `EMP_DEPT_FK` FOREIGN KEY (`DEPARTMENT_ID`) REFERENCES `HR`.`DEPARTMENTS` (`DEPARTMENT_ID`) java.sql.SQLException: Can't create table `HR`.`EMPLOYEES` (errno: 150 "Foreign key constraint is incorrectly formed") Is there a way to make the dbexport output compatible with MariaDB? Also, here: https://www.symmetricds.org/doc/3.4/javadoc/org/jumpmind/symmetric/io/data/DbExport.Compatible.html MariaDB is listed as an option, but I was unable to use it as a compatible argument of dbexport (tried to write it in different ways and tried to use mysql/mariadb). Thank you very much! Ricardo | ||||
Tags | dbimport/dbexport | ||||
|
Hi guys! I was able to solve this by manually editing the my_output.sql file. The issue was that I had 2 tables that had a FK constrain with each other. So, one of the constrains was being created before the another table was created, and that was the source of the error. Solved it by moving the FK constrain creation to a point after the second table creation. Thank you! Ricardo |
|
Hi guys! I was able to solve this by manually editing the my_output.sql file. The issue was that I had 2 tables that had a FK constrain with each other. So, one of the constrains was being created before the another table was created, and that was the source of the error. Solved it by moving the FK constrain creation to a point after the second table creation. Thank you! Ricardo |
|
This is really a SymmetricDS issue. What needs to be done is to export the table creates first, then the indexes, then the constraints. |
Date Modified | Username | Field | Change |
---|---|---|---|
2021-07-21 09:25 | rjna | New Issue | |
2021-07-21 09:25 | rjna | Tag Attached: data conversion; | |
2021-07-21 09:25 | rjna | Tag Attached: dbexport; | |
2021-07-21 09:25 | rjna | Tag Attached: dbimport/dbexport; | |
2021-07-21 09:25 | rjna | Tag Attached: dialect: mysql/mariadb; | |
2021-07-21 09:25 | rjna | Tag Attached: dialect: oracle; | |
2021-07-21 15:47 | rjna | Note Added: 0001966 | |
2021-07-21 15:47 | rjna | Note Added: 0001967 | |
2021-07-21 17:58 | pmarzullo | Note Added: 0001968 | |
2022-01-13 13:24 | admin | Tag Detached: data conversion; | |
2022-01-13 13:24 | admin | Tag Detached: dbexport; | |
2022-01-13 13:24 | admin | Tag Detached: dbimport/dbexport; | |
2022-01-13 13:24 | admin | Tag Detached: dialect: mysql/mariadb; | |
2022-01-13 13:24 | admin | Tag Detached: dialect: oracle; | |
2022-01-13 13:25 | admin | Tag Attached: dbimport/dbexport | |
2022-01-13 13:25 | admin | Tag Attached: dialect: oracle | |
2022-01-13 13:25 | admin | Tag Attached: dialect: mysql/mariadb | |
2024-11-13 18:37 | cquamme | Tag Detached: dialect: mysql/mariadb | |
2024-11-13 18:37 | cquamme | Tag Detached: dialect: oracle | |
2024-11-13 18:37 | cquamme | Priority | none => low |