简体   繁体   English

将大量数据从Oracle DB导出到Oracle DB的最佳方法

[英]Best way to export huge data from Oracle DB to Oracle DB

That's my first post in stackoverflow, and i've to say that i really like that website ! 这是我在stackoverflow中的第一篇文章,我不得不说我真的很喜欢那个网站!

For a project i need to export then re-import some huge Oracle tables from one DB to another (around 100 million lines and 30 rows). 对于一个项目,我需要导出,然后将一些巨大的Oracle表从一个DB重新导入到另一个DB(大约1亿行30行)。

My idea is to export the table in a flat file and then reimport into another empty table considering that the schema already exists. 我的想法是将表导出到平面文件中,然后考虑到该架构已存在,然后将其重新导入到另一个空表中。

I'm using PL/SQL Developer and/or SQL*Plus to make my operations. 我正在使用PL / SQL Developer和/或SQL * Plus进行操作。

I've tested SQL*Loader which seems to do a good job but it's really slow in my opinion : about 30 seconds to make an import of a CSV file with 1 million lines/30 rows. 我已经测试了SQL * Loader,它似乎做得不错,但是我认为这确实很慢:导入具有30万行/百万行的CSV文件大约需要30秒。

Which solution could you bring? 您可以带来哪种解决方案? Is SQL*Loader is the best tool? SQL * Loader是最好的工具吗? Some better tools already exists? 一些更好的工具已经存在? Is CSV the better format talking about size and processing time? CSV是讨论大小和处理时间的更好格式吗?

Thanks a lot in advance. 非常感谢。

Use Oracle DataPump aka expdp and impdp Overview of Oracle Data Pump See Examples of Using Data Pump Export and Examples of Using Data Pump Import 使用Oracle DataPump aka expdp和impdp Oracle数据泵概述请参阅使用数据泵导出的 示例和使用数据泵导入的示例

There really is no need to program this on your own, there is no way that you can outperform expdp/impdp. 确实没有必要自己编写程序,也没有任何方法可以胜过expdp / impdp。 Don't forget there is also an impdp option to use a network_link. 别忘了还有一个使用network_link的impdp选项。 In that case, you just skip the dmp file and import directly into the target database. 在这种情况下,您只需跳过dmp文件并直接导入目标数据库即可。 This can be done using impdp from the commandline but also using dbms_datapump using pl/sql. 可以从命令行使用impdp来完成,也可以通过pl / sql使用dbms_datapump来完成。 See PL/SQL Packages and Types Reference for docu. 有关文档 ,请参见PL / SQL程序包和类型参考

You can use one of the following option: 您可以使用以下选项之一:

  1. SQL Loader (which you already might be trying out). SQL Loader(您可能已经尝试过)。
  2. Traditional data export and Import (exp / imp commands). 传统数据导出和导入(exp / imp命令)。
  3. Oracle data pump (expdp /impdp). Oracle数据泵(expdp / impdp)。

Also if you need to do this regularly then you can schedule this using oracle scheduler or shell script. 另外,如果您需要定期执行此操作,则可以使用oracle Scheduler或Shell脚本进行调度。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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