The invention relates to a method and system for importing data in the Oracle database to mongodb database, the method includes reading the structured query language bson format configuration and configuration in the memory; language configuration table into a text file in the data derived from the Oracle database query through structured text files; the data in the table convert bson format into bson format through the configuration; through the master node mongodb database configuration searching mongodb database, data tables and execute the import operation in the main node, will be converted to bson format data into the mongdb database. The invention also relates to a system, which comprises an information configuration module, an information conversion module and an information introduction module. According to the invention, eliminating the middle part of a large number of manual operations, and can control the data into the mongodb database structure, simplify the table data migration from Oracle database to mongodb database operation, reduces the complexity of data migration, saving time and cost.
【技术实现步骤摘要】
一种将oracle数据库内的数据导入到mongodb数据库的方法及系统
本专利技术涉及数据迁移的
,尤其涉及了一种将oracle数据库内的数据导入到mongodb数据库的方法及系统。
技术介绍
现在的技术中,随着业务项目发展,需求将oracle中的部分表数据迁移mongodb数据库中,但从oracle数据库导入到mongodb数据库中,没有现成的完成整个流程的技术。每次都必须手工分步骤先从oracle导出,然后在导入到mongodb数据库中,步骤繁琐,操作复杂,导入mongodb数据库的数据结构也不好控制。因此,简化oracle数据导入到mongodb数据库过程中的步骤,通过简单的配置实现数据的导入,控制导入到mongodb数据库的数据结构变得极为迫切。
技术实现思路
本专利技术所要解决的技术问题是:目前oracle数据导入到mongodb数据库过程复杂,并且导入mongodb数据库的数据结构较难控制。为解决上面的技术问题,本专利技术提供了一种将oracle数据库内的数据导入到mongodb数据库的方法,该方法包括如下步骤:S1,通过结构化查询语言配置将从oracle数据库中导出的数据表导入到文本文件中;S2,通过bson格式配置将导入到文本文件中的数据表转换为bson格式的数据表;S3,通过mongodb数据库的配置查找mongodb数据库的主节点,并在主节点上执行数据表导入操作,将转换为bson格式的数据表导入到mongdb数据库中。进一步,所述步骤S1中还包括:读取结构化查询语言配置和bson格式配置到内存中。进一步,所述的结构化查询语言配置和bs ...
【技术保护点】
一种将oracle数据库内的数据导入到mongodb数据库的方法,其特征在于,该方法包括如下步骤:S1,通过结构化查询语言配置将从oracle数据库中导出数据表导入到文本文件中;S2,通过bson格式配置将文本文件中的数据表转换为bson格式的数据表;S3,通过mongodb数据库的配置查找mongodb数据库的主节点,并在主节点上执行数据表导入操作,将转换为bson格式的数据表导入到mongdb数据库中。
【技术特征摘要】
1.一种将oracle数据库内的数据导入到mongodb数据库的方法,其特征在于,该方法包括如下步骤:S1,通过结构化查询语言配置将从oracle数据库中导出数据表导入到文本文件中;S2,通过bson格式配置将文本文件中的数据表转换为bson格式的数据表;S3,通过mongodb数据库的配置查找mongodb数据库的主节点,并在主节点上执行数据表导入操作,将转换为bson格式的数据表导入到mongdb数据库中。2.根据权利要求1所述的一种将oracle数据库内的数据导入到mongodb数据库的方法,其特征在于,所述步骤S1中还包括:读取结构化查询语言配置和bson格式配置到内存中。3.根据权利要求2所述的一种将oracle数据库内的数据导入到mongodb数据库的方法,其特征在于,所述的结构化查询语言配置和bson格式配置采用shell脚本读取。4.根据权利要求1或3所述的一种将oracle数据库内的数据导入到mongodb数据库的方法,其特征在于,所述S2中还包括:转换为bson格式的数据表要保持bson格式配置中的数据结构。5.根据权利要求4所述的一种将oracle数据库内的数据导入到mongodb数据库的方法,其特征在于,所述S2中包括:将从oracle数据库中导出的数据表与转换为bson格式的数据表,进行数据量的对比,当对比出现不一致的时候,返回步骤S1。6.根据权利要求5所述的一种将oracle数据库内的数据导入到mongodb数据库的方法,其特征在于,步骤S3中,将数据表导入到mongdb数据库中后,校...
【专利技术属性】
技术研发人员:冯宇,
申请(专利权)人:北京思特奇信息技术股份有限公司,
类型:发明
国别省市:北京,11
还没有人留言评论。发表了对其他浏览者有用的留言会获得科技券。