Move schemas and data from Oracle Enterprise Edition to PostgreSQL with oracle_fdw, native exports, and type mapping.
Cut licensing cost, gain open-source flexibility, and adopt PostgreSQL’s extensibility while keeping relational features your app expects.
Small databases move fastest with oracle_fdw
and COPY
. Large or complex setups often combine Oracle Data Pump exports with PostgreSQL import scripts.
On the PostgreSQL server run apt install postgresql-15-oracle-fdw
or build from source against Oracle Instant Client. Restart PostgreSQL to load the shared library.
Create the extension, server, and user mapping, then import the Oracle schema you need. The next section shows exact syntax.
Use IMPORT FOREIGN SCHEMA
to pull in Customers
, Orders
, Products
, and OrderItems
from Oracle into PostgreSQL, preserving column definitions.
Run CREATE TABLE AS SELECT
or COPY (SELECT *)
against each foreign table. This copies data into native PostgreSQL storage, removing the Oracle dependency.
Re-create Oracle sequences with CREATE SEQUENCE
. Translate triggers to PostgreSQL PL/pgSQL or extensions like pg_partman
when needed.
Run row-count checks, sample checksums, and business-level queries (e.g., total revenue) on both systems. Differences highlight missing rows or type mismatches.
Stage migration in a sandbox, freeze Oracle writes during final cut-over, and update application connection strings atomically to avoid split-brain issues.
Yes. oracle_fdw needs Oracle client libraries, which are free, but querying a live Oracle database still consumes an Oracle license.
CLOBs and BLOBs migrate if you set oracle_fdw.max_long_size
high enough and ensure network throughput matches data size.
Rewrite business logic in PL/pgSQL or as application code. Tools like ora2pg generate starter scripts but manual review is mandatory.