SlideShare a Scribd company logo
1 of 47
Download to read offline
Higher impact of license costs
Agile Oracle to PostgreSQL
migrations
PGConf.EU 2013, Dublin, Nov 1st
Gabriele Bartolini
2ndQuadrant Italia / PostgreSQL Europe
gabriele.bartolini@2ndQuadrant.it
@_GBartolini_
Gabriele Bartolini
• Co-Founder and Manager of 2ndQuadrant Italia
• Data Architect, Business critical environments
• Data warehousing

• Co-Founder Italian PostgreSQL Users Group
• Co-Founder PostgreSQL Europe
• PostgreSQL Contributor and Advocate
Outline
• Introduction
• The migration project
• Open source tools
• Conclusions
Target
• Chief Technical Officers
• Chief Information Officers
• Oracle users
• Evaluate moving to PostgreSQL 9.3
Goals
• Describe the migration process
• Spot the major sources of costs
• Help you plan a migration in the mid/long term
Part I
Introduction
Oracle vs Postgres

(*) not sure it is in the TODO List, yet
Upgrade automatically
Would you ever do an upgrade to a higher version of
Oracle in a completely automated way?
PostgreSQL
• Hot Standby (~ Data Guard)

• Memcache integration (~ InMemory Database Cache)

• Barman (~ RMAN)
• Partitioning (*)
• Londiste/PgQ (GoldenGate)
• PostGIS (Spatial)
• SE Linux integration (~
Database Vault)

• Future: Multi-master
replication (~ RAC)
License
• Very simple and clear
• Applies to every part
(module, product, option) of
Postgres
• server, client, libraries,
additional modules
• 100% open source

• No need to hire a lawyer to
understand it
• Highly Permissive
• Not subject to monopoly
nor acquisitions

• Fosters market competition
in professional services
offer
Oracle DBA, do not be afraid!
• Transferrable knowledge
• PostgreSQL focused professional training
• 100% open source
Part II
The Migration project
Migration = project
budget, scope, quality, time
Budget
• Crucial variable
• Usually triggers the migration process

• Cost analysis drives the migration project
• short term
• mid term
Quality
• PostgreSQL reliability
• Tests
Components
• Applications
• Database
• Processes
• Human resources
Migration cost components
Testing

Processes

Training

Licensing

fictitious data

Dev

25,00%

50,00%
Comparison with Oracle upgrade
Testing

Processes

Training

Licensing

fictitious data

Dev

25,00%

50,00%
External applications
• Force your supplier to provide Postgres support for their
application
• You set the rules

• Typical case of the public sector
• e.g.: Land registry
• Financial crisis and competition are on your side
Agile approach
• Requirements change
• Every context is different from the other
• No one-size-fits-all scenario

• Be dynamic:
• SCRUM (with the customer)
• Kanban (internally)
• DevOps
Focus
• Applications
• Database
• Processes
• Human resources
Database migration
• Schema
• Queries
• Data
• Stored procedures
• Tests
Schema conversion
• Tables
• Data type mapping

• Indexes
• Views
• Constraints
Schema major differences
• USER = schema/database
• UPPERCASE = lowercase
• Partitioning (*)
• Tablespaces
• SYNONYMs
• search_path / auto updatable views / foreign tables
Queries
• ANSI/ISO SQL
• PostgreSQL has no hints
(optimiser)

• OUTER JOINs
• (+)
• use LEFT/RIGHT JOIN

• Major differences:
• DUAL
• NULL = NULL
• ROWNUM and ROWID
• Postgres: NULL

• ...
• Oracle: TRUE
Data
• Might require specialised
consulting activities
• Major solutions:
• ETL tools (e.g. Kettle)
• External scripts (e.g.
ora2pg or custom)
• COPY t FROM stdin;

• Foreign tables with Oracle
FDW
• INSERT INTO t SELECT *
FROM ft;

• Cut-over time
•>0
•~0
Stored Procedures
• Most critical and complex component of the whole migration
• Package = extension (schema)
• Two major ways:
• 1:1 conversion (not always possible)
• complete rewriting (optimised for PostgreSQL)

• It might required specialised consulting activities
PL/SQL vs PL/pgSQL
• Syntactical differences
• PROCEDURE = FUNCTION that returns VOID
• TRIGGER = TRIGGER FUNCTION + TRIGGER
• Lack of autonomous transactions
• Lack of global variables
• ...
Test
• Vital component for a successful migration process
• It measures the QUALITY of the project
• It can be reused in the future for PostgreSQL upgrades
• strategic investment in the long period
Part III
Open source tools
ora2pg
• URL: http://ora2pg.darold.net/
• Written in Perl - GNU GPL 3
• Reads the information schema from Oracle
• Generates DDL instructions for PostgreSQL
• Highly configurable (mapping data type conversions)
• Basic support for PL/SQL (regexp)
orafce
• URL: http://orafce.projects.pgfoundry.org/
• C and SQL - BSD licensed
• Set of functions, objects and modules that are part of Oracle:
• NVL function (COALESCE)
• DBMS_ALERT, DBMS_OUTPUT, UTL_FILE, ...
• DUAL
Oracle FDW
• URL: http://oracle-fdw.projects.pgfoundry.org/
• SQL/MED
• uses the API for Foreign Data Wrapper
• CREATE FOREIGN TABLE
• Currently READ ONLY

• Useful for ETL
Example of Oracle FDW
...
CREATE FOREIGN TABLE oracle_table (
id integer NOT NULL,
...
) SERVER oradb OPTIONS
(schema 'ORAUSER', table 'ORATAB');
...
-- pushes down the WHERE clause
SELECT * FROM oracle_table WHERE id=10;
PgTap
• Unit tests suite for PostgreSQL
• Extensions (functions)
• Produces TAP output
• Test Driven Development in databases
Vagrant
• Open Source software
• Creation and configuration of virtual environments
• Provisioning: Puppet, Chef
• Useful for local testing
PostgreSQL
• Every major release of Postgres reduces the technology gap
with Oracle
• 5 years ago, Postgres did not have hot standby, streaming/
synchronous/cascading replication, window functions, CTEs,
column permissions, foreign tables, serialisable isolation
level, XML, JSON, updatable and materialised views ...
• Is it called “OraGIS” or “PostGIS”?
• Postgres does have transactional DDL
Business Continuity stack
App

repmgr
Master

Standby

server A

server B

Barman
DR

server C
If you really miss it ...
CREATE USER scott WITH PASSWORD ‘tiger’;
CREATE DATABASE scott WITH OWNER scott;
c scott scott
CREATE SCHEMA scott;
Part IV
Conclusions
Cost analysis of a database solution on a
period of 3 years for 1 server
License

Support

300.000
270.000
240.000
210.000

64.000

150.000

Costs in Euro

180.000
140.000

120.000
32.000

90.000
60.000
30.000
0

70.000
16.000
35.000

1 CPU Socket

2 CPU Socket

4 CPU Socket

* PostgreSQL with 24/7 support from us

7.500

PostgreSQL*
Cost analysis of a migration to PostgreSQL
in a 3 year period
Oracle

PostgreSQL

150.000
135.000
120.000

50.000

105.000
Costs in euro

90.000
75.000
60.000
45.000

70.000

30.000
2.500

0

Anno 1

2.500

16.000

15.000

16.000

Anno 2

Anno 3

* PostgreSQL with 24/7 support from us
Conclusions
• Final solution: 100% open
source
• reduced TCO
• No vendor lock-in

• Migration must be focused
on costs evaluation
• Supervised process (not
automated)

• If a feature is missing, you
can simply sponsor it
• If needed, professional
companies can help you
before, during and after the
migration process (you
won’t be alone)
Questions
E-mail: gabriele.bartolini@2ndQuadrant.it
Twitter: @_GBartolini_
Thank you!
Licenza Creative Commons BY-NC-SA 3.0
http://creativecommons.org/licenses/by-nc-sa/3.0/it/deed.it

More Related Content

What's hot

Accelerate Your Apache Spark with Intel Optane DC Persistent Memory
Accelerate Your Apache Spark with Intel Optane DC Persistent MemoryAccelerate Your Apache Spark with Intel Optane DC Persistent Memory
Accelerate Your Apache Spark with Intel Optane DC Persistent Memory
Databricks
 

What's hot (20)

Product Update: EDB Postgres Platform 2017
Product Update: EDB Postgres Platform 2017Product Update: EDB Postgres Platform 2017
Product Update: EDB Postgres Platform 2017
 
Stumbling stones when migrating from Oracle
 Stumbling stones when migrating from Oracle Stumbling stones when migrating from Oracle
Stumbling stones when migrating from Oracle
 
Building a SIMD Supported Vectorized Native Engine for Spark SQL
Building a SIMD Supported Vectorized Native Engine for Spark SQLBuilding a SIMD Supported Vectorized Native Engine for Spark SQL
Building a SIMD Supported Vectorized Native Engine for Spark SQL
 
Migrating from Oracle to Postgres
Migrating from Oracle to PostgresMigrating from Oracle to Postgres
Migrating from Oracle to Postgres
 
Sql server 2016 it just runs faster sql bits 2017 edition
Sql server 2016 it just runs faster   sql bits 2017 editionSql server 2016 it just runs faster   sql bits 2017 edition
Sql server 2016 it just runs faster sql bits 2017 edition
 
Simple Works Best
 Simple Works Best Simple Works Best
Simple Works Best
 
Oracle Database 12c Release 2 - New Features On Oracle Database Exadata Expr...
Oracle Database 12c Release 2 - New Features On Oracle Database Exadata  Expr...Oracle Database 12c Release 2 - New Features On Oracle Database Exadata  Expr...
Oracle Database 12c Release 2 - New Features On Oracle Database Exadata Expr...
 
EDB Postgres with Containers
EDB Postgres with ContainersEDB Postgres with Containers
EDB Postgres with Containers
 
Migrating Oracle database to PostgreSQL
Migrating Oracle database to PostgreSQLMigrating Oracle database to PostgreSQL
Migrating Oracle database to PostgreSQL
 
Migrating ETL Workflow to Apache Spark at Scale in Pinterest
Migrating ETL Workflow to Apache Spark at Scale in PinterestMigrating ETL Workflow to Apache Spark at Scale in Pinterest
Migrating ETL Workflow to Apache Spark at Scale in Pinterest
 
A Journey from Oracle to PostgreSQL
A Journey from Oracle to PostgreSQLA Journey from Oracle to PostgreSQL
A Journey from Oracle to PostgreSQL
 
Overview of EnterpriseDB Postgres Plus Advanced Server 9.4 and Postgres Enter...
Overview of EnterpriseDB Postgres Plus Advanced Server 9.4 and Postgres Enter...Overview of EnterpriseDB Postgres Plus Advanced Server 9.4 and Postgres Enter...
Overview of EnterpriseDB Postgres Plus Advanced Server 9.4 and Postgres Enter...
 
Inside SQL Server In-Memory OLTP
Inside SQL Server In-Memory OLTPInside SQL Server In-Memory OLTP
Inside SQL Server In-Memory OLTP
 
SQL Server In-Memory OLTP: What Every SQL Professional Should Know
SQL Server In-Memory OLTP: What Every SQL Professional Should KnowSQL Server In-Memory OLTP: What Every SQL Professional Should Know
SQL Server In-Memory OLTP: What Every SQL Professional Should Know
 
Key Methodologies for Migrating from Oracle to Postgres
Key Methodologies for Migrating from Oracle to PostgresKey Methodologies for Migrating from Oracle to Postgres
Key Methodologies for Migrating from Oracle to Postgres
 
Hadoop databases for oracle DBAs
Hadoop databases for oracle DBAsHadoop databases for oracle DBAs
Hadoop databases for oracle DBAs
 
SQL Server It Just Runs Faster
SQL Server It Just Runs FasterSQL Server It Just Runs Faster
SQL Server It Just Runs Faster
 
Brk2051 sql server on linux and docker
Brk2051 sql server on linux and dockerBrk2051 sql server on linux and docker
Brk2051 sql server on linux and docker
 
Powering GIS Application with PostgreSQL and Postgres Plus
Powering GIS Application with PostgreSQL and Postgres Plus Powering GIS Application with PostgreSQL and Postgres Plus
Powering GIS Application with PostgreSQL and Postgres Plus
 
Accelerate Your Apache Spark with Intel Optane DC Persistent Memory
Accelerate Your Apache Spark with Intel Optane DC Persistent MemoryAccelerate Your Apache Spark with Intel Optane DC Persistent Memory
Accelerate Your Apache Spark with Intel Optane DC Persistent Memory
 

Viewers also liked

SP DIT Bonding Day - 05062015
SP DIT Bonding Day - 05062015SP DIT Bonding Day - 05062015
SP DIT Bonding Day - 05062015
Wei Shan Ang
 
Puppet Camp Singapore 2015 - 19th Nov 2015 Presentation (1)
Puppet Camp Singapore 2015 - 19th Nov 2015 Presentation (1)Puppet Camp Singapore 2015 - 19th Nov 2015 Presentation (1)
Puppet Camp Singapore 2015 - 19th Nov 2015 Presentation (1)
Wei Shan Ang
 
pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)
pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)
pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)
Wei Shan Ang
 
PUGS Meetup Presentation - 11062015
PUGS Meetup Presentation - 11062015PUGS Meetup Presentation - 11062015
PUGS Meetup Presentation - 11062015
Wei Shan Ang
 

Viewers also liked (20)

PostgreSQL Disaster Recovery with Barman (PGConf.EU 2013)
PostgreSQL Disaster Recovery with Barman (PGConf.EU 2013)PostgreSQL Disaster Recovery with Barman (PGConf.EU 2013)
PostgreSQL Disaster Recovery with Barman (PGConf.EU 2013)
 
Reducing the Risks of Migrating Off Oracle
Reducing the Risks of Migrating Off OracleReducing the Risks of Migrating Off Oracle
Reducing the Risks of Migrating Off Oracle
 
Why use PostgreSQL?
Why use PostgreSQL?Why use PostgreSQL?
Why use PostgreSQL?
 
Why we love pgpool-II and why we hate it!
Why we love pgpool-II and why we hate it!Why we love pgpool-II and why we hate it!
Why we love pgpool-II and why we hate it!
 
PostgreSQL 9.3: novità in "vista" (in italiano)
PostgreSQL 9.3: novità in "vista" (in italiano)PostgreSQL 9.3: novità in "vista" (in italiano)
PostgreSQL 9.3: novità in "vista" (in italiano)
 
Shaping Optimizer's Search Space
Shaping Optimizer's Search SpaceShaping Optimizer's Search Space
Shaping Optimizer's Search Space
 
PostgreSQL for Oracle Developers and DBA's
PostgreSQL for Oracle Developers and DBA'sPostgreSQL for Oracle Developers and DBA's
PostgreSQL for Oracle Developers and DBA's
 
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
 
Overview of cloud computing
Overview of cloud computingOverview of cloud computing
Overview of cloud computing
 
Reducing Database Pain & Costs with Postgres
Reducing Database Pain & Costs with PostgresReducing Database Pain & Costs with Postgres
Reducing Database Pain & Costs with Postgres
 
Big Bad PostgreSQL @ Percona
Big Bad PostgreSQL @ PerconaBig Bad PostgreSQL @ Percona
Big Bad PostgreSQL @ Percona
 
Love Your Database (ESC 2k16)
Love Your Database (ESC 2k16)Love Your Database (ESC 2k16)
Love Your Database (ESC 2k16)
 
Gerenciamento de Backups PostgreSQL com pgbarman
Gerenciamento de Backups PostgreSQL com pgbarmanGerenciamento de Backups PostgreSQL com pgbarman
Gerenciamento de Backups PostgreSQL com pgbarman
 
SP DIT Bonding Day - 05062015
SP DIT Bonding Day - 05062015SP DIT Bonding Day - 05062015
SP DIT Bonding Day - 05062015
 
Puppet Camp Singapore 2015 - 19th Nov 2015 Presentation (1)
Puppet Camp Singapore 2015 - 19th Nov 2015 Presentation (1)Puppet Camp Singapore 2015 - 19th Nov 2015 Presentation (1)
Puppet Camp Singapore 2015 - 19th Nov 2015 Presentation (1)
 
pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)
pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)
pgDay Asia 2016 - Swapping Pacemaker-Corosync for repmgr (1)
 
PUGS Meetup Presentation - 11062015
PUGS Meetup Presentation - 11062015PUGS Meetup Presentation - 11062015
PUGS Meetup Presentation - 11062015
 
10 Reasons to Start Your Analytics Project with PostgreSQL
10 Reasons to Start Your Analytics Project with PostgreSQL10 Reasons to Start Your Analytics Project with PostgreSQL
10 Reasons to Start Your Analytics Project with PostgreSQL
 
DBaaS with EDB Postgres on AWS
DBaaS with EDB Postgres on AWSDBaaS with EDB Postgres on AWS
DBaaS with EDB Postgres on AWS
 
There is Javascript in my SQL
There is Javascript in my SQLThere is Javascript in my SQL
There is Javascript in my SQL
 

Similar to Agile Oracle to PostgreSQL migrations (PGConf.EU 2013)

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
Alfredo Abate
 

Similar to Agile Oracle to PostgreSQL migrations (PGConf.EU 2013) (20)

Getting started with postgresql
Getting started with postgresqlGetting started with postgresql
Getting started with postgresql
 
Mixing d ps building architecture on the cross cutting example
Mixing d ps building architecture on the cross cutting exampleMixing d ps building architecture on the cross cutting example
Mixing d ps building architecture on the cross cutting example
 
PGConf.ASIA 2019 Bali - Keynote Speech 2 - Ivan Pachenko
PGConf.ASIA 2019 Bali - Keynote Speech 2 - Ivan PachenkoPGConf.ASIA 2019 Bali - Keynote Speech 2 - Ivan Pachenko
PGConf.ASIA 2019 Bali - Keynote Speech 2 - Ivan Pachenko
 
Running Airflow Workflows as ETL Processes on Hadoop
Running Airflow Workflows as ETL Processes on HadoopRunning Airflow Workflows as ETL Processes on Hadoop
Running Airflow Workflows as ETL Processes on Hadoop
 
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
 
Migration from Oracle to PostgreSQL: NEED vs REALITY
Migration from Oracle to PostgreSQL: NEED vs REALITYMigration from Oracle to PostgreSQL: NEED vs REALITY
Migration from Oracle to PostgreSQL: NEED vs REALITY
 
BigQuery case study in Groovenauts & Dive into the DataflowJavaSDK
BigQuery case study in Groovenauts & Dive into the DataflowJavaSDKBigQuery case study in Groovenauts & Dive into the DataflowJavaSDK
BigQuery case study in Groovenauts & Dive into the DataflowJavaSDK
 
Database Migrations with Gradle and Liquibase
Database Migrations with Gradle and LiquibaseDatabase Migrations with Gradle and Liquibase
Database Migrations with Gradle and Liquibase
 
An AMIS Overview of Oracle database 12c (12.1)
An AMIS Overview of Oracle database 12c (12.1)An AMIS Overview of Oracle database 12c (12.1)
An AMIS Overview of Oracle database 12c (12.1)
 
PostgreSQL as a Big Data Platform
PostgreSQL as a Big Data Platform PostgreSQL as a Big Data Platform
PostgreSQL as a Big Data Platform
 
Save money with Postgres on IBM PowerLinux
Save money with Postgres on IBM PowerLinuxSave money with Postgres on IBM PowerLinux
Save money with Postgres on IBM PowerLinux
 
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
 
An AMIS overview of database 12c
An AMIS overview of database 12cAn AMIS overview of database 12c
An AMIS overview of database 12c
 
Hpc lunch and learn
Hpc lunch and learnHpc lunch and learn
Hpc lunch and learn
 
EAD3 Progress Report 2014-08-13
EAD3 Progress Report 2014-08-13EAD3 Progress Report 2014-08-13
EAD3 Progress Report 2014-08-13
 
PostgreSQL as a Strategic Tool
PostgreSQL as a Strategic ToolPostgreSQL as a Strategic Tool
PostgreSQL as a Strategic Tool
 
Datastage Introduction To Data Warehousing
Datastage Introduction To Data WarehousingDatastage Introduction To Data Warehousing
Datastage Introduction To Data Warehousing
 
Expert guidance on migrating from magento 1 to magento 2
Expert guidance on migrating from magento 1 to magento 2Expert guidance on migrating from magento 1 to magento 2
Expert guidance on migrating from magento 1 to magento 2
 
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
Developing Kafka Streams Applications with Upgradability in Mind with Neil Bu...
 
Hannes end-of-the-router-tnc17
Hannes end-of-the-router-tnc17Hannes end-of-the-router-tnc17
Hannes end-of-the-router-tnc17
 

Recently uploaded

Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
FIDO Alliance
 
Microsoft BitLocker Bypass Attack Method.pdf
Microsoft BitLocker Bypass Attack Method.pdfMicrosoft BitLocker Bypass Attack Method.pdf
Microsoft BitLocker Bypass Attack Method.pdf
Overkill Security
 
CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)
Wonjun Hwang
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
FIDO Alliance
 

Recently uploaded (20)

Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptxHarnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
Harnessing Passkeys in the Battle Against AI-Powered Cyber Threats.pptx
 
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptxCyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
Cyber Insurance - RalphGilot - Embry-Riddle Aeronautical University.pptx
 
AI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by AnitarajAI in Action: Real World Use Cases by Anitaraj
AI in Action: Real World Use Cases by Anitaraj
 
Microsoft BitLocker Bypass Attack Method.pdf
Microsoft BitLocker Bypass Attack Method.pdfMicrosoft BitLocker Bypass Attack Method.pdf
Microsoft BitLocker Bypass Attack Method.pdf
 
ChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps ProductivityChatGPT and Beyond - Elevating DevOps Productivity
ChatGPT and Beyond - Elevating DevOps Productivity
 
Working together SRE & Platform Engineering
Working together SRE & Platform EngineeringWorking together SRE & Platform Engineering
Working together SRE & Platform Engineering
 
CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)CORS (Kitworks Team Study 양다윗 발표자료 240510)
CORS (Kitworks Team Study 양다윗 발표자료 240510)
 
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
Event-Driven Architecture Masterclass: Integrating Distributed Data Stores Ac...
 
Six Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal OntologySix Myths about Ontologies: The Basics of Formal Ontology
Six Myths about Ontologies: The Basics of Formal Ontology
 
Introduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDMIntroduction to use of FHIR Documents in ABDM
Introduction to use of FHIR Documents in ABDM
 
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
The Ultimate Prompt Engineering Guide for Generative AI: Get the Most Out of ...
 
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider  Progress from Awareness to Implementation.pptxTales from a Passkey Provider  Progress from Awareness to Implementation.pptx
Tales from a Passkey Provider Progress from Awareness to Implementation.pptx
 
Overview of Hyperledger Foundation
Overview of Hyperledger FoundationOverview of Hyperledger Foundation
Overview of Hyperledger Foundation
 
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
TEST BANK For Principles of Anatomy and Physiology, 16th Edition by Gerard J....
 
الأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهلهالأمن السيبراني - ما لا يسع للمستخدم جهله
الأمن السيبراني - ما لا يسع للمستخدم جهله
 
Intro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptxIntro to Passkeys and the State of Passwordless.pptx
Intro to Passkeys and the State of Passwordless.pptx
 
How to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cfHow to Check CNIC Information Online with Pakdata cf
How to Check CNIC Information Online with Pakdata cf
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
Observability Concepts EVERY Developer Should Know (DevOpsDays Seattle)
 
UiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overviewUiPath manufacturing technology benefits and AI overview
UiPath manufacturing technology benefits and AI overview
 

Agile Oracle to PostgreSQL migrations (PGConf.EU 2013)

  • 1. Higher impact of license costs
  • 2. Agile Oracle to PostgreSQL migrations PGConf.EU 2013, Dublin, Nov 1st Gabriele Bartolini 2ndQuadrant Italia / PostgreSQL Europe gabriele.bartolini@2ndQuadrant.it @_GBartolini_
  • 3. Gabriele Bartolini • Co-Founder and Manager of 2ndQuadrant Italia • Data Architect, Business critical environments • Data warehousing • Co-Founder Italian PostgreSQL Users Group • Co-Founder PostgreSQL Europe • PostgreSQL Contributor and Advocate
  • 4. Outline • Introduction • The migration project • Open source tools • Conclusions
  • 5. Target • Chief Technical Officers • Chief Information Officers • Oracle users • Evaluate moving to PostgreSQL 9.3
  • 6. Goals • Describe the migration process • Spot the major sources of costs • Help you plan a migration in the mid/long term
  • 8. Oracle vs Postgres (*) not sure it is in the TODO List, yet
  • 9. Upgrade automatically Would you ever do an upgrade to a higher version of Oracle in a completely automated way?
  • 10. PostgreSQL • Hot Standby (~ Data Guard) • Memcache integration (~ InMemory Database Cache) • Barman (~ RMAN) • Partitioning (*) • Londiste/PgQ (GoldenGate) • PostGIS (Spatial) • SE Linux integration (~ Database Vault) • Future: Multi-master replication (~ RAC)
  • 11. License • Very simple and clear • Applies to every part (module, product, option) of Postgres • server, client, libraries, additional modules • 100% open source • No need to hire a lawyer to understand it • Highly Permissive • Not subject to monopoly nor acquisitions • Fosters market competition in professional services offer
  • 12. Oracle DBA, do not be afraid! • Transferrable knowledge • PostgreSQL focused professional training • 100% open source
  • 14. Migration = project budget, scope, quality, time
  • 15. Budget • Crucial variable • Usually triggers the migration process • Cost analysis drives the migration project • short term • mid term
  • 17. Components • Applications • Database • Processes • Human resources
  • 19. Comparison with Oracle upgrade Testing Processes Training Licensing fictitious data Dev 25,00% 50,00%
  • 20. External applications • Force your supplier to provide Postgres support for their application • You set the rules • Typical case of the public sector • e.g.: Land registry • Financial crisis and competition are on your side
  • 21. Agile approach • Requirements change • Every context is different from the other • No one-size-fits-all scenario • Be dynamic: • SCRUM (with the customer) • Kanban (internally) • DevOps
  • 22.
  • 23. Focus • Applications • Database • Processes • Human resources
  • 24. Database migration • Schema • Queries • Data • Stored procedures • Tests
  • 25. Schema conversion • Tables • Data type mapping • Indexes • Views • Constraints
  • 26. Schema major differences • USER = schema/database • UPPERCASE = lowercase • Partitioning (*) • Tablespaces • SYNONYMs • search_path / auto updatable views / foreign tables
  • 27. Queries • ANSI/ISO SQL • PostgreSQL has no hints (optimiser) • OUTER JOINs • (+) • use LEFT/RIGHT JOIN • Major differences: • DUAL • NULL = NULL • ROWNUM and ROWID • Postgres: NULL • ... • Oracle: TRUE
  • 28. Data • Might require specialised consulting activities • Major solutions: • ETL tools (e.g. Kettle) • External scripts (e.g. ora2pg or custom) • COPY t FROM stdin; • Foreign tables with Oracle FDW • INSERT INTO t SELECT * FROM ft; • Cut-over time •>0 •~0
  • 29. Stored Procedures • Most critical and complex component of the whole migration • Package = extension (schema) • Two major ways: • 1:1 conversion (not always possible) • complete rewriting (optimised for PostgreSQL) • It might required specialised consulting activities
  • 30. PL/SQL vs PL/pgSQL • Syntactical differences • PROCEDURE = FUNCTION that returns VOID • TRIGGER = TRIGGER FUNCTION + TRIGGER • Lack of autonomous transactions • Lack of global variables • ...
  • 31. Test • Vital component for a successful migration process • It measures the QUALITY of the project • It can be reused in the future for PostgreSQL upgrades • strategic investment in the long period
  • 33. ora2pg • URL: http://ora2pg.darold.net/ • Written in Perl - GNU GPL 3 • Reads the information schema from Oracle • Generates DDL instructions for PostgreSQL • Highly configurable (mapping data type conversions) • Basic support for PL/SQL (regexp)
  • 34. orafce • URL: http://orafce.projects.pgfoundry.org/ • C and SQL - BSD licensed • Set of functions, objects and modules that are part of Oracle: • NVL function (COALESCE) • DBMS_ALERT, DBMS_OUTPUT, UTL_FILE, ... • DUAL
  • 35. Oracle FDW • URL: http://oracle-fdw.projects.pgfoundry.org/ • SQL/MED • uses the API for Foreign Data Wrapper • CREATE FOREIGN TABLE • Currently READ ONLY • Useful for ETL
  • 36. Example of Oracle FDW ... CREATE FOREIGN TABLE oracle_table ( id integer NOT NULL, ... ) SERVER oradb OPTIONS (schema 'ORAUSER', table 'ORATAB'); ... -- pushes down the WHERE clause SELECT * FROM oracle_table WHERE id=10;
  • 37. PgTap • Unit tests suite for PostgreSQL • Extensions (functions) • Produces TAP output • Test Driven Development in databases
  • 38. Vagrant • Open Source software • Creation and configuration of virtual environments • Provisioning: Puppet, Chef • Useful for local testing
  • 39. PostgreSQL • Every major release of Postgres reduces the technology gap with Oracle • 5 years ago, Postgres did not have hot standby, streaming/ synchronous/cascading replication, window functions, CTEs, column permissions, foreign tables, serialisable isolation level, XML, JSON, updatable and materialised views ... • Is it called “OraGIS” or “PostGIS”? • Postgres does have transactional DDL
  • 41. If you really miss it ... CREATE USER scott WITH PASSWORD ‘tiger’; CREATE DATABASE scott WITH OWNER scott; c scott scott CREATE SCHEMA scott;
  • 43. Cost analysis of a database solution on a period of 3 years for 1 server License Support 300.000 270.000 240.000 210.000 64.000 150.000 Costs in Euro 180.000 140.000 120.000 32.000 90.000 60.000 30.000 0 70.000 16.000 35.000 1 CPU Socket 2 CPU Socket 4 CPU Socket * PostgreSQL with 24/7 support from us 7.500 PostgreSQL*
  • 44. Cost analysis of a migration to PostgreSQL in a 3 year period Oracle PostgreSQL 150.000 135.000 120.000 50.000 105.000 Costs in euro 90.000 75.000 60.000 45.000 70.000 30.000 2.500 0 Anno 1 2.500 16.000 15.000 16.000 Anno 2 Anno 3 * PostgreSQL with 24/7 support from us
  • 45. Conclusions • Final solution: 100% open source • reduced TCO • No vendor lock-in • Migration must be focused on costs evaluation • Supervised process (not automated) • If a feature is missing, you can simply sponsor it • If needed, professional companies can help you before, during and after the migration process (you won’t be alone)
  • 47. Thank you! Licenza Creative Commons BY-NC-SA 3.0 http://creativecommons.org/licenses/by-nc-sa/3.0/it/deed.it