如何将 .dmp 文件 (Oracle) 导入 MySql DB?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1667705/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-31 14:25:13  来源:igfitidea点击:

How to import a .dmp file (Oracle) into MySql DB?

mysqlimportexportclob

提问by ScienceFriction

The .dmp is a dump of a table built in Oracle 10g (Express Edition) and one of the fields is of CLOB type.

.dmp 是 Oracle 10g(速成版)中构建的表的转储,其中一个字段是 CLOB 类型。

I was trying to simply export the table to xml/csv files then import it to the MySql, but the export simply ignored the CLOB field... (I was using sqldeveloper for that).

我试图简单地将表导出到 xml/csv 文件,然后将其导入到 MySql,但导出只是忽略了 CLOB 字段......(我为此使用了 sqldeveloper)。

I noticed this postexplaining how to extract the CLOB to text file but it seems to miss the handling of the other fields or at least the primary key fields. can it be adopted to create a csv of the complete table? (I am not familiar with plsql at all)

我注意到这篇文章解释了如何将 CLOB 提取到文本文件,但它似乎错过了其他字段或至少主键字段的处理。可以采用创建完整表的csv吗?(我根本不熟悉plsql)

As the brute force approach, I can use my python interface to simply query for all the records and spool it to a flat file but I'm afraid it will take a LOOOONG time (query for all records replace all native commas with the ascii... )

作为蛮力方法,我可以使用我的 python 界面来简单地查询所有记录并将其假脱机到一个平面文件,但我担心它会花费很长时间(所有记录的查询将所有本地逗号替换为 ascii。 ..)

Thanks guys!

谢谢你们!

采纳答案by ScienceFriction

After about 2 hours of installing and uninstalling the MySql on the same machine (mylaptop) in order to use the migration tool kit as suggested by longneck, I decided to simply implement the dump and here it is for the likes of me that have minimal admin experience and get hard time to make both DBs work together (errors 1130, 1045 and more).

在同一台机器(mylaptop)上安装和卸载 MySql 大约 2 小时后,为了使用 longneck 建议的迁移工具包,我决定简单地实现转储,这里是为像我这样的管理员最少的人经验并很难让两个数据库协同工作(错误 1130、1045 和更多)。

Surprisingly, it is not as slow as I expected: OraDump

令人惊讶的是,它并没有我预期的那么慢:OraDump

Any comments and improvements are welcomed.

欢迎任何意见和改进。

回答by longneck

if you can get the mysql server and the oracle server on the same network, you might want to look at the mysql administrator tools, which includes the migration toolkit. you can connect to the oracle server with the migration toolkit and it will automatically create tables and move data for you.

如果您可以在同一网络上获得 mysql 服务器和 oracle 服务器,您可能需要查看mysql 管理员工具,其中包括迁移工具包。您可以使用迁移工具包连接到 oracle 服务器,它会自动为您创建表和移动数据。

回答by Pavlo Svirin

Here is a documentation explaining the migration process: http://www.mysql.com/why-mysql/white-papers/mysql_wp_oracle2mysql.php

这是解释迁移过程的文档:http: //www.mysql.com/why-mysql/white-papers/mysql_wp_oracle2mysql.php

and you can use Data Wizard for MySQL. Trial version is fully usable for 30 days.

你可以使用MySQL 的数据向导。试用版完全可用 30 天。