Move tables, schemas, and data from Snowflake into Oracle using staged files, external tables, and INSERT-SELECT pipelines.
Cost control, on-prem compliance, and consolidating workloads often drive teams to shift data from Snowflake back to Oracle. Understanding the end-to-end steps prevents data loss and downtime.
1) Export data from Snowflake to cloud storage.2) Transfer staged files to the Oracle server.3) Create matching Oracle schemas.4) Load data with external tables or SQL*Loader.5) Validate counts and constraints.
Use the COPY INTO command with a named stage. Compressing files and using a single partition speeds up small tables.
COPY INTO @mystage/customers.csv
FROM Customers
FILE_FORMAT=(TYPE=CSV HEADER=TRUE)
SINGLE=TRUE;
Download staged files with SnowSQL or cloud CLI, then transfer via SCP or a cloud bucket mapped to the Oracle server.
Translate Snowflake data types (e.g., VARCHAR to VARCHAR2, TIMESTAMP_NTZ to TIMESTAMP) and create tables before loading.
CREATE TABLE customers (
id NUMBER PRIMARY KEY,
name VARCHAR2(255),
email VARCHAR2(255),
created_at TIMESTAMP
);
External tables avoid intermediate staging. Point the LOCATION to the CSV directory and INSERT-SELECT into the target table.
CREATE DIRECTORY load_dir AS '/u01/load/customers';
CREATE TABLE customers_ext
ORGANIZATION EXTERNAL (
TYPE ORACLE_LOADER
DEFAULT DIRECTORY load_dir
ACCESS PARAMETERS (
records delimited by newline
fields terminated by ','
missing field values are null
)
LOCATION ('customers.csv')
)
REJECT LIMIT UNLIMITED;
INSERT /*+ APPEND */ INTO customers
SELECT * FROM customers_ext;
Migrate dimension tables first, then fact tables. Disable foreign keys during load and enable afterward to avoid constraint failures.
Compare row counts and checksums. Sample queries ensure numeric totals match between Snowflake and Oracle.
-- Snowflake
SELECT SUM(TOTAL_AMOUNT) AS sf_sum FROM Orders;
-- Oracle
SELECT SUM(total_amount) AS ora_sum FROM orders;
Parallelize COPY & EXPORT, compress files with GZIP, use APPEND hint in Oracle, and commit in batches to reduce redo.
Yes. Use Snowflake streams to capture changes and apply them in Oracle with periodic batches until cutover.
GoldenGate simplifies continuous replication but is optional. For one-off migrations, staged files and external tables suffice.
Create Oracle sequences with the same start value and increment, then set columns to use them after data load.