280 sqliteInserter = SQLiteInserter(args.createfile)
284 oraExp = OracleExporter(oraConn)
287 tempTableCreationFileName =
"tmpCreateTablesSQLite.sql"
288 oraExp.extractSchema(tempTableCreationFileName)
289 sqliteInserter.createSchema(tempTableCreationFileName)
293 tablesToCreate = oraExp.getTables(exceptTables = oraExp.ignoreTablesCreate)
294 tablesToFill = oraExp.getTables(exceptTables = oraExp.ignoreTablesFill)
295 print(
"Tables to create: %i" % len(tablesToCreate))
296 print(
"Tables to fill: %i" % len(tablesToFill))
299 for tableName
in tablesToCreate:
300 entries[tableName] = oraExp.tableSize(tableName)
301 doNotCopy = tableName
not in tablesToFill
302 print(
" table %s has %i entries %s" % (tableName, entries[tableName], (
"(will not copy)" if doNotCopy
else "") ) )
303 totalEntries =
sum(entries.values())
304 print(
"\nTotal number of entries: %i" %totalEntries)
307 print(
"Start copying data")
309 for tableName
in tablesToFill:
310 print(
"Copying table %s" % tableName, end =
'', flush=
True)
311 oraExp.copyTable(tableName, sqliteInserter, entries[tableName])
312 copiedEntries += entries[tableName]
313 print(
" => done %i / %i (%f%%)" % (copiedEntries, totalEntries, 100 * copiedEntries/totalEntries))
315 sqliteInserter.connection.close()