简体   繁体   English

将数据从Oracle数据库11G传输到MongoDB

[英]Transfer Data from Oracle database 11G to MongoDB

I want to have an automatic timed transfer from Oracle database to MongoDB. 我想从Oracle数据库自动迁移到MongoDB。 In a typical RDBMBS scenario, i would have established connection between two databases by creating a dblink and transferred the data by using PL/SQL procedures. 在典型的RDBMBS场景中,我会通过创建dblink建立两个数据库之间的连接,并使用PL / SQL过程来传输数据。 But i don't know what to do in MongoDB case; 但是我不知道在MongoDB情况下该怎么做。 thus, how and what should i be implementing so that i can have an automatic transfer from Oracle database to MongoDB. 因此,我应该如何实施以及如何实施,这样我才能从Oracle数据库自动转移到MongoDB。

What type of data do you want to transfer from the Oracle database to MongoDB? 您想从Oracle数据库传输到MongoDB哪种类型的数据? If you just want to export/import a small number of tables on a set schedule, you could use something like UTL_FILE on the Oracle side to create a .csv export of the table(s) and use DBMS_SCHEDULER to schedule the export to happen automatically based on your desired time frame. 如果您只想按设定的时间表导出/导入少量表,则可以在Oracle方面使用UTL_FILE之类的东西来创建表的.csv导出,并使用DBMS_SCHEDULER安排自动进行导出根据您想要的时间范围。

You could also use an application like SQL Developer to export tables as .csv files by browsing to the table the schema list, then Right Click -> Export and choosing the .csv format. 您还可以使用SQL Developer类的应用程序将表导出为.csv文件,方法是浏览到表的架构列表,然后右键单击->导出并选择.csv格式。 You may also find it a little easier to use UTL_FILE and DBMS_SCHEDULER through SQL Developer instead of relying on SQL*Plus . 您可能还会发现通过SQL Developer使用UTL_FILEDBMS_SCHEDULER而不是依赖SQL*Plus容易一些。

Once you have your .csv file(s), you can use mongoimport to import the data, though I'm not sure if MongoDB supports scheduled jobs like Oracle (I work primarily with the latter.) If you are using Linux , you could use cron to schedule a script that will import the .csv file on a scheduled interval. 一旦拥有.csv文件,就可以使用mongoimport导入数据,尽管我不确定MongoDB支持Oracle类的计划作业(我主要与后者合作。)如果使用Linux ,则可以使用cron安排脚本,该脚本将按计划的时间间隔导入.csv文件。

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

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