Migrating Data from Oracle¶
This page covers Oracle-specific setup for Data migration. For workflow and Worker field definitions, see Data migration configuration reference.
Prerequisites¶
- Oracle Instant Client and a matching ODBC driver on each Worker host.
- Service name or TNS configuration for the target database.
- For
dbms_cloudextraction: a source user withEXECUTEonDBMS_CLOUD, a stored credential created withDBMS_CLOUD.CREATE_CREDENTIAL, and a network ACL that allows HTTPS to your object-store endpoint. See Server-side export with dbms_cloud.
Connectivity and extraction¶
Oracle supports two extraction strategies:
dbms_cloud(recommended when prerequisites are met): Oracle exports Parquet directly to object storage withDBMS_CLOUD.EXPORT_DATA, and Snowflake loads from an external stage. Data doesn’t pass through the Worker. Use this for all tables once object storage and the external stage are set up. See Server-side export with dbms_cloud.regular: partitionedSELECTthrough the Worker to Parquet, then the internal migration stage. Use when data volume is genuinely small, or whendbms_cloudprerequisites (DBMS_CLOUD grants, credentials, network ACL) aren’t available yet.
Basic / EZConnect (default)¶
Connection modes¶
| Mode | When to use | Key TOML fields |
|---|---|---|
basic | Standard username/password (EZConnect) | host, database (service name), port |
tns_alias | TNS name resolution | tns_name, optional tns_admin |
connect_descriptor | Full DESCRIPTION block | Connect descriptor per site standards |
Set odbc_driver to the exact name from pyodbc.drivers() on the Worker host, or use auto_detect_driver when appropriate.
Workflow example:
Server-side export with dbms_cloud¶
With the dbms_cloud strategy, Oracle writes Parquet files directly to object storage using DBMS_CLOUD.EXPORT_DATA, and Snowflake loads them from an external stage. Data never flows through the Worker. When the prerequisites below are in place, use dbms_cloud for all tables from the source. It’s the Oracle counterpart to Redshift UNLOAD and Teradata WRITE_NOS.
Oracle prerequisites (a DBA typically handles these once):
- Grant
EXECUTEonDBMS_CLOUDto the source user. - Create a credential for your object store with
DBMS_CLOUD.CREATE_CREDENTIAL. Credentials aren’t grantable, so the same user that runs the export must own it. - Add a network ACL that allows HTTPS to your object-store endpoint (for example
*.amazonaws.com).
Worker TOML on the Oracle source connection (both keys are required; partial configuration is rejected):
dbms_cloud_file_uri_prefixmust start withhttps://. The Worker appends the partition path and anexport_file-name prefix.- Export format defaults to Parquet with snappy compression. Only Parquet loads into Snowflake; don’t override
dbms_cloud_format_clausewith JSON.
Snowflake external stage must point at the same prefix Oracle writes to:
Workflow example:
The workflow references the stage object, not the storage integration. Configuration parsing fails if externalStage is omitted.
Incremental sync¶
Oracle supports all three strategies: none, watermark, and checksum.
For watermark, if your tables don’t have a reliable updated-at column, consider using ORA_ROWSCN — Oracle’s built-in system change number pseudo-column that advances whenever a row is modified. It’s a good default for watermark-based incremental sync on Oracle.
For checksum, AIM DMV computes a partition checksum over the normalized columns. Some Oracle types are excluded from the default hash, so review Changes a checksum may not detect before relying on checksum sync.
Prompt:
Data type mappings¶
| Oracle type | Snowflake target type | Supported for migration | Notes |
|---|---|---|---|
| NUMBER, INTEGER, INT, SMALLINT | NUMBER | Yes | |
| DECIMAL, NUMERIC, DEC | NUMBER | Yes | |
| FLOAT, REAL, BINARY_FLOAT, BINARY_DOUBLE | FLOAT | Yes | |
| DOUBLE PRECISION | FLOAT | Yes | |
| VARCHAR2, NVARCHAR2, VARCHAR | VARCHAR | Yes | Oracle treats empty string as NULL |
| CHAR, NCHAR | VARCHAR | Yes | |
| CLOB, NCLOB | VARCHAR | Yes | Truncated at 4000 characters |
| LONG | VARCHAR | Yes | |
| RAW, BLOB, LONG RAW | BINARY | Yes | |
| BFILE | VARCHAR | Yes | Requires a server DIRECTORY object |
| DATE | TIMESTAMP_NTZ | Yes | |
| TIMESTAMP | TIMESTAMP_NTZ | Yes | |
| TIMESTAMP WITH TIME ZONE | TIMESTAMP_TZ | Yes | |
| TIMESTAMP WITH LOCAL TIME ZONE | TIMESTAMP_LTZ | Yes | |
| INTERVAL YEAR TO MONTH, INTERVAL DAY TO SECOND | INTERVAL | Yes | Native INTERVAL by default. See INTERVAL data type handling. |
| ROWID | VARCHAR(18) | Yes | Stored as the hex string representation of the physical row address |
| UROWID | VARCHAR(4000) | Yes | |
| XMLTYPE | VARIANT | Yes | |
| JSON | VARIANT | Yes | Requires Oracle 21c or later |
| BOOLEAN | BOOLEAN | Yes | Requires Oracle 23ai or later |
| VECTOR | VECTOR(element_type, n) | Yes | Requires Oracle 23ai or later |
| SDO_GEOMETRY | GEOGRAPHY | Yes | Requires Oracle Spatial. Extracted as Well-Known Text. Non-geographic (projected or planar) geometries may not load as GEOGRAPHY; per-SRID routing to GEOMETRY is not available. Map the column to VARCHAR using columnTypeMappings and convert after the load if geometries are non-geographic. |
Platform-specific considerations¶
-
Server-side export (
dbms_cloud): Preferdbms_cloudfor all tables once object storage,DBMS_CLOUDgrants, and the Snowflake external stage are in place. Reserveregularfor genuinely small volume or when those prerequisites aren’t set up yet. See Server-side export with dbms_cloud.Prompt (when prerequisites are met):
Prompt (when object storage isn’t ready yet, or volume is genuinely small):
-
Wallet-based TLS: Use
wallet_directoryandwallet_passwordin Worker TOML when your Oracle environment requires wallet authentication. -
Performance hints: AIM DMV adds an automatic
PARALLELoptimizer hint on large Oracle tables to speed up scans. Override withqueryModifiers.selectModifier, or setselectModifierto"NONE"to disable. See Anti-locking and query modifiers.