Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Create copies of Oracle database tables in an SQLite database

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.

like image 488
kasper360 Avatar asked Apr 01 '11 04:04

kasper360


2 Answers

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

like image 182
shellter Avatar answered Sep 29 '22 13:09

shellter


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.

like image 32
dsegleau Avatar answered Sep 29 '22 14:09

dsegleau