The Complete Oracle to Postgres Migration Guide Move and convert Schema, Application & Data
The Complete Oracle to Postgres Migration Guide Move and convert Schema, Application & Data
(/)
Enterprises are increasingly making the move from Oracle databases to open source Postgres.
This complete guide to migration gives you everything you need to know about moving your
database from Oracle to Postgres.
For anyone on the fence or intimidated by the process of data migration, it recaps the advantages
of Postgres over Oracle as a database system and the bene�ts of adopting Postgres, namely
cost, �exibility and customizability. It then breaks the migration process down into individual
phases (assessment, schema migration, functional testing, performance testing and data
migration) and provides step-by-step instruction on each one. Key differences and
incompatibilities between the two database systems are itemized to help users avoid common
mistakes. Alternate migration strategies are also weighed, and a list of helpful free data migration
tools is provided.
This guide is intended for anyone preparing to make the move from Oracle to Postgres, and
should also provide assurance to any current Oracle users considering Postgres but concerned
about the complexity of the move.
1 of 30 4/21/2023, 8:33 AM
The Complete Oracle to Postgres Migration Guide: Move and convert ... https://www.enterprisedb.com/blog/the-complete-oracle-to-postgresql-m...
best-bet) will undergo different phases—like picking the right schema, performing compatibility
checks, converting incompatible objects, functional and performance testing, data migration and
post-migration check.
1. Cost: In addition to Oracle license costs, using Oracle databases incurs additional costs for
features like partitioning and high availability, and expenses can add up quickly. Open-source
Postgres is free to install and use.
2. Flexibility: Postgres has open-source licensing and is easily available from public cloud
providers, including AWS. With Postgres, you’re not at risk of vendor lock-in.
3. Customizability: Because Postgres is open-source, there are countless extensions and add-
ons that can improve database performance markedly, and many of them are free to use. With
Oracle, similar features quickly add up in cost.
That’s not to say that migrating from Oracle to Postgres is not an involved process. Since the
data migration is between two relational database management systems (RDBMS), it can be a
challenging and time-consuming process due to heterogeneous structure/data types. As such,
you want to be sure it’s tackled and handled with the right tools. Follow the steps below and you’ll
be well on your way.
2 of 30 4/21/2023, 8:33 AM
The Complete Oracle to Postgres Migration Guide: Move and convert ... https://www.enterprisedb.com/blog/the-complete-oracle-to-postgresql-m...
4. Languages
5. Localization
�. Performance
7. Scalability
3 of 30 4/21/2023, 8:33 AM
The Complete Oracle to Postgres Migration Guide: Move and convert ... https://www.enterprisedb.com/blog/the-complete-oracle-to-postgresql-m...
character support. Postgres' localization system services are built-in to provide automatic
character encoding and collation support.
1. Assessment
2. Schema Migration
3. Functional Testing
4. Performance Testing
5. Data Migration
4 of 30 4/21/2023, 8:33 AM
The Complete Oracle to Postgres Migration Guide: Move and convert ... https://www.enterprisedb.com/blog/the-complete-oracle-to-postgresql-m...
This is the �rst step in planning the migration and analyzing the application to estimate how easy
or di�cult it will be to migrate it from Oracle to Postgres. In this phase, a thorough analysis
should be conducted on technology-related issues and to evaluate the compatibility of client,
application server, data access and database features.
One concern that is so basic that it can easily be overlooked when considering a move to
Postgres is con�rming that, if you do not control your own application, the packaged software
application you are using certi�es for Postgres. If not, you’ll either need to convince your
application’s vendor to add Postgres support, or choose another application.
After verifying the source and target database compatibility, the following prerequisites should be
met for data migration:
• Server resources (memory/disk space/network ports opened between source and destination)
• Operating system
• Data migration software and related drivers installed and con�gured
It should go without saying that your target server resources are large enough and have the
scalability to handle the volume of data they will be receiving. If the volume of data is very large,
then a purely online migration may not be advisable, and you should consider an export-and-
reload approach. It may also be wise to follow a migration strategy that divides the migration into
parts (see the section on migration strategies below.
The more your application code relies on Oracle-speci�c frameworks, as opposed to open
classes, the more intricate your migration becomes. The amount of adjustment you will need to
make depends on your application architecture and database connection layer. If you have Java
We usethat
code cookies
uses ongeneric
this site JDBC for operational,
classesanalytic,rather than and Oracle-speci�c ones, the conversion should be
marketing purposes,
relatively easy. It shouldincluding to improve
similarly beyoureasy site if you use an object-relational mapping (ORM) such as
experience. For more information see our P r i v a c y P o l i c y
Hibernate or JCA. It could be trivially easy to switch the dialect
Cookie from Oracle
preferences toitPostgres, though
Okay, got
( h t t p s : / /w w w. e n t e r p r i s e d b. c o m / p r i v a c y - p o l i c y ) and
some adjustments will still need to be made.
C o o k i e P o l i c y ( h t t p s : / / w w w. e n t e r p r i s e d b . c o m
/c o o k i e s - p o l i c y ) .
5 of 30 4/21/2023, 8:33 AM
The Complete Oracle to Postgres Migration Guide: Move and convert ... https://www.enterprisedb.com/blog/the-complete-oracle-to-postgresql-m...
The situation is more complex if you use embedded SQL such as Oracle’s Pro*C, dynamically
built SQL, or link to Oracle-speci�c libraries such as OCI or the Oracle JDBC classes. Adjusting
these requires a solid understanding of the underlying application logic and should be carefully
tested.
The ease or di�culty of a migration can be signi�cantly impacted by the setup and architecture
of your database and its contents. Migration presents a good opportunity to clean up your
architecture and database contents. Deprecate objects you no longer need, such as old
temporary tables or backup copies of data—they’re not worth migrating if no one cares about
them. If you store large �les, like images or PDFs in your database, consider whether you can
separate them into a lower-cost storage option to reduce database size and resources needed for
backup and restores. You may want to purge static historical data or move into an archival store
option.
Moving from Oracle to Postgres also opens the possibility of separating online transaction
processing (OLTP) and analytics into different warehouses, which can improve both
responsiveness and analytics capabilities.
Following assessment, the next step in the migration process is to identify and address
differences in schema and data formatting between Oracle and Postgres. It is crucial to make
these adjustments prior to the data migration to avoid frustrating and time-consuming errors in
Postgres.
Postgres supports ANSI SQL standard SQL syntax and data types, whereas Oracle does not
support the same standard; additionally, it includes some non-ANSI SQL syntaxes. Using tools,
unsupported objects should be identi�ed and then converted manually with Postgres-supported
syntax or feature workarounds.
Weschema
A use cookies on this
is also site foras
known operational,
a “User” inanalytic,
Oracleand and has the same name as the user. The default is
marketing purposes, including to improve your site
for each Oracle user to have their own schema. In Postgres, these are not the same, and if you do
experience. For more information see our P r i v a c y P o l i c y
not explicitly specify a schema, new objects will go to Cookie a public schema by
preferences default.
Okay, got it
( h t t p s : / /w w w. e n t e r p r i s e d b. c o m / p r i v a c y - p o l i c y ) and
C o o k i e P o l i c y ( h t t p s : / / w w w. e n t e r p r i s e d b . c o m
• Create a user and schema with the same name
/c o o k i e s - p o l i c y ) .
6 of 30 4/21/2023, 8:33 AM
The Complete Oracle to Postgres Migration Guide: Move and convert ... https://www.enterprisedb.com/blog/the-complete-oracle-to-postgresql-m...
One advantage to the set up in Postgres is that a user can create multiple schemas without
having to create separate users, and can grant permissions for creating objects in those schemas
to others.
There are a number of migration tools available that can help users automate schema
conversion. Below are the tools you can try for free for converting the Oracle objects to Postgres.
7 of 30 4/21/2023, 8:33 AM
The Complete Oracle to Postgres Migration Guide: Move and convert ... https://www.enterprisedb.com/blog/the-complete-oracle-to-postgresql-m...
In addition, there are a number of commercial conversion tools available, including Amazon’s
AWS Schema Conversion Tool (AWS SCT).
The below tools comparison matrix will give you a high-level picture of what they can do and how
far they get you in the migration exercise to a speci�c target.
8 of 30 4/21/2023, 8:33 AM
The Complete Oracle to Postgres Migration Guide: Move and convert ... https://www.enterprisedb.com/blog/the-complete-oracle-to-postgresql-m...
When preparing for schema conversion, pay special attention to the following differences
between Oracle and Postgres.
Until version 12, Postgres did not have any equivalent to virtual columns, so users were
encouraged to change these to views when migrating. Now Postgres offers generated columns,
which share many traits with Oracle’s virtual columns.
In both database systems the Primary and Foreign Key, Check, Not-Null and Unique, constraints
all operate more or less the same way.
Oracle converts names of schema, tables, columns and functions to uppercase, unless the name
is given in quotes, while Postgres converts them to lower case (also unless given in quotes). As
long as the application consistently quotes or does not quote the identi�ers, you should be safe.
Hash, List, and Range partitions should all work in Postgres following migration.
We use cookies on this site for operational, analytic, and
marketing purposes, including to improve your site
experience. For more information see our P r i v a c y P o l i c y
Cookie preferences Okay, got it
( h t t p s : / /w w w. e n t e r p r i s e d b. c o m / p r i v a c y - p o l i c y ) and
Tables when migrating from Oracle to Postgres
C o o k i e P o l i c y ( h t t p s : / / w w w. e n t e r p r i s e d b . c o m
/c o o k i e s -TABLE
CREATE p o l i c y ) .is mostly compatible, with the following exceptions:
9 of 30 4/21/2023, 8:33 AM
The Complete Oracle to Postgres Migration Guide: Move and convert ... https://www.enterprisedb.com/blog/the-complete-oracle-to-postgresql-m...
• Postgres lacks global temporary tables. Use temporary tables (LOCAL TEMP) instead.
• Partitioning: Use Inheritance, Triggers, and CHECK Constraints for partition clauses.
• Storage clause parameters (INITRANS, MAXEXTENTS) are not recognized in Postgres and
should be removed.
• For the Oracle PCTFREE parameter, replace it with Postgres' �llfactor.
There are differences between Oracle and Postgres' versions of tablespaces, but they serve the
same purpose and should work.
The following chart lists notable differences between Oracle and Postgres data types.
VARCHA VARC VARCHA Be careful not to confuse ‘n’ in Oracle and Postgres data
R2(n) HAR( R2(n), types. In Oracle it stands for the size in bytes; in Postgres it
n) stands for the number of characters.
VARCHA
R(n)
10 of 30 4/21/2023, 8:33 AM
The Complete Oracle to Postgres Migration Guide: Move and convert ... https://www.enterprisedb.com/blog/the-complete-oracle-to-postgresql-m...
CHAR(n), CHA CHAR(n), Be careful not to confuse ‘n’ in Oracle and Postgres data
NCHAR(n R(n) types. In Oracle it stands for the size in bytes; in Postgres it
NCHAR(n
) stands for the number of characters.
),
INT
BIGINT
11 of 30 4/21/2023, 8:33 AM
The Complete Oracle to Postgres Migration Guide: Move and convert ... https://www.enterprisedb.com/blog/the-complete-oracle-to-postgresql-m...
DATE TIME DATE In Oracle the DATE type returns both date and time, whereas
STA in Postgres the DATE type returns the date without the time.
TIMESTA
MP(0
MP(0)
)
TIMESTA TIME TIMESTA Oracle has both TIMESTAMP WITH TIME ZONE and
MP WITH STA MP WITH TIMESTAMP WITH LOCAL TIME ZONE data types. Postgres'
LOCAL MPT LOCAL TIMESTAMPTZ is equivalent to TIMESTAMP WITH LOCAL
TIME Z TIME TIME ZONE. If these are confused it can introduce errors.
ZONE ZONE
TIMESTA
MPTZ
TEXT
BLOB, BYTE BLOB, In Oracle,the BLOB datatype is used for unstructured binary
A(1 data and essentially has no size limit (up to 128 terabytes of
RAW(n), RAW(n),
GB binary data). Postgres' BYTEA data type can store up to 1 GB
LONG limit) LONG of binary data. Above that limit use Large Object (these are
RAW RAW stored in a separate table).
Large
objec BYTEA(1
t GB limit)
Large
Object
NLS_DAT Date DateStyle These are parameters that set the format for how date
E_FORMA Style information is displayed. The default style for
T Postgres' DateStyle is ISO. Oracle’s default is inherited from
the NLS_TERRITORY parameter.
12 of 30 4/21/2023, 8:33 AM
The Complete Oracle to Postgres Migration Guide: Move and convert ... https://www.enterprisedb.com/blog/the-complete-oracle-to-postgresql-m...
1) Constraints
While Oracle allows users to disable and enable constraints as often as you want, this is not
generally recommended practice for any RDBMS, because it can lead to data corruption if not
performed with proper care.
In Postgres, constraints are instead created as deferrable, and the SET CONSTRAINTS command
can be used to defer them. The deferrable setting indicates the default time for activating the
constraint. If the constraint in Oracle is not deferrable, it will need to be dropped and re-created as
deferrable, though it is sometimes possible to alter the constraint without having to drop it. Note:
to avoid potential errors or bad data, place the commands for dropping and re-creating the
constraint in a transaction, marked with a BEGIN/COMMIT block, which will lock the tables during
the transaction.
2) DELETE
The FROM clause for specifying the table is required with DELETE statements in Postgres but not
in Oracle.
Oracle:
Postgres:
In Postgres, permission to drop objects is restricted to only a database table’s owner or a super
user. It is not a grantable privilege, although membership in the role that owns the object can be
granted. If an action in Oracle depends on this ability, it may need to be rewritten or recon�gured.
We use cookies on this site for operational, analytic, and
marketing purposes, including to improve your site
4) Dual Table
experience. For more information see our P r i v a c y P o l i c y
Cookie preferences Okay, got it
( h t t p s : / /w w w. e n t e r p r i s e d b. c o m / p r i v a c y - p o l i c y ) and
Because the FROM clause is mandatory in Oracle for every SELECT statement, FROM DUAL is
C o o k i e P o l i c y ( h t t p s : / / w w w. e n t e r p r i s e d b . c o m
used for SELECT statements where the table name is not necessary. Postgres does not require
/c o o k i e s - p o l i c y ) .
13 of 30 4/21/2023, 8:33 AM
The Complete Oracle to Postgres Migration Guide: Move and convert ... https://www.enterprisedb.com/blog/the-complete-oracle-to-postgresql-m...
the FROM clause, so FROM DUAL is not necessary and can usually be omitted. If the Dual table is
needed in Postgres, it can be generated as a view.
In Oracle, empty strings have NULL values, but they are not considered NULL in Postgres.
In Oracle, you can check whether a string is empty or not using the IS NULL operator, but in
Postgres, it would return FALSE for an empty string (and TRUE for a NULL one).
Oracle’s Federation feature allows users to treat tables from other databases as local data.
Postgres' foreign data wrappers are more versatile and allow you to connect to a wider range of
data.
7) GRANT
The GRANT command behaves similarly in Oracle and Postgres. There are two basic variants—it
can be used to grant privileges on a database object and to grant membership to a role.
Not all privileges that are grantable in Oracle are grantable in Postgres. For example, granting the
trigger privilege to a table allows users to create triggers; but, as opposed to Oracle, only the
owner of the table can drop triggers.
8) Hierarchical queries
Postgres does not support the START WITH . . . CONNECT BY syntax that Oracle uses for
hierarchical queries. Instead, Postgres uses WITH RECURSIVE.
Oracle:
14 of 30 4/21/2023, 8:33 AM
The Complete Oracle to Postgres Migration Guide: Move and convert ... https://www.enterprisedb.com/blog/the-complete-oracle-to-postgresql-m...
SELECT
business_name,
city_name
FROM
businesses bs
Postgres:
FROM businesses
UNION
FROM businesses t
Oracle has a special shorthand (+) operator for performing left and right outer joins. Postgres
lacks this feature, so the JOIN command would need to be supplied.
15 of 30 4/21/2023, 8:33 AM
The Complete Oracle to Postgres Migration Guide: Move and convert ... https://www.enterprisedb.com/blog/the-complete-oracle-to-postgresql-m...
Postgres:
FROM table1
To determine which columns in an Oracle table are NOT NULL, you would use the command
CHECK (<column_name> IS NOT NULL).
Postgres instead has a NOT NULL constraint column named attnotnull in pg_attribute, the
systems catalog where information about table columns is stored.
11) Packages
Postgres does not have packages, but, using schema architecture, functions and procedures can
be grouped. Use the “orafce” migration tool library, which supports some of the standard
packages, or EDB Postgres Advanced Server (https://www.enterprisedb.com/products/edb-
postgres-advanced-server-secure-ha-oracle-compatible), which has built-in Packages.
16 of 30 4/21/2023, 8:33 AM
The Complete Oracle to Postgres Migration Guide: Move and convert ... https://www.enterprisedb.com/blog/the-complete-oracle-to-postgresql-m...
To access remote objects, the DBLINK module or Foreign Data Wrapper(Oracle_fdw) can be used
to access any other database.
Postgres does not have an exact equivalent to the ROWID pseudocolumn in Oracle, which
provides the address of a row in a table. CTID in Postgres is similar, except that its value changes
every time VACUUM is performed. Instead, you can use identity columns, whose value is self-
generated when a row is created and never changes. The value can be speci�ed to be
GENERATED ALWAYS or GENERATED BY DEFAULT. GENERATED BY DEFAULT allows the user the
option to insert or update a value rather than use the system-generated value.
14) Sequences
Sequences have a different syntax in Oracle and Postgres and will need to be updated either
manually or using a script.
Oracle:
Mysequence.nextval;
Postgres:
nextval(‘mysequence’);
17 of 30 4/21/2023, 8:33 AM
The Complete Oracle to Postgres Migration Guide: Move and convert ... https://www.enterprisedb.com/blog/the-complete-oracle-to-postgresql-m...
16) Synonyms
Postgres does not support synonyms. In place of Oracle’s CREATE SYNONYM for accessing
remote objects, Postgres has you use SET search_path to include the remote de�nition.
Oracle:
Postgres:
17) SYSDATE
Oracle's SYSDATE function returns date and time (in the server’s timezone). Postgres does not
have a corresponding function, but there are a range of methods for retrieving the date and time
for different purposes: statement_timestamp() gives current date and time from the beginning of
the current statement; now() and transaction_timestamp() give the date and time from the
beginning of the current transaction, and clock_timestamp() gives current date and time from the
execution of the function.
18) TO_DATE
The to_date() function in both Oracle and Postgres return the date data type. However, Postgres'
date data type provides the date (year, month, day), while Oracle’s date data type value provides
the date and time (year, month, day, hour, minute, second). To avoid this incompatibility, use
Postgres' to_timestamp().
We use cookies on this site for operational, analytic, and
marketing
The solution purposes,
for this including to improve your
incompatibility is tositeconvert TO_DATE() to TO_TIMESTAMP(). If you use
experience. For more information see our P r i v a c y P o l i c y
Orafce tool (https://github.com/orafce/orafce) then it Cookie is not necessary to
preferences change
Okay, got it anything
( h t t p s : / /w w w. e n t e r p r i s e d b. c o m / p r i v a c y - p o l i c y ) and
because Orafce implemented this function so we get the same result as Oracle.
C o o k i e P o l i c y ( h t t p s : / / w w w. e n t e r p r i s e d b . c o m
/c o o k i e s - p o l i c y ) .
18 of 30 4/21/2023, 8:33 AM
The Complete Oracle to Postgres Migration Guide: Move and convert ... https://www.enterprisedb.com/blog/the-complete-oracle-to-postgresql-m...
Oracle:
Postgres:
19) Transactions
Oracle always uses transactions, but in Postgres, they must be activated. In Oracle, executing any
statement starts a transaction, and it ends with the COMMIT statement. In Postgres, the
transaction starts with the BEGIN statement, and it also ends with the COMMIT statement.
Transaction isolation levels are the same in Postgres and Oracle, and Read Committed is the
default isolation level for both.
Postgres is built to facilitate transaction management and error handling, with full ACID support
and isolation levels. It is also capable of handling run-time errors and provides reliable error
codes and messages to PL/pgSQL or application code. These are handled differently from
Oracle, though, so changes still need to be made. Here are some tips for optimizing error
handling for Postgres:
• Transaction control inside of PL/pgSQL is not permitted: you cannot commit or roll back a
transaction inside a stored procedure. Commits and roll backs must be called from the
application, so the application that calls the stored procedure must perform the transaction
management—starting and committing or rolling back. The stored procedure executes within
that calling transaction context. Obviously, if your existing database code has transaction
Wemanagement
use cookies on this in procedures, it must
site for operational, be modi�ed.
analytic, and
marketing
• When there purposes, is aincluding
run-timetoexception
improve your site a transaction, the transaction must be rolled back
during
experience. For more information see our P r i v a c y P o l i c y
before you can execute another statement, becauseCookie thepreferences
transaction is aborted
Okay, got it when it
( h t t p s : / /w w w. e n t e r p r i s e d b. c o m / p r i v a c y - p o l i c y ) and
C o oencounters
k i e P o l i c y ( hthe
t t p serror.
: / /w wThe
w. e napplication
t e r p r i s e d b. clog
o m will show the following error message:
/c o o k i e s - p o l i c y ) .
19 of 30 4/21/2023, 8:33 AM
The Complete Oracle to Postgres Migration Guide: Move and convert ... https://www.enterprisedb.com/blog/the-complete-oracle-to-postgresql-m...
ERROR: current transaction is aborted, commands ignored until end of transaction block.
Be sure that you have an exception handler set up where errors might be occurring and eithe
r to a savepoint or close the connection before trying another database operation.
• Use a BEGIN…EXCEPTION…END block for exception handling so your code catch any errors
that occur. This automatically sets a savepoint before the block and rolls back to it when it
encounters an exception. Keep in mind that because exception blocks create a savepoint, they
are expensive, so add them carefully.
• Map the error codes and exception types from Oracle to Postgres. While some error codes are
the same in both, others are different. Your programming language affects this as well—for
example, Oracle-speci�c JDBC exceptions need to be replaced with either generic cross-
database exceptions or Postgres-speci�c ones.
• Ensuring your Postgres database handles transactions and errors correctly is a critical part of
the migration process and usually requires a careful review of the database and application
code.
For enterprises looking to retain some oracle functionality in Postgres and wanting to migrate
faster without many code rewrites an option is to move to EDB Postgres Advanced Server. EDB
Postgres Advanced server (https://www.enterprisedb.com/products/edb-postgres-advanced-
server-secure-ha-oracle-compatible) is Oracle compatible Postgres with native PL/SQL
compatibility. The below video demonstrates how the Advanced Server handles Oracle queries:
20 of 30 4/21/2023, 8:33 AM
The Complete Oracle to Postgres Migration Guide: Move and convert ... https://www.enterprisedb.com/blog/the-complete-oracle-to-postgresql-m...
Before proceeding further, it is important to test the converted schema on a sample dataset. A
recommended approach is to load some sample data into Postgres from a source database
development or testing environment where there’s production sample data, and then set up an
application connection using appropriate data access (drivers). After the application has
connected to the database, allow it to do full functional testing on the converted objects with
DMLs.
It is advisable to load the same sample dataset in both the Oracle and Postgres databases, then
test both to make sure the SQL results are identical. Review and address any issues revealed by
the functional tests.
21 of 30 4/21/2023, 8:33 AM
The Complete Oracle to Postgres Migration Guide: Move and convert ... https://www.enterprisedb.com/blog/the-complete-oracle-to-postgresql-m...
There are different approaches for data migration and tools available in the market. Usually, they
are classi�ed in three ways
For approaches 1 and 2, we need application downtime because data is being written one time
from Oracle to Postgres, whereas in approach 3 data is loaded continuously, and there is a
smaller downtime window. Pick the right data migration approach that �ts in the downtime
window.
Let's discuss these three data migration strategies in a little more detail.
In this approach, a snapshot of the source database state is taken and applied on the target
database. Data is moved from Oracle to Postgres all at once. During the snapshot process, no
WRITE operations are allowed on the source database. It's one of the cleaner and easier methods
of data migration.
Pros
22 of 30 4/21/2023, 8:33 AM
The Complete Oracle to Postgres Migration Guide: Move and convert ... https://www.enterprisedb.com/blog/the-complete-oracle-to-postgresql-m...
Parallel in chunks is another type of snapshot approach where data objects are broken into
chunks and snapshots are taken in parallel. Most of the tools support snapshot and the process
are invoked in tandem. There are two ways to perform a snapshot in chunks: 1) table by table or
2) a large table split into small sets using primary keys or any unique row identi�ers. In this
approach, the snapshot duration and downtime window is greatly reduced. Good scripting skills
required to prepare data migration tools for table or large table migration.
Pros
Cons
There
We use are different
cookies on thistraditional Changeanalytic,
site for operational, Data Capture
and (CDC) (https://en.wikipedia.org
marketing purposes, including to improve your site
/wiki/Change_data_capture) approaches that have been available for decades. In the CDC model
experience. For more information see our P r i v a c y P o l i c y
Cookie preferences
data
( h t t p smigration,
: / /w w w. e n tthe e r psoftware
r i s e d b.c o mis/ pdesigned
r i v a c y - p oto
l i c ydetermine/track/capture
) and theOkay,
data got it
that has changed
on
C o othek i e source
P o l i c y ( hdatabase
t t p s : / /w win w. ereal-time
n t e r p r i s eand
d b. creplay
om the same on the target database. Today CDC
model
/c o o k i esoftware
s - p o l i c y ) . is in high demand because they distribute data between heterogeneous
23 of 30 4/21/2023, 8:33 AM
The Complete Oracle to Postgres Migration Guide: Move and convert ... https://www.enterprisedb.com/blog/the-complete-oracle-to-postgresql-m...
databases with low-latency, reliable, and scalable data. Most common CDC approaches for
migrating Oracle to Postgres databases are:
• Trigger-based
• Transaction Log-based
Transaction Log-based (CDC)—every database will have transaction logs (redos) to store all
database transactions/events sequentially and be used in case of database crash recovery. Using
native database transaction log plug-ins the transactions (DMLs) can be captured to change logs
with some �lters, transforms, and aggregations. Later, the sequence of captured DMLs will be
replicated to the target database.
Both CDC approaches can be used to replicate data from Oracle to Postgres. However, each has
its own merits and limitations, depending on the requirements we can choose one of the
available approaches. There are very good software options available to support both CDC
approaches.
Pros
We use cookies on this site for operational, analytic, and
marketing
• Data loaded purposes, including to improve
continuously to target your site
database (after initial snapshot)
experience. For more information see our P r i v a c y P o l i c y
• User can access source database while data loads Cookie
( h t t p s : / /w w w. e n t e r p r i s e d b. c o m / p r i v a c y - p o l i c y ) and
preferences
to target databaseOkay, got it
C•o oData
k i e Psync
o l i c y (control
h t t p s : / /(if
w winterrupted,
w. e n t e r p r i s eitd can
b.c o m
be resumed)
/c o o k i e s - p o l i c y ) .
24 of 30 4/21/2023, 8:33 AM
The Complete Oracle to Postgres Migration Guide: Move and convert ... https://www.enterprisedb.com/blog/the-complete-oracle-to-postgresql-m...
Cons
There are open and free to use tools available for data migration in three different categories we
have discussed in the blog. Below are the set of tools that we came across under those
categories:
• Snapshot
• Ora2pg (https://github.com/darold/ora2pg)
• Others (Full convert, Ispirer)
• Snapshot - Parallel in chunks
• Schema Tables
• Ora2pg (https://github.com/darold/ora2pg), ora_migrator
• EDB Migration Toolkit (https://www.enterprisedb.com/downloads/edb-migration-toolkit)
• Large table in sets
• EDB dblink_ora module (https://www.enterprisedb.com/downloads/edb-postgres-
advanced-server)
• Oracle FDW(ora_fdw)
• Change Data Capture
• EDB Replication Server (https://www.enterprisedb.com/downloads/edb-postgres-
replication-server)
We use cookies
• Other on this
tools site forGG,
(Oracle operational,
DBConvert analytic, and
marketing purposes, including to improve your site
experience. For more information see our P r i v a c y P o l i c y
Cookie preferences Okay, got it
( h t t p s : / /w w w. e n t e r p r i s e d b. c o m / p r i v a c y - p o l i c y ) and
C o o k i e P o l i c y ( h t t p s : / / w w w. e n t e r p r i s e d b . c o m
/c o o k i e s - p o l i c y ) .
25 of 30 4/21/2023, 8:33 AM
The Complete Oracle to Postgres Migration Guide: Move and convert ... https://www.enterprisedb.com/blog/the-complete-oracle-to-postgresql-m...
We hope this blog has provided you with information you need to begin planning an effective
Oracle to Postgres migration!
Share this
Relevant Blogs
We use cookies on this site for operational, analytic, and
marketing purposes, including to improve your site
experience. For more information see our P r i v a c y P o l i c y
Cookie preferences Okay, got it
( h t t p s : / /w w w. e n t e r p r i s e d b. c o m / p r i v a c y - p o l i c y ) and
C o o k i e P o l i c y ( h t t p s : / / w w w. e n t e r p r i s e d b . c o m
/cApril
o o k i10,
e s - 2023
policy). (/blogs?category=)
26 of 30 4/21/2023, 8:33 AM
The Complete Oracle to Postgres Migration Guide: Move and convert ... https://www.enterprisedb.com/blog/the-complete-oracle-to-postgresql-m...
(/blog/EDB-Big-Animal-Winning%20Combination-Public-Cloud)
27 of 30 4/21/2023, 8:33 AM
The Complete Oracle to Postgres Migration Guide: Move and convert ... https://www.enterprisedb.com/blog/the-complete-oracle-to-postgresql-m...
(/blog/true-cost-cloud-migration)
(/blog/move-to-public-cloud-not-Oracle)
28 of 30 4/21/2023, 8:33 AM
The Complete Oracle to Postgres Migration Guide: Move and convert ... https://www.enterprisedb.com/blog/the-complete-oracle-to-postgresql-m...
More Blogs
(https://www.linkedin (https://twitter (https://www.youtu (https://www.fac
.com/company .com be.com ebook.com
/enterprisedb) /EDBPostgres /user/EnterpriseDB /EDBpostgres)
) )
database-service-dbaas-tutorial-how-use-managed-
database-service-postgresql)
Careers (/careers)
29 of 30 4/21/2023, 8:33 AM
The Complete Oracle to Postgres Migration Guide: Move and convert ... https://www.enterprisedb.com/blog/the-complete-oracle-to-postgresql-m...
30 of 30 4/21/2023, 8:33 AM