SlideShare une entreprise Scribd logo
1  sur  41
Télécharger pour lire hors ligne
STUMBLING STONES
WHEN MIGRATING
FROM ORACLE
BY LAURENZ ALBE
ABOUT
ME AND MY
COMPANY
■ Who is Laurenz Albe?
■ Who is CYBERTEC?
LAURENZ ALBE
SENIOR DATABASE CONSULTANT
■ contributions to PostgreSQL and related
projects since 2006
■ maintainer of the Oracle Foreign Data Wrapper
■ PostgreSQL support, training, consulting and
development
■ working for CYBERTEC since 2017
M A I L laurenz.albe@cybertec.at
P H O N E +43 2622 930 22-7
W E B www.cybertec-postgresql.com
Specialized in data services
About Inhouse development
Owner-managed since 2000
International team of developers
DATABASE SERVICES
DATA Science
▪ Artificial Intelligence
▪ Machine Learning
▪ Big Data
▪ Business Intelligence
▪ Data Mining
▪ etc.
POSTGRESQL Services
▪ 24/7 Support
▪ Training
▪ Consulting
▪ Performance Tuning
▪ Clustering
▪ etc.
▪ ICT
▪ University
▪ Government
▪ Automotive
▪ Industry
▪ Trade
▪ Finance
▪ etc.
CLIENT
SECTORS
AGENDA
■ Overview
■ Understanding open source and PostgreSQL
■ Migrate the schema (DDL)
■ Data migration
■ Migrating stored code
■ Migrating SQL
■ Migrating the application
■ Migration tools
OVERVIEW
MIGRATION STEPS
■ understand open source software and PostgreSQL
■ migrate the schema (DDL)
■ migrate the data
■ migrate stored code (PL/SQL, Java)
■ migrate SQL
■ migrate the application
MIGRATION STEPS
(ACTUAL SIZE)
■ understand open source software and PostgreSQL
■ migrate the schema (DDL)
■ migrate the data
■ migrate stored code (PL/SQL, Java)
■ migrate SQL
■ migrate the application
UNDERSTANDING OPEN
SOURCE AND POSTGRESQL
THE SHIFT TO OPEN SOURCE
■ This is written by some enthusiasts in their spare time, right?
■ Is this “enterprise ready”?
■ Where can I get support?
■ Why do I have to install and integrate so many different pieces of
software (PostgreSQL, PostGIS, backup software, extensions, GUI clients,
monitoring,...)?
■ What if open source software is no longer maintained?
■ It’s for free, so I don’t have to invest anything, right?
TRANSACTIONS, UNDO,
MULTIVERSIONING
■ both Oracle and PostgreSQL use multiversioning, so concurrency and locking
are similar (but not equal!)
■ big transactions are no problem in PostgreSQL (but long transactions are), so
less need to “batch” large transactions
■ no UNDO tablespace in PostgreSQL, no “snapshot too old”, immediate rollback
But:
■ UPDATE-heavy workloads are problematic in PostgreSQL (may need “HOT
update” and autovacuum tuning)
■ table size will grow (all that visibility information)
■ I no statement-level rollback
SCHEMAS, USERS AND
SYNONYMS
Oracle has a reduced metadata model:
■ a schema is always tied to a user with the same name
■ ownership is determined by the schema
■ only objects in your own schema can be referenced without schema
Synonyms are there largely to overcome these limitations
■ can often be replaced by an appropriate search_path setting
■ for other uses, a view is usually just as good
VIEWS AND DEPENDENCIES
■ Oracle tables be dropped/modified even if views depend on them
■ views become “invalid” and cause an error when used
■ PostgreSQL is stricter about data integrity
■ Schema upgrade procedures more difficult in PostgreSQL
■ but to make up for it, we have transactional DDL
■ Materialized View support much more sophisticated in Oracle
■ replace ON COMMIT REFRESHwith triggers in PostgreSQL
TABLESPACES
■ tablespaces are important in Oracle
■ Oracle essentially implements its own file system
■ PostgreSQL uses the host file system
■ tablespaces are rarely necessary
■ Resist the urge to create tablespaces during migration!
MIGRATE THE
SCHEMA (DDL)
DATA TYPE TRANSLATION
■ PostgreSQL has way more data types, so the problem is often which
one to choose
■ DATE to date or timestamp(0)?
■ NUMBER to integer, bigint, double precision or numeric?
■ Oracle allows foreign keys from NUMBER(5) to NUMBER
■ must take care to migrate them to the same data type
■ BLOB to bytea or Large Objects?
■ easy, use bytea
DATA MIGRATION
GENERAL CONSIDERATIONS
■ Oracle makes it hard to export data in clear text
■ probably on purpose to make migration harder
■ this is often the least complicated step, but the one that causes the
most down time
■ reducing down time is difficult
■ run migration of table data in parallel
■ use “change data capture” for replication and switch-over with
little down time (only available with commercial tools)
DATA MIGRATION PROBLEMS
■ corrupted strings in Oracle (more common than you think!)
invalid byte sequence for encoding "UTF8": 0x80
■ zero bytes in Oracle
invalid byte sequence for encoding "UTF8": 0x00
■ can be filtered out during migration
■ infinite numbers (~ and -~)
■ can be mapped to Infinity in double precision, problematic
otherwise
Most of these problems have to be solved in Oracle before migration.
MIGRATING STORED CODE
MIGRATING PL/SQL
■ PL/pgSQL is a clone of PL/SQL, but sufficiently different
(e.g., RETURNS vs. RETURN)
■ some tools provide automated translation, but a lot of manual work may remain
■ no COMMIT/ROLLBACKin PostgreSQL functions, limited support in procedures
■ often in “batched deletes”, → can be omitted
■ no PRAGMA AUTONOMOUS_TRANSACTIONin PostgreSQL
■ can sometimes be worked around with dblink
■ no BULK COLLECTwith arrays
■ process row by row
Shift transaction management to the application.
MIGRATING PL/SQL PACKAGES
■ option to use closed source fork from EDB
■ workaround: creating a schema with functions
■ no “package global variables” and types
■ no large PL/SQL library in PostgreSQL
■ move code to the application
■ re-implement code in PL/Python or PL/PerlU
■ extension “orafce” provides some compatibility
MIGRATING PL/SQL TRIGGERS
■ has to be split in two parts: trigger function and trigger
■ benefit: easier code reuse
■ auto-increment triggers fetching from a sequence can be simplified to
column DEFAULT
■ no “logon triggers” in PostgreSQL
■ avoid or shift code to the application
MIGRATING SQL
WHERE DOES SQL OCCUR?
■ application code
■ ORMs and other abstraction layers reduce this
■ views
■ PL/SQL code
■ column DEFAULT clauses
■ index definitions
Usually requires manual intervention; migration tools may help.
SQL: JOIN SYNTAX
SELECT b.col1, a.col2
FROM base_table b, attributes a
WHERE b.id=a.b_id(+);
has to be translated to
SELECT b.col1, a.col2
FROM base_table b
LEFT JOIN attributes a ON b.id = a.b_id;
Always simple, but annoying!
SQL: EMPTY STRINGS
■ Oracle treats empty strings as NULL
■ as a consequence,
'hello' || NULL
is not NULL in Oracle
■ translate into
concat('hello', NULL)
or use “coalesce(strcol, '')”
This is a very frequent problem.
SQL: CURRENT DATE/TIME
■ most Oracle code uses proprietary functions:
■ SYSDATE
■ SYSTIMESTAMP
■ has to be translated:
■ the literal translation would be clock_timestamp()
■ sometimes current_dateor current_timestampis better
■ easy with search and replace
SQL: SEQUENCES
■ Oracle code to fetch the next sequence value:
asequence.NEXTVAL
■ PostgreSQL code to fetch the next sequence value:
nextval('asequence')
■ both don’t support the SQL standard way:
NEXT VALUE FOR asequence
MIGRATING THE APPLICATION
MIGRATING THE APPLICATION
■ can be hard
■ hard coded dynamically composed SQL everywhere
■ can be almost trivial
■ use an ORM that supports both Oracle and PostgreSQL
■ requires thorough testing
■ some differences (transaction handling, concurrency) may cause
problems only during testing
MIGRATION TOOLS
POSTGRESQL FORKS
■ some PostgreSQL forks (for example EDB) provide good compatibility
■ but believe no claim of “drop-in replacement”
■ carefully consider if you want to end up with closed source
■ consider using “orafce” for more compatibility
■ open source, but still another dependency
■ it may be worth the effort to invest a little more and end up with free
standard PostgreSQL
ORA2PG
■ the most widely used open source migration tool
■ time-tested and proven, but not 100% bug free
■ generates a DDL script, exports and imports data
■ universally usable, but takes its time
■ attempts to translate PL/SQL
■ simple search/replace, quality limited
ORA_MIGRATOR
■ open source, uses the Oracle Foreign Data Wrapper
■ directly migrates data into the target database
■ no export/import, therefore faster
■ requires oracle_fdw in the target database
■ usually not an option with hosted databases
■ no attempt to migrate PL/SQL
■ provides a simple replication solution using triggers to reduce down
time
CYBERTEC MIGRATOR
CYBERTEC MIGRATOR
■ commercial
■ comfortable GUI driven migration
■ fast, highly parallelized data migration
■ high-quality PL/SQL conversion
■ close-to zero downtime with change data capture under development
More information:
https://www.cybertec-postgresql.com/en/products/cybertec-migrator/
QUESTIONS?

Contenu connexe

Tendances

Oracle GoldenGate Roadmap Oracle OpenWorld 2020
Oracle GoldenGate Roadmap Oracle OpenWorld 2020 Oracle GoldenGate Roadmap Oracle OpenWorld 2020
Oracle GoldenGate Roadmap Oracle OpenWorld 2020 Oracle
 
Oracle Machine Learning Overview and From Oracle Data Professional to Oracle ...
Oracle Machine Learning Overview and From Oracle Data Professional to Oracle ...Oracle Machine Learning Overview and From Oracle Data Professional to Oracle ...
Oracle Machine Learning Overview and From Oracle Data Professional to Oracle ...Charlie Berger
 
Oracle RAC 19c: Best Practices and Secret Internals
Oracle RAC 19c: Best Practices and Secret InternalsOracle RAC 19c: Best Practices and Secret Internals
Oracle RAC 19c: Best Practices and Secret InternalsAnil Nair
 
Migrating Your Oracle Database to PostgreSQL - AWS Online Tech Talks
Migrating Your Oracle Database to PostgreSQL - AWS Online Tech TalksMigrating Your Oracle Database to PostgreSQL - AWS Online Tech Talks
Migrating Your Oracle Database to PostgreSQL - AWS Online Tech TalksAmazon Web Services
 
Oracle 12c PDB insights
Oracle 12c PDB insightsOracle 12c PDB insights
Oracle 12c PDB insightsKirill Loifman
 
Oracle RAC 19c and Later - Best Practices #OOWLON
Oracle RAC 19c and Later - Best Practices #OOWLONOracle RAC 19c and Later - Best Practices #OOWLON
Oracle RAC 19c and Later - Best Practices #OOWLONMarkus Michalewicz
 
Migrating from Oracle to Postgres
Migrating from Oracle to PostgresMigrating from Oracle to Postgres
Migrating from Oracle to PostgresEDB
 
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...Sandesh Rao
 
Oracle RAC Virtualized - In VMs, in Containers, On-premises, and in the Cloud
Oracle RAC Virtualized - In VMs, in Containers, On-premises, and in the CloudOracle RAC Virtualized - In VMs, in Containers, On-premises, and in the Cloud
Oracle RAC Virtualized - In VMs, in Containers, On-premises, and in the CloudMarkus Michalewicz
 
Why oracle data guard new features in oracle 18c, 19c
Why oracle data guard new features in oracle 18c, 19cWhy oracle data guard new features in oracle 18c, 19c
Why oracle data guard new features in oracle 18c, 19cSatishbabu Gunukula
 
Oracle Performance Tools of the Trade
Oracle Performance Tools of the TradeOracle Performance Tools of the Trade
Oracle Performance Tools of the TradeCarlos Sierra
 
How many ways to monitor oracle golden gate-Collaborate 14
How many ways to monitor oracle golden gate-Collaborate 14How many ways to monitor oracle golden gate-Collaborate 14
How many ways to monitor oracle golden gate-Collaborate 14Bobby Curtis
 
Database Consolidation using Oracle Multitenant
Database Consolidation using Oracle MultitenantDatabase Consolidation using Oracle Multitenant
Database Consolidation using Oracle MultitenantPini Dibask
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Aaron Shilo
 
Christo kutrovsky oracle, memory & linux
Christo kutrovsky   oracle, memory & linuxChristo kutrovsky   oracle, memory & linux
Christo kutrovsky oracle, memory & linuxKyle Hailey
 
What to Expect From Oracle database 19c
What to Expect From Oracle database 19cWhat to Expect From Oracle database 19c
What to Expect From Oracle database 19cMaria Colgan
 
Oracle RAC on Extended Distance Clusters - Presentation
Oracle RAC on Extended Distance Clusters - PresentationOracle RAC on Extended Distance Clusters - Presentation
Oracle RAC on Extended Distance Clusters - PresentationMarkus Michalewicz
 
What’s New in Oracle Database 19c - Part 1
What’s New in Oracle Database 19c - Part 1What’s New in Oracle Database 19c - Part 1
What’s New in Oracle Database 19c - Part 1Satishbabu Gunukula
 

Tendances (20)

Oracle GoldenGate Roadmap Oracle OpenWorld 2020
Oracle GoldenGate Roadmap Oracle OpenWorld 2020 Oracle GoldenGate Roadmap Oracle OpenWorld 2020
Oracle GoldenGate Roadmap Oracle OpenWorld 2020
 
Oracle Machine Learning Overview and From Oracle Data Professional to Oracle ...
Oracle Machine Learning Overview and From Oracle Data Professional to Oracle ...Oracle Machine Learning Overview and From Oracle Data Professional to Oracle ...
Oracle Machine Learning Overview and From Oracle Data Professional to Oracle ...
 
Oracle RAC 19c: Best Practices and Secret Internals
Oracle RAC 19c: Best Practices and Secret InternalsOracle RAC 19c: Best Practices and Secret Internals
Oracle RAC 19c: Best Practices and Secret Internals
 
Migrating Your Oracle Database to PostgreSQL - AWS Online Tech Talks
Migrating Your Oracle Database to PostgreSQL - AWS Online Tech TalksMigrating Your Oracle Database to PostgreSQL - AWS Online Tech Talks
Migrating Your Oracle Database to PostgreSQL - AWS Online Tech Talks
 
Oracle 12c PDB insights
Oracle 12c PDB insightsOracle 12c PDB insights
Oracle 12c PDB insights
 
Oracle RAC 19c and Later - Best Practices #OOWLON
Oracle RAC 19c and Later - Best Practices #OOWLONOracle RAC 19c and Later - Best Practices #OOWLON
Oracle RAC 19c and Later - Best Practices #OOWLON
 
Migrating Oracle to PostgreSQL
Migrating Oracle to PostgreSQLMigrating Oracle to PostgreSQL
Migrating Oracle to PostgreSQL
 
Migrating from Oracle to Postgres
Migrating from Oracle to PostgresMigrating from Oracle to Postgres
Migrating from Oracle to Postgres
 
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
Oracle Real Application Clusters 19c- Best Practices and Internals- EMEA Tour...
 
Oracle RAC Virtualized - In VMs, in Containers, On-premises, and in the Cloud
Oracle RAC Virtualized - In VMs, in Containers, On-premises, and in the CloudOracle RAC Virtualized - In VMs, in Containers, On-premises, and in the Cloud
Oracle RAC Virtualized - In VMs, in Containers, On-premises, and in the Cloud
 
Why oracle data guard new features in oracle 18c, 19c
Why oracle data guard new features in oracle 18c, 19cWhy oracle data guard new features in oracle 18c, 19c
Why oracle data guard new features in oracle 18c, 19c
 
Oracle Performance Tools of the Trade
Oracle Performance Tools of the TradeOracle Performance Tools of the Trade
Oracle Performance Tools of the Trade
 
How many ways to monitor oracle golden gate-Collaborate 14
How many ways to monitor oracle golden gate-Collaborate 14How many ways to monitor oracle golden gate-Collaborate 14
How many ways to monitor oracle golden gate-Collaborate 14
 
Database Consolidation using Oracle Multitenant
Database Consolidation using Oracle MultitenantDatabase Consolidation using Oracle Multitenant
Database Consolidation using Oracle Multitenant
 
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
Exploring Oracle Database Performance Tuning Best Practices for DBAs and Deve...
 
Christo kutrovsky oracle, memory & linux
Christo kutrovsky   oracle, memory & linuxChristo kutrovsky   oracle, memory & linux
Christo kutrovsky oracle, memory & linux
 
Oracle GoldenGate
Oracle GoldenGate Oracle GoldenGate
Oracle GoldenGate
 
What to Expect From Oracle database 19c
What to Expect From Oracle database 19cWhat to Expect From Oracle database 19c
What to Expect From Oracle database 19c
 
Oracle RAC on Extended Distance Clusters - Presentation
Oracle RAC on Extended Distance Clusters - PresentationOracle RAC on Extended Distance Clusters - Presentation
Oracle RAC on Extended Distance Clusters - Presentation
 
What’s New in Oracle Database 19c - Part 1
What’s New in Oracle Database 19c - Part 1What’s New in Oracle Database 19c - Part 1
What’s New in Oracle Database 19c - Part 1
 

Similaire à Stumbling stones when migrating from Oracle

Oracle vs NoSQL – The good, the bad and the ugly
Oracle vs NoSQL – The good, the bad and the uglyOracle vs NoSQL – The good, the bad and the ugly
Oracle vs NoSQL – The good, the bad and the uglyJohn Kanagaraj
 
COUG_AAbate_Oracle_Database_12c_New_Features
COUG_AAbate_Oracle_Database_12c_New_FeaturesCOUG_AAbate_Oracle_Database_12c_New_Features
COUG_AAbate_Oracle_Database_12c_New_FeaturesAlfredo Abate
 
NoSQL and CouchDB: the view from MOO
NoSQL and CouchDB: the view from MOONoSQL and CouchDB: the view from MOO
NoSQL and CouchDB: the view from MOOJames Hollingworth
 
PL/pgSQL - An Introduction on Using Imperative Programming in PostgreSQL
PL/pgSQL - An Introduction on Using Imperative Programming in PostgreSQLPL/pgSQL - An Introduction on Using Imperative Programming in PostgreSQL
PL/pgSQL - An Introduction on Using Imperative Programming in PostgreSQLReactive.IO
 
Data Pipline Observability meetup
Data Pipline Observability meetup Data Pipline Observability meetup
Data Pipline Observability meetup Omid Vahdaty
 
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...Lucas Jellema
 
What SQL should actually be...
What SQL should actually be...What SQL should actually be...
What SQL should actually be...Open Academy
 
Are we there Yet?? (The long journey of Migrating from close source to opens...
Are we there Yet?? (The long journey of Migrating from close source to opens...Are we there Yet?? (The long journey of Migrating from close source to opens...
Are we there Yet?? (The long journey of Migrating from close source to opens...Marco Tusa
 
PostgreSQL versus MySQL - What Are The Real Differences
PostgreSQL versus MySQL - What Are The Real DifferencesPostgreSQL versus MySQL - What Are The Real Differences
PostgreSQL versus MySQL - What Are The Real DifferencesAll Things Open
 
SQL vs NoSQL: Why you’ll never dump your relations - Dave Shuttleworth, EXASOL
SQL vs NoSQL: Why you’ll never dump your relations - Dave Shuttleworth, EXASOLSQL vs NoSQL: Why you’ll never dump your relations - Dave Shuttleworth, EXASOL
SQL vs NoSQL: Why you’ll never dump your relations - Dave Shuttleworth, EXASOLBCS Data Management Specialist Group
 
CDC patterns in Apache Kafka®
CDC patterns in Apache Kafka®CDC patterns in Apache Kafka®
CDC patterns in Apache Kafka®confluent
 
A Journey from Oracle to PostgreSQL
A Journey from Oracle to PostgreSQLA Journey from Oracle to PostgreSQL
A Journey from Oracle to PostgreSQLEDB
 
Lessons PostgreSQL learned from commercial databases, and didn’t
Lessons PostgreSQL learned from commercial databases, and didn’tLessons PostgreSQL learned from commercial databases, and didn’t
Lessons PostgreSQL learned from commercial databases, and didn’tPGConf APAC
 
The Real Scoop on Migrating from Oracle Databases
The Real Scoop on Migrating from Oracle DatabasesThe Real Scoop on Migrating from Oracle Databases
The Real Scoop on Migrating from Oracle DatabasesEDB
 
Agile Oracle to PostgreSQL migrations (PGConf.EU 2013)
Agile Oracle to PostgreSQL migrations (PGConf.EU 2013)Agile Oracle to PostgreSQL migrations (PGConf.EU 2013)
Agile Oracle to PostgreSQL migrations (PGConf.EU 2013)Gabriele Bartolini
 
Ten query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should knowTen query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should knowKevin Kline
 

Similaire à Stumbling stones when migrating from Oracle (20)

Oracle vs NoSQL – The good, the bad and the ugly
Oracle vs NoSQL – The good, the bad and the uglyOracle vs NoSQL – The good, the bad and the ugly
Oracle vs NoSQL – The good, the bad and the ugly
 
NoSQL
NoSQLNoSQL
NoSQL
 
COUG_AAbate_Oracle_Database_12c_New_Features
COUG_AAbate_Oracle_Database_12c_New_FeaturesCOUG_AAbate_Oracle_Database_12c_New_Features
COUG_AAbate_Oracle_Database_12c_New_Features
 
CDC to the Max!
CDC to the Max!CDC to the Max!
CDC to the Max!
 
Rails DB migrate SAFE.pdf
Rails DB migrate SAFE.pdfRails DB migrate SAFE.pdf
Rails DB migrate SAFE.pdf
 
NoSQL and CouchDB: the view from MOO
NoSQL and CouchDB: the view from MOONoSQL and CouchDB: the view from MOO
NoSQL and CouchDB: the view from MOO
 
Plpgsql russia-pgconf
Plpgsql russia-pgconfPlpgsql russia-pgconf
Plpgsql russia-pgconf
 
PL/pgSQL - An Introduction on Using Imperative Programming in PostgreSQL
PL/pgSQL - An Introduction on Using Imperative Programming in PostgreSQLPL/pgSQL - An Introduction on Using Imperative Programming in PostgreSQL
PL/pgSQL - An Introduction on Using Imperative Programming in PostgreSQL
 
Data Pipline Observability meetup
Data Pipline Observability meetup Data Pipline Observability meetup
Data Pipline Observability meetup
 
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...
Introducing NoSQL and MongoDB to complement Relational Databases (AMIS SIG 14...
 
What SQL should actually be...
What SQL should actually be...What SQL should actually be...
What SQL should actually be...
 
Are we there Yet?? (The long journey of Migrating from close source to opens...
Are we there Yet?? (The long journey of Migrating from close source to opens...Are we there Yet?? (The long journey of Migrating from close source to opens...
Are we there Yet?? (The long journey of Migrating from close source to opens...
 
PostgreSQL versus MySQL - What Are The Real Differences
PostgreSQL versus MySQL - What Are The Real DifferencesPostgreSQL versus MySQL - What Are The Real Differences
PostgreSQL versus MySQL - What Are The Real Differences
 
SQL vs NoSQL: Why you’ll never dump your relations - Dave Shuttleworth, EXASOL
SQL vs NoSQL: Why you’ll never dump your relations - Dave Shuttleworth, EXASOLSQL vs NoSQL: Why you’ll never dump your relations - Dave Shuttleworth, EXASOL
SQL vs NoSQL: Why you’ll never dump your relations - Dave Shuttleworth, EXASOL
 
CDC patterns in Apache Kafka®
CDC patterns in Apache Kafka®CDC patterns in Apache Kafka®
CDC patterns in Apache Kafka®
 
A Journey from Oracle to PostgreSQL
A Journey from Oracle to PostgreSQLA Journey from Oracle to PostgreSQL
A Journey from Oracle to PostgreSQL
 
Lessons PostgreSQL learned from commercial databases, and didn’t
Lessons PostgreSQL learned from commercial databases, and didn’tLessons PostgreSQL learned from commercial databases, and didn’t
Lessons PostgreSQL learned from commercial databases, and didn’t
 
The Real Scoop on Migrating from Oracle Databases
The Real Scoop on Migrating from Oracle DatabasesThe Real Scoop on Migrating from Oracle Databases
The Real Scoop on Migrating from Oracle Databases
 
Agile Oracle to PostgreSQL migrations (PGConf.EU 2013)
Agile Oracle to PostgreSQL migrations (PGConf.EU 2013)Agile Oracle to PostgreSQL migrations (PGConf.EU 2013)
Agile Oracle to PostgreSQL migrations (PGConf.EU 2013)
 
Ten query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should knowTen query tuning techniques every SQL Server programmer should know
Ten query tuning techniques every SQL Server programmer should know
 

Plus de EDB

Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
Cloud Migration Paths: Kubernetes, IaaS, or DBaaSCloud Migration Paths: Kubernetes, IaaS, or DBaaS
Cloud Migration Paths: Kubernetes, IaaS, or DBaaSEDB
 
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr UnternehmenDie 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr UnternehmenEDB
 
Migre sus bases de datos Oracle a la nube
Migre sus bases de datos Oracle a la nube Migre sus bases de datos Oracle a la nube
Migre sus bases de datos Oracle a la nube EDB
 
EFM Office Hours - APJ - July 29, 2021
EFM Office Hours - APJ - July 29, 2021EFM Office Hours - APJ - July 29, 2021
EFM Office Hours - APJ - July 29, 2021EDB
 
Benchmarking Cloud Native PostgreSQL
Benchmarking Cloud Native PostgreSQLBenchmarking Cloud Native PostgreSQL
Benchmarking Cloud Native PostgreSQLEDB
 
Las Variaciones de la Replicación de PostgreSQL
Las Variaciones de la Replicación de PostgreSQLLas Variaciones de la Replicación de PostgreSQL
Las Variaciones de la Replicación de PostgreSQLEDB
 
NoSQL and Spatial Database Capabilities using PostgreSQL
NoSQL and Spatial Database Capabilities using PostgreSQLNoSQL and Spatial Database Capabilities using PostgreSQL
NoSQL and Spatial Database Capabilities using PostgreSQLEDB
 
Is There Anything PgBouncer Can’t Do?
Is There Anything PgBouncer Can’t Do?Is There Anything PgBouncer Can’t Do?
Is There Anything PgBouncer Can’t Do?EDB
 
Data Analysis with TensorFlow in PostgreSQL
Data Analysis with TensorFlow in PostgreSQLData Analysis with TensorFlow in PostgreSQL
Data Analysis with TensorFlow in PostgreSQLEDB
 
Practical Partitioning in Production with Postgres
Practical Partitioning in Production with PostgresPractical Partitioning in Production with Postgres
Practical Partitioning in Production with PostgresEDB
 
A Deeper Dive into EXPLAIN
A Deeper Dive into EXPLAINA Deeper Dive into EXPLAIN
A Deeper Dive into EXPLAINEDB
 
IOT with PostgreSQL
IOT with PostgreSQLIOT with PostgreSQL
IOT with PostgreSQLEDB
 
Psql is awesome!
Psql is awesome!Psql is awesome!
Psql is awesome!EDB
 
EDB 13 - New Enhancements for Security and Usability - APJ
EDB 13 - New Enhancements for Security and Usability - APJEDB 13 - New Enhancements for Security and Usability - APJ
EDB 13 - New Enhancements for Security and Usability - APJEDB
 
Comment sauvegarder correctement vos données
Comment sauvegarder correctement vos donnéesComment sauvegarder correctement vos données
Comment sauvegarder correctement vos donnéesEDB
 
Cloud Native PostgreSQL - Italiano
Cloud Native PostgreSQL - ItalianoCloud Native PostgreSQL - Italiano
Cloud Native PostgreSQL - ItalianoEDB
 
New enhancements for security and usability in EDB 13
New enhancements for security and usability in EDB 13New enhancements for security and usability in EDB 13
New enhancements for security and usability in EDB 13EDB
 
Best Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLBest Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLEDB
 
Cloud Native PostgreSQL - APJ
Cloud Native PostgreSQL - APJCloud Native PostgreSQL - APJ
Cloud Native PostgreSQL - APJEDB
 
Best Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLBest Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLEDB
 

Plus de EDB (20)

Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
Cloud Migration Paths: Kubernetes, IaaS, or DBaaSCloud Migration Paths: Kubernetes, IaaS, or DBaaS
Cloud Migration Paths: Kubernetes, IaaS, or DBaaS
 
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr UnternehmenDie 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
Die 10 besten PostgreSQL-Replikationsstrategien für Ihr Unternehmen
 
Migre sus bases de datos Oracle a la nube
Migre sus bases de datos Oracle a la nube Migre sus bases de datos Oracle a la nube
Migre sus bases de datos Oracle a la nube
 
EFM Office Hours - APJ - July 29, 2021
EFM Office Hours - APJ - July 29, 2021EFM Office Hours - APJ - July 29, 2021
EFM Office Hours - APJ - July 29, 2021
 
Benchmarking Cloud Native PostgreSQL
Benchmarking Cloud Native PostgreSQLBenchmarking Cloud Native PostgreSQL
Benchmarking Cloud Native PostgreSQL
 
Las Variaciones de la Replicación de PostgreSQL
Las Variaciones de la Replicación de PostgreSQLLas Variaciones de la Replicación de PostgreSQL
Las Variaciones de la Replicación de PostgreSQL
 
NoSQL and Spatial Database Capabilities using PostgreSQL
NoSQL and Spatial Database Capabilities using PostgreSQLNoSQL and Spatial Database Capabilities using PostgreSQL
NoSQL and Spatial Database Capabilities using PostgreSQL
 
Is There Anything PgBouncer Can’t Do?
Is There Anything PgBouncer Can’t Do?Is There Anything PgBouncer Can’t Do?
Is There Anything PgBouncer Can’t Do?
 
Data Analysis with TensorFlow in PostgreSQL
Data Analysis with TensorFlow in PostgreSQLData Analysis with TensorFlow in PostgreSQL
Data Analysis with TensorFlow in PostgreSQL
 
Practical Partitioning in Production with Postgres
Practical Partitioning in Production with PostgresPractical Partitioning in Production with Postgres
Practical Partitioning in Production with Postgres
 
A Deeper Dive into EXPLAIN
A Deeper Dive into EXPLAINA Deeper Dive into EXPLAIN
A Deeper Dive into EXPLAIN
 
IOT with PostgreSQL
IOT with PostgreSQLIOT with PostgreSQL
IOT with PostgreSQL
 
Psql is awesome!
Psql is awesome!Psql is awesome!
Psql is awesome!
 
EDB 13 - New Enhancements for Security and Usability - APJ
EDB 13 - New Enhancements for Security and Usability - APJEDB 13 - New Enhancements for Security and Usability - APJ
EDB 13 - New Enhancements for Security and Usability - APJ
 
Comment sauvegarder correctement vos données
Comment sauvegarder correctement vos donnéesComment sauvegarder correctement vos données
Comment sauvegarder correctement vos données
 
Cloud Native PostgreSQL - Italiano
Cloud Native PostgreSQL - ItalianoCloud Native PostgreSQL - Italiano
Cloud Native PostgreSQL - Italiano
 
New enhancements for security and usability in EDB 13
New enhancements for security and usability in EDB 13New enhancements for security and usability in EDB 13
New enhancements for security and usability in EDB 13
 
Best Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLBest Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQL
 
Cloud Native PostgreSQL - APJ
Cloud Native PostgreSQL - APJCloud Native PostgreSQL - APJ
Cloud Native PostgreSQL - APJ
 
Best Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQLBest Practices in Security with PostgreSQL
Best Practices in Security with PostgreSQL
 

Dernier

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistandanishmna97
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelDeepika Singh
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 

Dernier (20)

How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 

Stumbling stones when migrating from Oracle

  • 1. STUMBLING STONES WHEN MIGRATING FROM ORACLE BY LAURENZ ALBE
  • 2. ABOUT ME AND MY COMPANY ■ Who is Laurenz Albe? ■ Who is CYBERTEC?
  • 3. LAURENZ ALBE SENIOR DATABASE CONSULTANT ■ contributions to PostgreSQL and related projects since 2006 ■ maintainer of the Oracle Foreign Data Wrapper ■ PostgreSQL support, training, consulting and development ■ working for CYBERTEC since 2017 M A I L laurenz.albe@cybertec.at P H O N E +43 2622 930 22-7 W E B www.cybertec-postgresql.com
  • 4. Specialized in data services About Inhouse development Owner-managed since 2000 International team of developers
  • 5. DATABASE SERVICES DATA Science ▪ Artificial Intelligence ▪ Machine Learning ▪ Big Data ▪ Business Intelligence ▪ Data Mining ▪ etc. POSTGRESQL Services ▪ 24/7 Support ▪ Training ▪ Consulting ▪ Performance Tuning ▪ Clustering ▪ etc.
  • 6.
  • 7. ▪ ICT ▪ University ▪ Government ▪ Automotive ▪ Industry ▪ Trade ▪ Finance ▪ etc. CLIENT SECTORS
  • 8. AGENDA ■ Overview ■ Understanding open source and PostgreSQL ■ Migrate the schema (DDL) ■ Data migration ■ Migrating stored code ■ Migrating SQL ■ Migrating the application ■ Migration tools
  • 10. MIGRATION STEPS ■ understand open source software and PostgreSQL ■ migrate the schema (DDL) ■ migrate the data ■ migrate stored code (PL/SQL, Java) ■ migrate SQL ■ migrate the application
  • 11. MIGRATION STEPS (ACTUAL SIZE) ■ understand open source software and PostgreSQL ■ migrate the schema (DDL) ■ migrate the data ■ migrate stored code (PL/SQL, Java) ■ migrate SQL ■ migrate the application
  • 13. THE SHIFT TO OPEN SOURCE ■ This is written by some enthusiasts in their spare time, right? ■ Is this “enterprise ready”? ■ Where can I get support? ■ Why do I have to install and integrate so many different pieces of software (PostgreSQL, PostGIS, backup software, extensions, GUI clients, monitoring,...)? ■ What if open source software is no longer maintained? ■ It’s for free, so I don’t have to invest anything, right?
  • 14. TRANSACTIONS, UNDO, MULTIVERSIONING ■ both Oracle and PostgreSQL use multiversioning, so concurrency and locking are similar (but not equal!) ■ big transactions are no problem in PostgreSQL (but long transactions are), so less need to “batch” large transactions ■ no UNDO tablespace in PostgreSQL, no “snapshot too old”, immediate rollback But: ■ UPDATE-heavy workloads are problematic in PostgreSQL (may need “HOT update” and autovacuum tuning) ■ table size will grow (all that visibility information) ■ I no statement-level rollback
  • 15. SCHEMAS, USERS AND SYNONYMS Oracle has a reduced metadata model: ■ a schema is always tied to a user with the same name ■ ownership is determined by the schema ■ only objects in your own schema can be referenced without schema Synonyms are there largely to overcome these limitations ■ can often be replaced by an appropriate search_path setting ■ for other uses, a view is usually just as good
  • 16. VIEWS AND DEPENDENCIES ■ Oracle tables be dropped/modified even if views depend on them ■ views become “invalid” and cause an error when used ■ PostgreSQL is stricter about data integrity ■ Schema upgrade procedures more difficult in PostgreSQL ■ but to make up for it, we have transactional DDL ■ Materialized View support much more sophisticated in Oracle ■ replace ON COMMIT REFRESHwith triggers in PostgreSQL
  • 17. TABLESPACES ■ tablespaces are important in Oracle ■ Oracle essentially implements its own file system ■ PostgreSQL uses the host file system ■ tablespaces are rarely necessary ■ Resist the urge to create tablespaces during migration!
  • 19. DATA TYPE TRANSLATION ■ PostgreSQL has way more data types, so the problem is often which one to choose ■ DATE to date or timestamp(0)? ■ NUMBER to integer, bigint, double precision or numeric? ■ Oracle allows foreign keys from NUMBER(5) to NUMBER ■ must take care to migrate them to the same data type ■ BLOB to bytea or Large Objects? ■ easy, use bytea
  • 21. GENERAL CONSIDERATIONS ■ Oracle makes it hard to export data in clear text ■ probably on purpose to make migration harder ■ this is often the least complicated step, but the one that causes the most down time ■ reducing down time is difficult ■ run migration of table data in parallel ■ use “change data capture” for replication and switch-over with little down time (only available with commercial tools)
  • 22. DATA MIGRATION PROBLEMS ■ corrupted strings in Oracle (more common than you think!) invalid byte sequence for encoding "UTF8": 0x80 ■ zero bytes in Oracle invalid byte sequence for encoding "UTF8": 0x00 ■ can be filtered out during migration ■ infinite numbers (~ and -~) ■ can be mapped to Infinity in double precision, problematic otherwise Most of these problems have to be solved in Oracle before migration.
  • 24. MIGRATING PL/SQL ■ PL/pgSQL is a clone of PL/SQL, but sufficiently different (e.g., RETURNS vs. RETURN) ■ some tools provide automated translation, but a lot of manual work may remain ■ no COMMIT/ROLLBACKin PostgreSQL functions, limited support in procedures ■ often in “batched deletes”, → can be omitted ■ no PRAGMA AUTONOMOUS_TRANSACTIONin PostgreSQL ■ can sometimes be worked around with dblink ■ no BULK COLLECTwith arrays ■ process row by row Shift transaction management to the application.
  • 25. MIGRATING PL/SQL PACKAGES ■ option to use closed source fork from EDB ■ workaround: creating a schema with functions ■ no “package global variables” and types ■ no large PL/SQL library in PostgreSQL ■ move code to the application ■ re-implement code in PL/Python or PL/PerlU ■ extension “orafce” provides some compatibility
  • 26. MIGRATING PL/SQL TRIGGERS ■ has to be split in two parts: trigger function and trigger ■ benefit: easier code reuse ■ auto-increment triggers fetching from a sequence can be simplified to column DEFAULT ■ no “logon triggers” in PostgreSQL ■ avoid or shift code to the application
  • 28. WHERE DOES SQL OCCUR? ■ application code ■ ORMs and other abstraction layers reduce this ■ views ■ PL/SQL code ■ column DEFAULT clauses ■ index definitions Usually requires manual intervention; migration tools may help.
  • 29. SQL: JOIN SYNTAX SELECT b.col1, a.col2 FROM base_table b, attributes a WHERE b.id=a.b_id(+); has to be translated to SELECT b.col1, a.col2 FROM base_table b LEFT JOIN attributes a ON b.id = a.b_id; Always simple, but annoying!
  • 30. SQL: EMPTY STRINGS ■ Oracle treats empty strings as NULL ■ as a consequence, 'hello' || NULL is not NULL in Oracle ■ translate into concat('hello', NULL) or use “coalesce(strcol, '')” This is a very frequent problem.
  • 31. SQL: CURRENT DATE/TIME ■ most Oracle code uses proprietary functions: ■ SYSDATE ■ SYSTIMESTAMP ■ has to be translated: ■ the literal translation would be clock_timestamp() ■ sometimes current_dateor current_timestampis better ■ easy with search and replace
  • 32. SQL: SEQUENCES ■ Oracle code to fetch the next sequence value: asequence.NEXTVAL ■ PostgreSQL code to fetch the next sequence value: nextval('asequence') ■ both don’t support the SQL standard way: NEXT VALUE FOR asequence
  • 34. MIGRATING THE APPLICATION ■ can be hard ■ hard coded dynamically composed SQL everywhere ■ can be almost trivial ■ use an ORM that supports both Oracle and PostgreSQL ■ requires thorough testing ■ some differences (transaction handling, concurrency) may cause problems only during testing
  • 36. POSTGRESQL FORKS ■ some PostgreSQL forks (for example EDB) provide good compatibility ■ but believe no claim of “drop-in replacement” ■ carefully consider if you want to end up with closed source ■ consider using “orafce” for more compatibility ■ open source, but still another dependency ■ it may be worth the effort to invest a little more and end up with free standard PostgreSQL
  • 37. ORA2PG ■ the most widely used open source migration tool ■ time-tested and proven, but not 100% bug free ■ generates a DDL script, exports and imports data ■ universally usable, but takes its time ■ attempts to translate PL/SQL ■ simple search/replace, quality limited
  • 38. ORA_MIGRATOR ■ open source, uses the Oracle Foreign Data Wrapper ■ directly migrates data into the target database ■ no export/import, therefore faster ■ requires oracle_fdw in the target database ■ usually not an option with hosted databases ■ no attempt to migrate PL/SQL ■ provides a simple replication solution using triggers to reduce down time
  • 40. CYBERTEC MIGRATOR ■ commercial ■ comfortable GUI driven migration ■ fast, highly parallelized data migration ■ high-quality PL/SQL conversion ■ close-to zero downtime with change data capture under development More information: https://www.cybertec-postgresql.com/en/products/cybertec-migrator/