How it works


Ora2Pg is a free tool used to migrate an Oracle or MySQL database to a PostgreSQL compatible schema. It connects your Oracle database, scan it automatically and extracts its structure or data, it then generates SQL scripts that you can load into your PostgreSQL database.

Ora2Pg can be used from reverse engineering Oracle database to huge enterprise database migration or simply to replicate some Oracle data into a PostgreSQL database. It is really easy to used and doesn't need any Oracle database knowledge than providing the parameters needed to connect to the Oracle database.


  • Export full database schema (tables, views, sequences, indexes), with unique, primary, foreign key and check constraints.
  • Export grants/privileges for users and groups.
  • Export range/list partitions and sub partitions.
  • Export a table selection (by specifying the table names).
  • Export Oracle schema to a PostgreSQL 8.4+ schema.
  • Export predefined functions, triggers, procedures, packages and package bodies.
  • Export full data or following a WHERE clause.
  • Full support of Oracle BLOB object as PG BYTEA.
  • Export Oracle views as PG tables.
  • Export Oracle user defined types.
  • Provide some basic automatic conversion of PLSQL code to PLPGSQL.
  • Works on any plateform.
  • Export Oracle tables as foreign data wrapper tables.
  • Export materialized view.
  • Show a detailled report of an Oracle database content.
  • Migration cost assessment of an Oracle database.
  • Migration difficulty level assessment of an Oracle database.
  • Migration cost assessment of PL/SQL code from a file.
  • Migration cost assessment of Oracle SQL queries stored in a file.
  • Generate XML ktr files to be used with Penthalo Data Integrator (Kettle)
  • Export Oracle locator and spatial geometries into PostGis.
  • Export DBLINK as Oracle FDW.
  • Export SYNONYMS as views.
  • Export DIRECTORY as external table or directory for external_file extension.
  • Full MySQL export just like Oracle database.

See a Migration assessment report sample of an Oracle database.