在 SQLite 数据库中创建 Oracle 数据库表的副本
我有 2 个数据库,Oracle 和 SQlite。我想在我的一个应用程序中的 SQLite 中创建一些 Oracle 表的精确副本。这些表中的大多数包含超过 10,000 行,因此通过以编程方式遍历每一行来复制每个表的效率不高。此外,表结构将来可能会发生变化,因此我想使用通用方式来实现这一点,而不需要对 SQL 语句进行硬编码。有什么办法可以做到这一点吗?
ps - 该应用程序是使用 Qt 框架开发的。所有查询和数据库均由 QtSql 模块对象表示。
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?
p.s. - This application is being developed using Qt framework. All the queries and databases are represented by QtSql module objects.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
无法使用 Qt 框架,但对于大量数据,通常最好使用批量复制操作。
从 Oracle 导出数据
http://download.oracle.com /docs/cd/B25329_01/doc/admin.102/b25107/impexp.htm#BCEGAFAB
将数据导入SQLite
http://www.sqlite.org/cvstrac/wiki?p=ImportingFiles
IHTH
Can't help with Qt framework, but for large amounts of data is is usually better to use bulk-copy operations.
Export data from 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
IHTH
您可能真正想要使用的是 Oracle 数据库移动服务器,它可以自动同步 SQLite 和 Oracle 数据库。
最近发布的 Oracle Database Mobile Server(正式名称为 Oracle Database Lite Mobile Server)支持 Oracle 数据库与客户端上运行的 SQLite 或 Berkeley DB 数据库之间的同步。它支持同步和异步数据交换,以及客户端和服务器之间的安全通信。您可以将 Mobile Server 配置为基于多个选项进行同步,而无需修改正在访问数据库的应用程序。
您还可以找到一个优秀的讨论论坛,解答使用 Mobile Server 的开发人员和实施人员提出的问题。
What you probably really want to use is the Oracle Database Mobile Server, which can automatically synchronize a SQLite and an Oracle Database.
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.
You can also find an excellent discussion forum for questions from developers and implementers using the Mobile Server.