Migrating an Application from Oracle to EnterpriseDB

Lewis R Cunningham Author, EnterpriseDB: The Definitive Reference

• • • • • Introduction and comments Overview of presentation Overview of TimeTraker Application Steps in a migration Walk through of migration

Webinar Goals For You
• See an example application get migrated • Understand the steps and decisions needed to successfully migrate an application • Understand compatibility issues • Understand how to work with the database • Understand when and how to work around the database

The Sample Application
• Simple application using real world code and data • Subset of a real application (I wrote long ago) • TimeTraker
– – – – – Tracks Project Deliverables Tracks Resources Tracks Resource Expenditures Provides Interfaces for Tracking Data Provides Reporting

TimeTraker WorkFlow

• • • • •

Project Manager (PM) creates a project PM assigns tasks to a project PM assigns resource to tasks Developers bill hours to tasks Everyone runs reports

TimeTraker Features
• Features
– API and XML Interfaces – Formatted reporting and CSV output – Role Based Security, user may have multiple roles – User Definable Calendar and Schedules – Dependency Tracking

TimeTraker Data Model
• Data Model

TimeTraker API

• Steps before migrating to help you get there
– Coding Standards
• If your code follows standards you can analyze what will need to change by migrating a very tiny subset

– Analyze Application Before Starting
• If you just start at random, you will get frustrated • Understand what will migrate without change, what will require changes and what will require re-writing

– Understand what EnterpriseDB does and does not provide (currently) – Talk to EnterpriseDB support

Migration Steps
• Using Developer Studio
– – – – Create a connection to your source database Create a target EnterpriseDB database Create a connection to your source database Perform an Online Migration

• Correct Data Model Errors • Correct Code Errors • Test

Create Source Connection

Create a Target Database
• Not really required, you can migrate to an existing database • Multiple applications can share a database • I prefer each application to have its own database

Begin the Migration

Online Migration Results

Online Migration Results (Cont'd)

Working with the Code

Columns aliases require AS

A Query with Analytics

Same Query withOUT Analytics

What Changed?
• UTL_FILE did not exist
– It does now – I was able to write my own

• XML_TYPE does not exist
– I was able to write a work around using native XML functionality

• SPL does not accept RECORD types of non-scalar data types
– TYPETYPE local_file_type IS RECORD ( txt_file UTL_FILE.FILE_TYPE, csv_file UTL_FILE.FILE_TYPE ); - Not acceptable

What Doesn’t Work
• SPL does not support forward declarations of private procedure/function calls
– I moved the offending procedures to the top of the packages – Had I run into a loop (internal proca calls internals procb which in turn calls proca), I would have had to move the internal procedures to the spec

• EnterpriseDB supports PUBLIC synonyms but not PRIVATE synonyms (not a big issue) • Dynamic FOR LOOPS must be moved to static cursors

What Does Work
• Schema Migrated Wholesale Without Changes • Majority of Code Migrated Unchanged • EnterpriseDB Support MOST Oracle-style SQL
– DECODE – OUTER JOINS – What doesn't currently exist is being added

• UTL_FILE added in 8.2, additional packages added with every release • Database Links are Available • Partitioning is Available out of the Box

About EnterpriseDB
Derek M. Rodner Director, Product Strategy

Bringing the Open Source Advantage to Enterprises

Open Source Software Fast development cycles Thousands of developers Better code Lower cost

Commercial Software 24/7 support Services and training Certification Indemnification Product strategy

FTD Replaces Oracle and Saves 83%
• Problem
– Performance of mission critical back-office reporting and analysis systems for order fulfillment raising concerns going into Mother’s Day rush

• Solution
– Offload production Oracle servers to operational data store in EnterpriseDB – Run Oracle Reports® against EnterpriseDB Advanced Server

“When someone comes in at a sixth the cost and 500 times the customer service that makes it very easy. I'd definitely reach out to as many Oracle users as possible to get this [EnterpriseDB] on your system and prove it out” Jason Weiss, Software Architect, FTD

• Benefits
– Seamless transition accelerated implementation in under 6 weeks to meet Mother’s Day deadline

• Next Steps
– Expanding use of EnterpriseDB to offload other mission critical applications

Online Gaming Leader Replaces Oracle
• • • • Problem
– Oracle license fees consuming IT budget

– EnterpriseDB Advanced Server to replace entire Oracle infrastructure

Sony Online Entertainment
“EnterpriseDB Advanced Server is the clear database choice because of its PostgreSQL foundation, compatibility with Oracle and the support of the EnterpriseDB team." Christopher Yates, SVP, Technology

– Estimated $1 million annual savings

Next Steps
– EnterpriseDB all new games developed on EnterpriseDB – All backend infrastructure to be converted to EnterpriseDB – Cost effective data marts for BI/reporting

Leading VOIP Provider Building New Applications
• Problem
– Cost of Oracle audit and ongoing “extras” was too expensive – Applications built on MySQL not scaling well

“Oracle is a sledgehammer. MySQL is a small hammer. We needed something in between.” Tim Smith, President, Vonage Networks

– EnterpriseDB selected as midrange DBMS standard between MySQL & Oracle

– New corporate IM program released – Significant future cost savings

Next Steps
– EnterpriseDB to replace Oracle for mission-critical customer applications

EnterpriseDB Company Facts
• Award-winning enterprise database software company • High-growth private company founded in March 2004; Launched May 2005 • $28.5M funding, including Fidelity, Charles River, and Valhalla • Headquartered in Iselin, NJ; offices in 6 countries • World’s largest concentration of PostgreSQL expertise • Over 100 customers and partners
2006 IT Success Story Best Database Award 2005, 2006 & 2007 Top 100 Technology Companies

2006 “Ones to Watch”

Contact Information
• Lewis Cunningham, Oracle ACE
– lewisc@rocketmail.com – 641-715-3900 ext 26803#

• Derek M. Rodner
– derek.rodner@enterprisedb.com – 732-331-1333

Thank you.