简体   繁体   中英

Transfer tables from one DB (HANA) to another DB (MySQL

I need a bit of advice. I need to transfer tables (approx. 1000) from DB Hana to one MySql DB. In MySql DB will be creating the same tables as in Hana DB. I need to create something using Java what need to do these things: First of all, I need to read all database and retrieve information about all tables (table name, columns name, and columns types) to compare with the MySql DB info. The next step is to transfer table content from the first DB to the second DB. Some advice, please?

From my experience, I suggest using a tracking table in the middle of the two DBs to perform the migration. You can create a dedicated schema on one of the two DBs and then save there everything you need to migrate from a DB to another and progressively mark everything as "done".

Alternatively, you can export everything you need to migrate from Hana as an SQL script and then programmatically translate the script to a MySQL compatible syntax and execute updates.

The first approach is a little bit more cumbersome but grants you more control over the migration process. The second one is kind of easier since you just need to translate and execute the generated script, but it's harder, if the process stops for whatever reason, to resume from where you stopped.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM