Move schema and data from a PostgreSQL database to Oracle while preserving structure, constraints, and data integrity.
Teams switch when they need Oracle’s advanced RAC clustering, built-in partitioning, or tight integration with existing enterprise tooling. Understanding the exact business driver guides tooling choices and testing plans.
ora2pg auto-converts DDL and exports data, Oracle SQL Developer has a Migration Wizard, and custom scripts handle edge cases. Start with ora2pg, then patch remaining objects manually.
1) Assess objects with ora2pg’s -a
report. 2) Generate Oracle-friendly DDL. 3) Export data to flat files or direct INSERT
statements. 4) Load into Oracle with SQL*Loader or SQLPlus. 5) Validate row counts and constraints.
Normalize identifiers to lower case, replace SERIAL
with explicit sequences, and convert JSONB
to CLOB or XML. Resolve reserved words like ORDER
by quoting or renaming.
Edit ora2pg.conf
, setting PG_DSN
, ORACLE_DSN
, SCHEMA
, and EXPORT_SCHEMA
. Use -t
for object type, -o
for output file, and -b
for data directory. Run assessments early to reveal blockers.
For large tables, create CSV with COPY
then use SQL*Loader: sqlldr userid=user/pass control=customers.ctl
. Small tables migrate quickly with generated INSERT ALL
statements from ora2pg.
Compare row counts, checksums, and spot-check monetary columns. Run application test suites against the Oracle instance. Disable production writes on Postgres during the final sync window.
Create repeatable scripts, version control the generated DDL, and run multiple dry-runs. Automate sequence value updates with SELECT setval()
equivalents in Oracle.
Ignoring byte-ordering differences in BYTEA
fields causes corrupt blobs. Forgetting to migrate triggers breaks business rules. Always map TIMESTAMPTZ
to Oracle TIMESTAMP WITH TIME ZONE
.
Only after automated tests, performance benchmarks, and read-only user acceptance testing pass. Use application feature flags for instant rollback if issues surface.
Yes, ora2pg is GPL-licensed and free for all environments.
Absolutely. Use ora2pg's -i
option to specify individual tables or a custom WHERE clause in the config file.