Data migration

Learn about different ways to load data from the existing data warehouse into Exasol.

There are three different ways you can load data from an Oracle system into Exasol: 

Direct import from Oracle to Exasol

To load data from Oracle directly into Exasol you can use either the JDBC driver or Oracle Call Interface (OCI). We recommend that you use the OCI driver/ORA connection as it provides better loading performance.

In some cases a fallback to the JDBC driver might be necessary, such as when loading CLOB or INTERVAL columns from Oracle to Exasol.

A CONNECTION in Exasol covers the functionality of a DB-LINK in Oracle and more.

Copy
import into "C##DB_MIG"."DIM_PRODUCT"
from ora at oracle_oci 
statement 'select * from "C##DB_MIG"."DIM_PRODUCT"';

import into "C##DB_MIG"."DIM_PRODUCT"
from jdbc at oracle_jdbc 
statement 'select * from "C##DB_MIG".DIM_PRODUCT';

The import statements in the example load the data using one statement. This is fine for smaller tables – for example, smaller than 10 million rows. For larger we recommend that you use IMPORT with multiple statements. The statements are executed in parallel, which speeds up the import processes.

You should divide the data into similarly sized subsets, so that the import for each statement is balanced for optimal performance. There are different ways to achieve this. Filter conditions on columns that divide the data similarly into the number of statements used are a good option, even more so if there are maintained indexes and histograms on the filter column in Oracle.

Oracle optimizer hints for parallel execution (/*+parallel*/ ) can be used to speed up the select statements in Oracle even further, but keep an eye on the system load on Oracle.

Copy
import into "C##MART".sales 
from ora at oracle_oci 
statement 'select /*+parallel*/ * from "C##MART".SALES where sales_quarter = 1'
statement 'select /*+parallel*/ * from "C##MART".SALES where sales_quarter = 2'
statement 'select /*+parallel*/ * from "C##MART".SALES where sales_quarter = 3'
statement 'select /*+parallel*/ * from "C##MART".SALES where sales_quarter = 4';

If the table in Oracle is partitioned, another option is to access individual partitions directly, making use of partition pruning in Oracle. This is the default approach in the Oracle migration scripts if partitions are available.

Copy
import into "C##MART".sales 
from ora at oracle_oci
statement 'select /*+parallel*/ * from "C##MART".SALES partition("SYS_P124122")'
statement 'select /*+parallel*/ * from "C##MART".SALES partition("SYS_P124137") 
union all  select /*+parallel*/ * from "C##MART".SALES partition("SYS_P124175")'
statement 'select /*+parallel*/ * from "C##MART".SALES partition("SYS_P125112")'
statement 'select /*+parallel*/ * from "C##MART".SALES partition("SYS_P125209") 
union all  select /*+parallel*/ * from "C##MART".SALES partition("SYS_P127135") 
union all  select /*+parallel*/ * from "C##MART".SALES partition("SYS_P128187")';

If the table has no partitions or indexes and there is no easy way to define similarly-sized subsets, the last option is to use the ROWID of the table to assign them into a bucket that can be used as a filter for each statement. In the Oracle migration script, this approach is used if no partitions are available.

Copy
import into "C##MART".sales 
from ora at oracle_oci 
statement 'select /*+parallel*/ * from "C##MART".SALES where ora_hash(rowid, 3) = 0'
statement 'select /*+parallel*/ * from "C##MART".SALES where ora_hash(rowid, 3) = 1'
statement 'select /*+parallel*/ * from "C##MART".SALES where ora_hash(rowid, 3) = 2'
statement 'select /*+parallel*/ * from "C##MART".SALES where ora_hash(rowid, 3) = 3';

Load data using virtual schemas

You can load data from Oracle into Exasol using virtual schemas.

Virtual schemas is an abstraction layer that makes external data sources accessible in Exasol through SQL commands. The contents of the external data sources are mapped to virtual tables that can be queried as any regular Exasol table.

When you use virtual tables within a query, the data is imported into Exasol on the fly. Virtual schemas even support a pushdown feature, which executes filter conditions in Oracle before importing data into Exasol. This minimizes the data volume that needs to be imported.

To learn more about virtual schemas, see Virtual schemas.

Load data from flat files

In some cases, loading data from flat files may be your only viable option. Some of the possible scenarios could be:

  • Extraction of source data is consuming too many Oracle resources – especially for mission-critical production systems – and you cannot extract data at random times.
  • Exasol is running in the cloud and cannot connect directly to an on-premises Oracle system. In that case the data must be staged somewhere accessible to Exasol, such as on a public cloud service.

Importing from a flat file is fast, and there are ways you can speed it up even further.

  • For large data exports, we recommend that you split the data into multiple files so that each file is imported in parallel.

  • Compressing each file into a ZIP, GZIP, or BZIP2 archive could reduce the file size and speed up the import process even further. For more details, see IMPORT.

In Oracle, data from files can be loaded by way of external tables to represent those files as tables in the database. When an external table is selected, the corresponding file is loaded on the fly in the background. This exact behavior is not supported in Exasol, but the behavior can be replicated via a view with a subimport. Another option is just to load the file via an IMPORT into the database.

To get an overview of the external tables and directories, run the query in Appendix D: External tables and directories on Oracle.

After loading the data into Exasol, the next step is to check for the completeness and correctness of the initial load. For more details, see Migration testing.