在 SQLite 数据库中创建 Oracle 数据库表的副本

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/5509168/
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-09-18 23:12:31  来源:igfitidea点击:

Create copies of Oracle database tables in an SQLite database

oraclesqlitesynchronizationcopy

提问by kasper360

I have 2 databases, Oracle and SQlite. And I want to create exact copies of some of the Oracle tables in SQLite in one of my applications. Most of these tables contains more than 10,000 rows so copying each table by going through each row programmatically is not efficient. Also the table structure may change in the future so I want to achieve this using a generic way without hard-coding the SQL statements. Is there a any way to do this?

我有 2 个数据库,Oracle 和 SQlite。我想在我的一个应用程序中创建 SQLite 中某些 Oracle 表的精确副本。大多数这些表包含超过 10,000 行,因此通过以编程方式遍历每一行来复制每个表效率不高。此外,表结构将来可能会发生变化,因此我想使用通用方式来实现这一点,而无需对 SQL 语句进行硬编码。有没有办法做到这一点?

p.s. - This application is being developed using Qt framework. All the queries and databases are represented by QtSql module objects.

ps - 此应用程序是使用 Qt 框架开发的。所有的查询和数据库都由 QtSql 模块对象表示。

采纳答案by shellter

Can't help with Qt framework, but for large amounts of data is is usually better to use bulk-copy operations.

对 Qt 框架无济于事,但对于大量数据通常最好使用批量复制操作。

Export data from Oracle http://download.oracle.com/docs/cd/B25329_01/doc/admin.102/b25107/impexp.htm#BCEGAFAB

从 Oracle 导出数据 http://download.oracle.com/docs/cd/B25329_01/doc/admin.102/b25107/impexp.htm#BCEGAFAB

Import data into SQLite http://www.sqlite.org/cvstrac/wiki?p=ImportingFiles

将数据导入 SQLite http://www.sqlite.org/cvstrac/wiki?p=ImportingFiles

IHTH

IHTH

回答by dsegleau

What you probably really want to use is the Oracle Database Mobile Server, which can automatically synchronize a SQLite and an Oracle Database.

您可能真正想要使用的是Oracle Database Mobile Server,它可以自动同步 SQLite 和 Oracle 数据库。

The recent release of the Oracle Database Mobile Server (formally called Oracle Database Lite Mobile Server) supports synchronization between an Oracle Database and a SQLite or a Berkeley DB database running on the client. It supports both synchronous and asynchronous data exchange, as well as secure communications between client and server. You can configure the Mobile Server to synchronize based on several options without the need to modify the application that is accessing the database.

最近发布的 Oracle Database Mobile Server(正式称为 Oracle Database Lite Mobile Server)支持在 Oracle 数据库和客户端上运行的 SQLite 或 Berkeley DB 数据库之间进行同步。它支持同步和异步数据交换,以及客户端和服务器之间的安全通信。您可以将 Mobile Server 配置为基于多个选项进行同步,而无需修改正在访问数据库的应用程序。

You can also find an excellent discussion forumfor questions from developers and implementers using the Mobile Server.

您还可以找到一个优秀的讨论论坛,供使用 Mobile Server 的开发人员和实施人员提出问题。