Road to Freedom:

                                     Avoiding the Pitfalls 

                                              of

                                   Oracle Migration Projects "
           Presented by "
           Craig Silveira"
           Director, WW Sales Engineering"
           EnterpriseDB Corporation"
           info@enterprisedb.com "




EnterpriseDB, Postgres Plus and Dynatune are trademarks of
EnterpriseDB Corporation. Other names may be trademarks of their   1
respective owners. © 2010. All rights reserved.
Common Pitfalls of Oracle Migration"




                   1.       Inadequate or inaccurate migration assessment
                   2.       Incomplete migration plan
                   3.       Lack of migration expertise to handle unforeseen problems
                   4.       Lack of available time & trained resources



© 2013 EnterpriseDB. Privileged and Confidential. All rights reserved.   2
Who is EnterpriseDB?"




EnterpriseDB, Postgres Plus and Dynatune are trademarks of
EnterpriseDB Corporation. Other names may be trademarks of their   3
respective owners. © 2010. All rights reserved.
u    We enable the benefits of Postgres along with the commercial
         dependability, resources and support needed for enterprise-class
         applications"
   u    Because we are a database product development company, we also
         offer:"
          u     Full product roadmap strategy!
          u     Indemnification !
          u     Deep Postgres engineering talent & resources!

   u    We are a major supporter of the PostgreSQL community"
   u    We provide a wide array of Postgres products, services, training
         and support to meet all your Postgres needs!

   © 2013 EnterpriseDB. Privileged and Confidential.
                                                       4
   "
© 2013 EnterpriseDB. All rights reserved.
   All rights reserved.
5
© 2013 EnterpriseDB. All rights reserved.       5
Common Pitfalls of Oracle Migration"




                   1.       Inadequate or inaccurate migration assessment
                   2.       Incomplete migration plan
                   3.       Lack of migration expertise to handle unforeseen problems
                   4.       Lack of available time & trained resources



© 2013 EnterpriseDB. Privileged and Confidential. All rights reserved.   6
Assessment Factors to Consider
    u    Technical:
          •  Compatibility
          •  Feature sets
    u    Human:
          •  Training
          •  Change management
    u    Operational:
          •    Testing
          •    Monitoring
          •    Management
          •    Back-up
          •    Replication
          •    Security


                                            7


© 2013 EnterpriseDB. All rights reserved.
Oracle Migration Assessment"
       1    Analyze Oracle Schema Layout:


                                            Static Analysis of Oracle Schema
                                            and database layout




       2     Review features used in Oracle client application:


                                            Static Analysis of Source Code


                                               Developer Interviews




© 2013 EnterpriseDB. All rights reserved.              8
Oracle Migration Assessment"
    3     Evaluate results along 5 axis using proven algorithms:




    4    Migration report developed:
          u  Score
                  of 1 – 10 assigned based on
            analysis of steps 1 and 2
               –  1 difficult – 10 minimal effort!
          u  Work  arounds for identified missing
              features
          u  Time estimates given in man weeks


© 2013 EnterpriseDB. All rights reserved.            9
What Does

                                             Oracle Compatibility

                                                   Mean?"




EnterpriseDB, Postgres Plus and Dynatune are trademarks of
EnterpriseDB Corporation. Other names may be trademarks of their   10
respective owners. © 2010. All rights reserved.
Oracle Compatibility Reduces Risk"




           u    Run applications written for Oracle virtually unchanged
           u    No need to re-train Oracle DBAs and developers
           u    Support for PL/SQL language and OCI interoperability
           u    Replication for easy sharing of data


© 2013 EnterpriseDB. All rights reserved.   11
What Is Postgres Plus Advanced Server?"


                                                     u    Built on the world’s most advanced
                                                           database—PostgreSQL
                                                     u    9th generation Oracle compatibility
                                                     u    World-class security add-ons
                                                     u    Performance that rivals any other
                                                           proprietary RDBMS
                                                     u    Enterprise-class developer and
                                                           DBA tools
                                   PostgreSQL        u    Installation, performance tuning,
                                                           and maintenance services
                                                     u    Software indemnification




CONFIDENTIAL
© 2012 EnterpriseDB. All rights reserved.       12
Compatibility Means:"
          u     SQL extension support
                   •  Decode, NVL, Substr, NVL2"
                   •  Date/time functions: add_months, extract, next_day "
          u     PL/SQL support
                   •     REF Cursors, Implicit and explicit cursors"
                   •     Looping, variable declarations, conditional statements"
                   •     Collections: Associative Arrays, Varrays, Nested tables"
                   •     Bulk binding"
                   •     Named parameters"
                   •     User Defined Exceptions"
                   •     Explicit Transaction Control"
                            –  within a stored procedure!
                            –  (not supported by PostgreSQL!
          u     Tools
                   •  EDB*Plus – SQL*Plus look-a-like"
                   •  EDB*Loader – SQL*Loader equivalent"
                   •  EDB*Wrap – similar to the PL/SQL wrapper"

© 2011 EnterpriseDB. All rights reserved.
Compatibility means: (cont.)"
u    Features
      •    Packages"
      •    Stored procedures"
      •    Functions"
      •    Triggers"
      •    Hints"
      •    Database Links"
      •    Hierarchical Queries"
      •    Synonyms – Public and Private"
      •    Sequences"
      •    Rownum"
      •    Object types "
            –    Create type … as object!
            –    Create type … as table!
            –    Create type …as varray!
            –    Constructor and collection methods!
      •  Users/Roles"
      •  Dynamic SQL"
      "
Compatibility (cont.)"
u    Data Types
       •  Integer, number, char, double precision, float, varchar2, blob, clob, xmltype,
          rowid"
u    Built-in Packages
       •  DBMS_:"
            –  SQL, LOB, JOB, PIPE, ALERT, OUTPUT, UTILITY, PROFILER!
       •  UTL_:"
            –  FILE, MAIL, SMTP, ENCODE, TCP!
u    Oracle-like Data Dictionary
       •  ALL_, DBA_, USER_ views"
       •  Most commonly accessed views"
u    Diagnostics - DRITA
       •  System and session waits"
            –  Not exposed in PostgreSQL !
            –  Part of Advanced Server!
       •  Statspack-like reporting"
Database Migration Toolkit                                  ""
          u     Online Migration Toolkit enables point and click migration from
                 Oracle
          u     Automatically Migrates:

                         u      Data                     u    Sequences
                         u      Schemas                  u    Packages
                         u      Stored Procedures        u    Views
                         u      Triggers                 u    Database Links
                         u      Functions                u    Synonyms




© 2011 EnterpriseDB. All rights reserved.            16
Ease of Migration"




© 2013 EnterpriseDB. All rights reserved.   17
What Does

                                                            This 

                                                         Mean to You?"




EnterpriseDB, Postgres Plus and Dynatune are trademarks of
EnterpriseDB Corporation. Other names may be trademarks of their   18
respective owners. © 2010. All rights reserved.
Oracle Compatibility & Migration Strategies"
                       Strategy                           Benefits
                                       § Significant cost savings for non mission critical
               Develop/Deploy             systems
             New LOB Applications      § Leverages all existing Oracle skills
                                       § Very low risk
                                       § Significant cost savings
             Deploy Postgres Plus
                                       § Leverages Postgres Plus Replication Server
                  as Oracle            § Leverages all existing Oracle skills
              Replication Server
                                       § Improves transaction and query performance

              Migrate non Mission      § Significant cost savings
             Critical Oracle Apps to   § Leverages all existing Oracle skills
                  Postgres Plus        § Very low risk

            Migrate Mission Critical   § Biggest cost savings
                Oracle Apps to         § Leverages all existing Oracle skills
                Postgres Plus          § Greatest deployment flexibility


© 2009 EnterpriseDB Corporation
Applications built on PostgreSQL"




© 2013 EnterpriseDB. All rights reserved.   20
Migration Example"




© 2011 EnterpriseDB. All rights reserved.   21
Common Pitfalls of Oracle Migration"




                   1.       Inadequate or inaccurate migration assessment
                   2.       Incomplete migration plan
                   3.       Lack of migration expertise to handle unforeseen problems
                   4.       Lack of available time & trained resources



© 2013 EnterpriseDB. Privileged and Confidential. All rights reserved.   22
Migration Methodology"




EnterpriseDB, Postgres Plus and Dynatune are trademarks of
EnterpriseDB Corporation. Other names may be trademarks of their   23
respective owners. © 2010. All rights reserved.
Multi-phase Migration Process"
          u     Phase I – Planning
                   •      Determine what application to migrate"
                            –    Home grown applications!
                            –    Java, C!
                            –    Packaged applications that support multiple databases!
                            –    Support JDBC, ODBC"
                   •      Once candidate applications are chosen, sign up for OMA"
                   •      Oracle Migration Assessment (OMA) Identifies:"
                            –  Possible migration issues!
                            –  Gives time estimate to migrate system"
                   •      Establish migration team:"
                            –  Need source system knowledgeable resource!
                            –  Need target system knowledgeable resource"
                   •      Establish project plan with milestones"




© 2011 EnterpriseDB. All rights reserved.
Multi-phase Migration Process"
          u     Phase II – Prepare Environment
                   •  Obtain and install necessary software"
                   •  Establish connectivity between systems"
                            –  Copy the Oracle JDBC jar file to jre/lib/ext directory in Postgres Plus Advanced
                               Server Installation!
          u     Phase III – Migrate Schema
                   •  Use Migration Toolkit in schema only mode"
                   •  Resolve issues here before going to next phase"
          u     Phase IV – Migrate Data
                   •  Use Parallel streams in Migration Studio"
                   •  OR Use command line MTK"
                            –  Use –copyViaDBLinkOra!
                            –  Uses OCI to connect to Oracle!
                   •  Use dblink_ora_copy function directly to bypass logging"
                   •  Export Oracle data to flat files, load using EDB*Loader"




© 2011 EnterpriseDB. All rights reserved.                       25
Multi-phase Migration Process"
          u     Phase V – Port Application
                   •  Change connection information"
                   •  Recompile /Link application (OCI or Pro*C)"
          u     Phase VI – Test
                   •     Verify application functionality"
                   •     Address issues"
                   •     Test performance "
                   •     Tune"
          u     Phase VII Integration
                   •  Establish co-existence strategy"
                   •  Setup database links to other databases"
                   •  Setup replication between Oracle or SQL Server and Postgres Plus
                      Advanced Server "
          u     Phase VIII – Rollout
                   •  System becomes production "



© 2011 EnterpriseDB. All rights reserved.                    26
How to Migrate:

                                          A Step by Step Guide"




EnterpriseDB, Postgres Plus and Dynatune are trademarks of
EnterpriseDB Corporation. Other names may be trademarks of their   27
respective owners. © 2010. All rights reserved.
Phase I Oracle Migration Assessment"
          u     *** Checking for Migration Issues ***
          u                   Object Type                Type                         Count
          u      ----------------------------------------------------------------------------------
          u                 TRIGGER                      Count                       0
          u                  SOURCE                      Package                        0
          u                   SOURCE                      Syntax - Exception                 0
          u                   SOURCE                      Function                      789
          u                   SOURCE                      Syntax - Object                  0
          u                   SOURCE                      Syntax - Other                   792
          u                   SOURCE                      Syntax - Hints                  282
          u                   SOURCE                      Syntax - Exp Trans Ctl               730
          u                   SOURCE                      Total Count                     2623
          u                   COLLECTION                     Count                        1
          u                   VARRAY                      Count                        0
          u                   DIMENSION                     Count                        0
          u                   JOB                     Count                        0
          u                   MATERIALIZED VIEW                    Count                       0
          u                   RESOURCE MGR                       Count                        0
          u                   POLICY                    Count                        9
          u                   PROFILE                    Count                        6
          u                   SUMMARY                       Possible Migration Issues 2775




© 2011 EnterpriseDB. All rights reserved.                                      28
Phase II Setup Environment"
          u     Establish connectivity
                   •  Copy Oracle JDBC jar file to Postgres Plus Advanced Server install"

                   cp /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/jdbc/lib/ojdbc14.jar /opt/
                      PostgresPlus/9.0AS/jre/lib/ext"
                   "
                   •  Edit the toolkit.properties file to contain Oracle and Postgres Plus Advanced
                      Server connection information:"

                   SRC_DB_URL=jdbc:oracle:thin:@localhost:1521:xe"
                   SRC_DB_USER=system"
                   SRC_DB_PASSWORD=mgr"
                   "
                   TARGET_DB_URL=jdbc:edb://localhost:5999/demo"
                   TARGET_DB_USER=demo"
                   TARGET_DB_PASSWORD=mgr"
                   "

© 2011 EnterpriseDB. All rights reserved.               29
Phase III Migrate Schema"
          u     Use MTK in schema only mode:
          [enterprisedb@localhost bin]$ ./runMTK.sh -schemaOnly hr
          Source database connectivity info...
          conn =jdbc:oracle:thin:@localhost:1521:xe
          user =system
          password=******
          Target database connectivity info...
          conn =jdbc:edb://localhost:5999/demo
          user =demo
          password=******
          Connecting with source Oracle database server...
          Connecting with target EnterpriseDB database server...
          Importing redwood schema hr...
          Creating Schema...hr
          Creating Object Type: NUMLIST
          Creating Sequence: EMPLOYEES_SEQ
          Creating Tables...
          Creating Table: EMPLOYEES



© 2011 EnterpriseDB. All rights reserved.         30
Phase III Migrate Schema con’t"
          ******************** Migration Summary ********************
          Object Types: 9 out of 9
          Sequences: 3 out of 3
          Tables: 49 out of 53
          Constraints: 39 out of 40
          Procedures: 7 out of 7
          Functions: 3 out of 3
          Packages: 3 out of 3

          Total objects: 139
          Successful count: 134
          Failure count: 5

          List of failed objects
          ======================
          Tables
          --------------------
          1. HR.BFTEST
          2. HR.TESTBD
          3. HR.TESTBF
          4. HR.TESTCNTXT


© 2011 EnterpriseDB. All rights reserved.                  31
Phase III Migrate Schema con’t"
          u     Migration logs stored in user’s home directory :
                   /home/enterprisedb/.enterprisedb/migration-toolkit/logs"
          u  Resolve issues:
          Error Creating Table TESTCNTXT:ERROR: function sys_context(unknown,
              unknown) does not exist
           Hint: No function matches the given name and argument types. You might need to
              add explicit type casts.

          CAUSE: this table used SYS_CONTEXT(‘USERENV’,’CURRENT_USER’) as a
            DEFAULT value
          RESOLUTION: use CURRENT_USER function instead




© 2011 EnterpriseDB. All rights reserved.              32
Phase IV Migrate Data"
          u     Use MTK in data only mode:
          [enterprisedb@localhost bin]$ ./runMTK.sh -dataOnly hr
          Source database connectivity info...
          conn =jdbc:oracle:thin:@localhost:1521:xe
          user =system
          password=******
          Target database connectivity info...
          conn =jdbc:edb://localhost:5999/demo
          user =demo
          password=******
          Connecting with source Oracle database server...
          Connecting with target EnterpriseDB database server...
          Importing redwood schema hr...
          Loading Table Data in 8 MB batches...
          Loading Table: AGES ...
          [AGES] Migrated 1 rows.
          [AGES] Table Data Load Summary: Total Time(s): 0.467 Total Rows: 1
          Loading Table: DEPARTMENTS ...



© 2011 EnterpriseDB. All rights reserved.            33
Phase V Port the Application"

     §  Change Application Connection method
     §  Java application =
     §  Old connection syntax:
     Class.forName("oracle.jdbc.driver.OracleDriver");
        Connection con =
         DriverManager.getConnection("jdbc:oracle:thin:@localhost:
         1521:xe”,”scott”,”tiger”);

     § New connection syntax:
      Class.forName("com.edb.Driver");
      Connection con = DriverManager.getConnection("jdbc:edb://localhost:
       5444/edb",
      "enterprisedb","enterprisedb");

© 2011 EnterpriseDB. All rights reserved.
Common Pitfalls of Oracle Migration"




                   1.       Inadequate or inaccurate migration assessment
                   2.       Incomplete migration plan
                   3.       Lack of migration expertise to handle unforeseen problems
                   4.       Lack of available time & trained resources



© 2013 EnterpriseDB. Privileged and Confidential. All rights reserved.   35
Handling Issues"




EnterpriseDB, Postgres Plus and Dynatune are trademarks of
EnterpriseDB Corporation. Other names may be trademarks of their   36
respective owners. © 2010. All rights reserved.
Handling Issues"
          u     Not all migrations are error free
                   •  Migration log will contain all errors"
          u     Some common issues:
                   •  Column delimiter chosen is in column data"
                            –  Causes ‘Extra data found’ error!
                            –  Resolve by using different delimiter!
          u     Oracle built-in package does not exist
                   •  DBMS_AQ – we use solutions like ActiveMQ, MQSeries or Tibco"
                            –    Or own code. Enqueue and dequeue procedures are fairly easy to code!
                            –    xDB Replication Server can also be used since based on pub/sub architecture!
                            –    DBMS_RANDOM – use random function instead!
                            –    DBMS_LOCK.sleep – use pg_sleep function instead!
          u     Oracle feature not supported
                   •  MERGE command not supported"
                            –  Can be rewritten to use INSERT and UPDATE with checks!
                   •  Index Organized Tables"
                            –  Cluster a table using CLUSTER! command for same read performance gain!


© 2011 EnterpriseDB. All rights reserved.                       37
Handling Issues (continued)"
     u  Database Links
          •  Migrated over by tool but password is invalid"
                       –  This is because Oracle hides the password!
                       –  Resolve by dropping and recreating!
                       –  Or by specifying a password to use when running the MTK!

                             –  runMTK -allDBLinks LINK_NAME1=abc,LINK_NAME2=xyz HR

     u  Data Movement – performance
          •  Migration toolkit connects via jdbc"
          •  Large datasets are slow to move"
          •  Use database link functionality instead"
                       –  Dblink_ora_copy – EnterpriseDB method to copy data from Oracle over OCI!
                       –  Much faster!
              •  OR extract data from Oracle to csv files, the load using edbldr"

              "
              "


© 2011 EnterpriseDB. All rights reserved.
Tuning Recommendations"
          u     Use DynaTune
                   •  Dynamically adjusts database configuration based on available resources"
                   •  Set via edb_dynatune parameter"
                            –  Values 0 – 100 corresponding to % of machines to use!


          u     Remember to analyze database
                   •  Use Analyze command"


          u     Oracle Hints supported
                   •  No need to remove from embedded SQL"




© 2011 EnterpriseDB. All rights reserved.                     39
Common Pitfalls of Oracle Migration"




                   1.       Inadequate or inaccurate migration assessment
                   2.       Incomplete migration plan
                   3.       Lack of migration expertise to handle unforeseen problems
                   4.       Lack of available time & trained resources



© 2013 EnterpriseDB. Privileged and Confidential. All rights reserved.   40
How EnterpriseDB Can Help"




EnterpriseDB, Postgres Plus and Dynatune are trademarks of
EnterpriseDB Corporation. Other names may be trademarks of their   41
respective owners. © 2010. All rights reserved.
EnterpriseDB Resources & Assistance"

              RESOURCES
               EFFORT/                                                                                                    ROI




                                                                                                                            TIME


                                 INVESTIGATION                 VALIDATION          MIGRATION/                 PRODUCTION
                                                                                 DEVELOPMENT

                                                                                •  Best-Practices?      •    Support?
                          •    PGSQL capabilities?
                                                          •    Performance?     •  Risk mitigation?     •    Staff augmentation?
                          •    Feature mapping?
 Customer                                                 •    Compatibility?   •  Migration            •    Training?
                          •    TCO/ROI?
 Challenges                                               •    Security?           assistance?          •    Replication?
                          •    EDB capabilities?
                                                          •    Cost?            •  Tech resources?      •    Monitoring?
                          •    Product Road-map?
                                                                                •  DBA Skills?          •    Indemnification?

                          •  Opportunity Analysis         •  Migration                                  •    Product Support
                                                                                •  Enterprise
                             Workshop                        Assessment Test                            •    Remote DBA
                                                                                   Enablement
 EnterpriseDB             •  Architectural health check   •  Performance                                •    Training
                                                                                •  Oracle
 Resources                •  White papers                    benchmarking                               •    Enterprise Manager
                                                                                   compatibility
                          •  Analyst reports              •  References                                 •    xDB Single/Multi-
                                                                                •  Migration planning
                          •  Webinars                     •  Case Studies                                    master replication

© 2013 EnterpriseDB. All rights reserved.                               42
Enterprise Enablement Services"
     Goals
     •     Reduce time to value
     •     Reduce risk
     •     Contain cost
     •     Enable self-sufficiency
                                                                                           Knowledge
     •     Ensure success                                                                   Transfer

                                                                              On-demand
                                               Training                        Access to
                                                                                Experts

                                                             Configuration
                                                             Best Practices


                                             Architecture                                              Remote DBA
                                            Best Practices                                               Services

                                                              Developer
                                                              Support &
                                                              Break Fix




© 2013 EnterpriseDB. All rights reserved.                       43
Oracle Migration Assessment"
          u     Paid for service from EnterpriseDB
          u     What is it?
                   •  Pre-analysis interview"
                   •  Analysis of Oracle schemas to be migrated"
                   •  Finds possible migration issues"
                            –  Unsupported Features!
                            –  Unsupported Syntax!
                            –  Implementation Differences!
                   •  Findings documented with possible workarounds in final report"
                   •  Post analysis discussions to review findings"
          u     Migration feasibility score assigned (1 – 10)




                           http:www.enterprisedb.com/solutions/oramig.do

© 2011 EnterpriseDB. All rights reserved.                    44
Oracle Migration Factory Core Services"
          u     Customer provides data-less Oracle export of database
          u     Migrate the database(s) to Postgres Plus Advanced Server
                   •  Resolve any issues"
                   •  Implement workarounds for missing or different functionality"
                   •  Perform sanity checking of unit functionality"
                            –  Requires input/output from customer on same units in Oracle!

          u     Document the changes/workarounds
          u     Educate Customer on changes/workarounds
                   •  Advise on application level changes needed"
          u     Return migrated databases to Customer
                   •  Via pg_dump"


          u     Customer can customize with add on options




© 2011 EnterpriseDB. All rights reserved.                     45
Oracle Migration Factory Add-ons"
          u     Setup and Migrate test system
                   •  Installation of Postgres Plus Advanced Server on Customer server"
                   •  Import of migrated database to Postgres Plus Advanced Server         ""
                   •  Migration of test data from a test Oracle system"
          u     Application Functional Testing
                   •  Provide assistance in connecting application to database"
                   •  Provide assistance in functional testing of application"
                   •  Resolve functional testing issues"
          u     Performance Tuning of Migrated System
          u     Production Migration Setup
                   •  Install Postgres Plus Advanced Server on target production server"
                   •  Import migrated database from testing server"
                   •  Setup of xDB Replication Server "
                            –  Snapshot process will migrate production Oracle data !
                            –  Deltas are captured by xDB triggers!
                            –  Once snapshot is done, synchronization is performed!


© 2011 EnterpriseDB. All rights reserved.                      46
Summary"
          u     Migrations are no longer impossible
          u     Compatibility provides
                   •  Lower cost of migrations"
                   •  Shorter migration timelines"
                   •  Lower risk (you can always go back)"
          u     EnterpriseDB provides
                   •  Oracle compatibility"
                   •  Automated tools to migrate from Oracle"
                            –  And others: MySQL, Sybase, SQL Server (data & schema)!
                   •  Migration Expertise for:"
                            –    Planning!
                            –    Performing migration!
                            –    Testing !
                            –    Rollout!
                            !



                            !
                            !
© 2011 EnterpriseDB. All rights reserved.                   47
EnterpriseDB Resources"
                "
        u    EnterpriseDB on-demand training
                •  http://www.enterprisedb.com/store/products/dba-training "


        u    Resources & Community
                •  Whitepapers, datasheets, podcasts, videos, community!
                •  http://www.enterprisedb.com/resources-community "


        u    Questions about Postgres products, support and services
                •  sales@enterprisedb.com or info@enterprisedb.com "


        u    Follow us on Twitter, Facebook & LinkedIn for daily updates
                •  Twitter: @EnterpriseDB "
                •  Facebook: https://www.facebook.com/EnterpriseDB"
                •  LinkedIn: EnterpriseDB: The Enterprise Postgres Company "
                "


@2013 EnterpriseDB. All Rights Reserved.

Avoiding.the.pitfallsof.oracle.migration.2013

  • 1.
    Road to Freedom:
 Avoiding the Pitfalls 
 of
 Oracle Migration Projects " Presented by " Craig Silveira" Director, WW Sales Engineering" EnterpriseDB Corporation" info@enterprisedb.com " EnterpriseDB, Postgres Plus and Dynatune are trademarks of EnterpriseDB Corporation. Other names may be trademarks of their 1 respective owners. © 2010. All rights reserved.
  • 2.
    Common Pitfalls ofOracle Migration" 1.  Inadequate or inaccurate migration assessment 2.  Incomplete migration plan 3.  Lack of migration expertise to handle unforeseen problems 4.  Lack of available time & trained resources © 2013 EnterpriseDB. Privileged and Confidential. All rights reserved. 2
  • 3.
    Who is EnterpriseDB?" EnterpriseDB,Postgres Plus and Dynatune are trademarks of EnterpriseDB Corporation. Other names may be trademarks of their 3 respective owners. © 2010. All rights reserved.
  • 4.
    u  We enable the benefits of Postgres along with the commercial dependability, resources and support needed for enterprise-class applications" u  Because we are a database product development company, we also offer:" u  Full product roadmap strategy! u  Indemnification ! u  Deep Postgres engineering talent & resources! u  We are a major supporter of the PostgreSQL community" u  We provide a wide array of Postgres products, services, training and support to meet all your Postgres needs! © 2013 EnterpriseDB. Privileged and Confidential. 4 " © 2013 EnterpriseDB. All rights reserved. All rights reserved.
  • 5.
    5 © 2013 EnterpriseDB.All rights reserved. 5
  • 6.
    Common Pitfalls ofOracle Migration" 1.  Inadequate or inaccurate migration assessment 2.  Incomplete migration plan 3.  Lack of migration expertise to handle unforeseen problems 4.  Lack of available time & trained resources © 2013 EnterpriseDB. Privileged and Confidential. All rights reserved. 6
  • 7.
    Assessment Factors toConsider u  Technical: •  Compatibility •  Feature sets u  Human: •  Training •  Change management u  Operational: •  Testing •  Monitoring •  Management •  Back-up •  Replication •  Security 7 © 2013 EnterpriseDB. All rights reserved.
  • 8.
    Oracle Migration Assessment" 1 Analyze Oracle Schema Layout: Static Analysis of Oracle Schema and database layout 2 Review features used in Oracle client application: Static Analysis of Source Code Developer Interviews © 2013 EnterpriseDB. All rights reserved. 8
  • 9.
    Oracle Migration Assessment" 3 Evaluate results along 5 axis using proven algorithms: 4 Migration report developed: u  Score of 1 – 10 assigned based on analysis of steps 1 and 2 –  1 difficult – 10 minimal effort! u  Work arounds for identified missing features u  Time estimates given in man weeks © 2013 EnterpriseDB. All rights reserved. 9
  • 10.
    What Does
 Oracle Compatibility
 Mean?" EnterpriseDB, Postgres Plus and Dynatune are trademarks of EnterpriseDB Corporation. Other names may be trademarks of their 10 respective owners. © 2010. All rights reserved.
  • 11.
    Oracle Compatibility ReducesRisk" u  Run applications written for Oracle virtually unchanged u  No need to re-train Oracle DBAs and developers u  Support for PL/SQL language and OCI interoperability u  Replication for easy sharing of data © 2013 EnterpriseDB. All rights reserved. 11
  • 12.
    What Is PostgresPlus Advanced Server?" u  Built on the world’s most advanced database—PostgreSQL u  9th generation Oracle compatibility u  World-class security add-ons u  Performance that rivals any other proprietary RDBMS u  Enterprise-class developer and DBA tools PostgreSQL u  Installation, performance tuning, and maintenance services u  Software indemnification CONFIDENTIAL © 2012 EnterpriseDB. All rights reserved. 12
  • 13.
    Compatibility Means:" u  SQL extension support •  Decode, NVL, Substr, NVL2" •  Date/time functions: add_months, extract, next_day " u  PL/SQL support •  REF Cursors, Implicit and explicit cursors" •  Looping, variable declarations, conditional statements" •  Collections: Associative Arrays, Varrays, Nested tables" •  Bulk binding" •  Named parameters" •  User Defined Exceptions" •  Explicit Transaction Control" –  within a stored procedure! –  (not supported by PostgreSQL! u  Tools •  EDB*Plus – SQL*Plus look-a-like" •  EDB*Loader – SQL*Loader equivalent" •  EDB*Wrap – similar to the PL/SQL wrapper" © 2011 EnterpriseDB. All rights reserved.
  • 14.
    Compatibility means: (cont.)" u  Features •  Packages" •  Stored procedures" •  Functions" •  Triggers" •  Hints" •  Database Links" •  Hierarchical Queries" •  Synonyms – Public and Private" •  Sequences" •  Rownum" •  Object types " –  Create type … as object! –  Create type … as table! –  Create type …as varray! –  Constructor and collection methods! •  Users/Roles" •  Dynamic SQL" "
  • 15.
    Compatibility (cont.)" u  Data Types •  Integer, number, char, double precision, float, varchar2, blob, clob, xmltype, rowid" u  Built-in Packages •  DBMS_:" –  SQL, LOB, JOB, PIPE, ALERT, OUTPUT, UTILITY, PROFILER! •  UTL_:" –  FILE, MAIL, SMTP, ENCODE, TCP! u  Oracle-like Data Dictionary •  ALL_, DBA_, USER_ views" •  Most commonly accessed views" u  Diagnostics - DRITA •  System and session waits" –  Not exposed in PostgreSQL ! –  Part of Advanced Server! •  Statspack-like reporting"
  • 16.
    Database Migration Toolkit "" u  Online Migration Toolkit enables point and click migration from Oracle u  Automatically Migrates: u  Data u  Sequences u  Schemas u  Packages u  Stored Procedures u  Views u  Triggers u  Database Links u  Functions u  Synonyms © 2011 EnterpriseDB. All rights reserved. 16
  • 17.
    Ease of Migration" ©2013 EnterpriseDB. All rights reserved. 17
  • 18.
    What Does
 This 
 Mean to You?" EnterpriseDB, Postgres Plus and Dynatune are trademarks of EnterpriseDB Corporation. Other names may be trademarks of their 18 respective owners. © 2010. All rights reserved.
  • 19.
    Oracle Compatibility &Migration Strategies" Strategy Benefits § Significant cost savings for non mission critical Develop/Deploy systems New LOB Applications § Leverages all existing Oracle skills § Very low risk § Significant cost savings Deploy Postgres Plus § Leverages Postgres Plus Replication Server as Oracle § Leverages all existing Oracle skills Replication Server § Improves transaction and query performance Migrate non Mission § Significant cost savings Critical Oracle Apps to § Leverages all existing Oracle skills Postgres Plus § Very low risk Migrate Mission Critical § Biggest cost savings Oracle Apps to § Leverages all existing Oracle skills Postgres Plus § Greatest deployment flexibility © 2009 EnterpriseDB Corporation
  • 20.
    Applications built onPostgreSQL" © 2013 EnterpriseDB. All rights reserved. 20
  • 21.
    Migration Example" © 2011EnterpriseDB. All rights reserved. 21
  • 22.
    Common Pitfalls ofOracle Migration" 1.  Inadequate or inaccurate migration assessment 2.  Incomplete migration plan 3.  Lack of migration expertise to handle unforeseen problems 4.  Lack of available time & trained resources © 2013 EnterpriseDB. Privileged and Confidential. All rights reserved. 22
  • 23.
    Migration Methodology" EnterpriseDB, PostgresPlus and Dynatune are trademarks of EnterpriseDB Corporation. Other names may be trademarks of their 23 respective owners. © 2010. All rights reserved.
  • 24.
    Multi-phase Migration Process" u  Phase I – Planning •  Determine what application to migrate" –  Home grown applications! –  Java, C! –  Packaged applications that support multiple databases! –  Support JDBC, ODBC" •  Once candidate applications are chosen, sign up for OMA" •  Oracle Migration Assessment (OMA) Identifies:" –  Possible migration issues! –  Gives time estimate to migrate system" •  Establish migration team:" –  Need source system knowledgeable resource! –  Need target system knowledgeable resource" •  Establish project plan with milestones" © 2011 EnterpriseDB. All rights reserved.
  • 25.
    Multi-phase Migration Process" u  Phase II – Prepare Environment •  Obtain and install necessary software" •  Establish connectivity between systems" –  Copy the Oracle JDBC jar file to jre/lib/ext directory in Postgres Plus Advanced Server Installation! u  Phase III – Migrate Schema •  Use Migration Toolkit in schema only mode" •  Resolve issues here before going to next phase" u  Phase IV – Migrate Data •  Use Parallel streams in Migration Studio" •  OR Use command line MTK" –  Use –copyViaDBLinkOra! –  Uses OCI to connect to Oracle! •  Use dblink_ora_copy function directly to bypass logging" •  Export Oracle data to flat files, load using EDB*Loader" © 2011 EnterpriseDB. All rights reserved. 25
  • 26.
    Multi-phase Migration Process" u  Phase V – Port Application •  Change connection information" •  Recompile /Link application (OCI or Pro*C)" u  Phase VI – Test •  Verify application functionality" •  Address issues" •  Test performance " •  Tune" u  Phase VII Integration •  Establish co-existence strategy" •  Setup database links to other databases" •  Setup replication between Oracle or SQL Server and Postgres Plus Advanced Server " u  Phase VIII – Rollout •  System becomes production " © 2011 EnterpriseDB. All rights reserved. 26
  • 27.
    How to Migrate:
 A Step by Step Guide" EnterpriseDB, Postgres Plus and Dynatune are trademarks of EnterpriseDB Corporation. Other names may be trademarks of their 27 respective owners. © 2010. All rights reserved.
  • 28.
    Phase I OracleMigration Assessment" u  *** Checking for Migration Issues *** u  Object Type Type Count u  ---------------------------------------------------------------------------------- u  TRIGGER Count 0 u  SOURCE Package 0 u  SOURCE Syntax - Exception 0 u  SOURCE Function 789 u  SOURCE Syntax - Object 0 u  SOURCE Syntax - Other 792 u  SOURCE Syntax - Hints 282 u  SOURCE Syntax - Exp Trans Ctl 730 u  SOURCE Total Count 2623 u  COLLECTION Count 1 u  VARRAY Count 0 u  DIMENSION Count 0 u  JOB Count 0 u  MATERIALIZED VIEW Count 0 u  RESOURCE MGR Count 0 u  POLICY Count 9 u  PROFILE Count 6 u  SUMMARY Possible Migration Issues 2775 © 2011 EnterpriseDB. All rights reserved. 28
  • 29.
    Phase II SetupEnvironment" u  Establish connectivity •  Copy Oracle JDBC jar file to Postgres Plus Advanced Server install" cp /usr/lib/oracle/xe/app/oracle/product/10.2.0/server/jdbc/lib/ojdbc14.jar /opt/ PostgresPlus/9.0AS/jre/lib/ext" " •  Edit the toolkit.properties file to contain Oracle and Postgres Plus Advanced Server connection information:" SRC_DB_URL=jdbc:oracle:thin:@localhost:1521:xe" SRC_DB_USER=system" SRC_DB_PASSWORD=mgr" " TARGET_DB_URL=jdbc:edb://localhost:5999/demo" TARGET_DB_USER=demo" TARGET_DB_PASSWORD=mgr" " © 2011 EnterpriseDB. All rights reserved. 29
  • 30.
    Phase III MigrateSchema" u  Use MTK in schema only mode: [enterprisedb@localhost bin]$ ./runMTK.sh -schemaOnly hr Source database connectivity info... conn =jdbc:oracle:thin:@localhost:1521:xe user =system password=****** Target database connectivity info... conn =jdbc:edb://localhost:5999/demo user =demo password=****** Connecting with source Oracle database server... Connecting with target EnterpriseDB database server... Importing redwood schema hr... Creating Schema...hr Creating Object Type: NUMLIST Creating Sequence: EMPLOYEES_SEQ Creating Tables... Creating Table: EMPLOYEES © 2011 EnterpriseDB. All rights reserved. 30
  • 31.
    Phase III MigrateSchema con’t" ******************** Migration Summary ******************** Object Types: 9 out of 9 Sequences: 3 out of 3 Tables: 49 out of 53 Constraints: 39 out of 40 Procedures: 7 out of 7 Functions: 3 out of 3 Packages: 3 out of 3 Total objects: 139 Successful count: 134 Failure count: 5 List of failed objects ====================== Tables -------------------- 1. HR.BFTEST 2. HR.TESTBD 3. HR.TESTBF 4. HR.TESTCNTXT © 2011 EnterpriseDB. All rights reserved. 31
  • 32.
    Phase III MigrateSchema con’t" u  Migration logs stored in user’s home directory : /home/enterprisedb/.enterprisedb/migration-toolkit/logs" u  Resolve issues: Error Creating Table TESTCNTXT:ERROR: function sys_context(unknown, unknown) does not exist Hint: No function matches the given name and argument types. You might need to add explicit type casts. CAUSE: this table used SYS_CONTEXT(‘USERENV’,’CURRENT_USER’) as a DEFAULT value RESOLUTION: use CURRENT_USER function instead © 2011 EnterpriseDB. All rights reserved. 32
  • 33.
    Phase IV MigrateData" u  Use MTK in data only mode: [enterprisedb@localhost bin]$ ./runMTK.sh -dataOnly hr Source database connectivity info... conn =jdbc:oracle:thin:@localhost:1521:xe user =system password=****** Target database connectivity info... conn =jdbc:edb://localhost:5999/demo user =demo password=****** Connecting with source Oracle database server... Connecting with target EnterpriseDB database server... Importing redwood schema hr... Loading Table Data in 8 MB batches... Loading Table: AGES ... [AGES] Migrated 1 rows. [AGES] Table Data Load Summary: Total Time(s): 0.467 Total Rows: 1 Loading Table: DEPARTMENTS ... © 2011 EnterpriseDB. All rights reserved. 33
  • 34.
    Phase V Portthe Application" §  Change Application Connection method §  Java application = §  Old connection syntax: Class.forName("oracle.jdbc.driver.OracleDriver"); Connection con = DriverManager.getConnection("jdbc:oracle:thin:@localhost: 1521:xe”,”scott”,”tiger”); § New connection syntax: Class.forName("com.edb.Driver"); Connection con = DriverManager.getConnection("jdbc:edb://localhost: 5444/edb", "enterprisedb","enterprisedb"); © 2011 EnterpriseDB. All rights reserved.
  • 35.
    Common Pitfalls ofOracle Migration" 1.  Inadequate or inaccurate migration assessment 2.  Incomplete migration plan 3.  Lack of migration expertise to handle unforeseen problems 4.  Lack of available time & trained resources © 2013 EnterpriseDB. Privileged and Confidential. All rights reserved. 35
  • 36.
    Handling Issues" EnterpriseDB, PostgresPlus and Dynatune are trademarks of EnterpriseDB Corporation. Other names may be trademarks of their 36 respective owners. © 2010. All rights reserved.
  • 37.
    Handling Issues" u  Not all migrations are error free •  Migration log will contain all errors" u  Some common issues: •  Column delimiter chosen is in column data" –  Causes ‘Extra data found’ error! –  Resolve by using different delimiter! u  Oracle built-in package does not exist •  DBMS_AQ – we use solutions like ActiveMQ, MQSeries or Tibco" –  Or own code. Enqueue and dequeue procedures are fairly easy to code! –  xDB Replication Server can also be used since based on pub/sub architecture! –  DBMS_RANDOM – use random function instead! –  DBMS_LOCK.sleep – use pg_sleep function instead! u  Oracle feature not supported •  MERGE command not supported" –  Can be rewritten to use INSERT and UPDATE with checks! •  Index Organized Tables" –  Cluster a table using CLUSTER! command for same read performance gain! © 2011 EnterpriseDB. All rights reserved. 37
  • 38.
    Handling Issues (continued)" u  Database Links •  Migrated over by tool but password is invalid" –  This is because Oracle hides the password! –  Resolve by dropping and recreating! –  Or by specifying a password to use when running the MTK! –  runMTK -allDBLinks LINK_NAME1=abc,LINK_NAME2=xyz HR u  Data Movement – performance •  Migration toolkit connects via jdbc" •  Large datasets are slow to move" •  Use database link functionality instead" –  Dblink_ora_copy – EnterpriseDB method to copy data from Oracle over OCI! –  Much faster! •  OR extract data from Oracle to csv files, the load using edbldr" " " © 2011 EnterpriseDB. All rights reserved.
  • 39.
    Tuning Recommendations" u  Use DynaTune •  Dynamically adjusts database configuration based on available resources" •  Set via edb_dynatune parameter" –  Values 0 – 100 corresponding to % of machines to use! u  Remember to analyze database •  Use Analyze command" u  Oracle Hints supported •  No need to remove from embedded SQL" © 2011 EnterpriseDB. All rights reserved. 39
  • 40.
    Common Pitfalls ofOracle Migration" 1.  Inadequate or inaccurate migration assessment 2.  Incomplete migration plan 3.  Lack of migration expertise to handle unforeseen problems 4.  Lack of available time & trained resources © 2013 EnterpriseDB. Privileged and Confidential. All rights reserved. 40
  • 41.
    How EnterpriseDB CanHelp" EnterpriseDB, Postgres Plus and Dynatune are trademarks of EnterpriseDB Corporation. Other names may be trademarks of their 41 respective owners. © 2010. All rights reserved.
  • 42.
    EnterpriseDB Resources &Assistance" RESOURCES EFFORT/ ROI TIME INVESTIGATION VALIDATION MIGRATION/ PRODUCTION DEVELOPMENT •  Best-Practices? •  Support? •  PGSQL capabilities? •  Performance? •  Risk mitigation? •  Staff augmentation? •  Feature mapping? Customer •  Compatibility? •  Migration •  Training? •  TCO/ROI? Challenges •  Security? assistance? •  Replication? •  EDB capabilities? •  Cost? •  Tech resources? •  Monitoring? •  Product Road-map? •  DBA Skills? •  Indemnification? •  Opportunity Analysis •  Migration •  Product Support •  Enterprise Workshop Assessment Test •  Remote DBA Enablement EnterpriseDB •  Architectural health check •  Performance •  Training •  Oracle Resources •  White papers benchmarking •  Enterprise Manager compatibility •  Analyst reports •  References •  xDB Single/Multi- •  Migration planning •  Webinars •  Case Studies master replication © 2013 EnterpriseDB. All rights reserved. 42
  • 43.
    Enterprise Enablement Services" Goals •  Reduce time to value •  Reduce risk •  Contain cost •  Enable self-sufficiency Knowledge •  Ensure success Transfer On-demand Training Access to Experts Configuration Best Practices Architecture Remote DBA Best Practices Services Developer Support & Break Fix © 2013 EnterpriseDB. All rights reserved. 43
  • 44.
    Oracle Migration Assessment" u  Paid for service from EnterpriseDB u  What is it? •  Pre-analysis interview" •  Analysis of Oracle schemas to be migrated" •  Finds possible migration issues" –  Unsupported Features! –  Unsupported Syntax! –  Implementation Differences! •  Findings documented with possible workarounds in final report" •  Post analysis discussions to review findings" u  Migration feasibility score assigned (1 – 10) http:www.enterprisedb.com/solutions/oramig.do © 2011 EnterpriseDB. All rights reserved. 44
  • 45.
    Oracle Migration FactoryCore Services" u  Customer provides data-less Oracle export of database u  Migrate the database(s) to Postgres Plus Advanced Server •  Resolve any issues" •  Implement workarounds for missing or different functionality" •  Perform sanity checking of unit functionality" –  Requires input/output from customer on same units in Oracle! u  Document the changes/workarounds u  Educate Customer on changes/workarounds •  Advise on application level changes needed" u  Return migrated databases to Customer •  Via pg_dump" u  Customer can customize with add on options © 2011 EnterpriseDB. All rights reserved. 45
  • 46.
    Oracle Migration FactoryAdd-ons" u  Setup and Migrate test system •  Installation of Postgres Plus Advanced Server on Customer server" •  Import of migrated database to Postgres Plus Advanced Server "" •  Migration of test data from a test Oracle system" u  Application Functional Testing •  Provide assistance in connecting application to database" •  Provide assistance in functional testing of application" •  Resolve functional testing issues" u  Performance Tuning of Migrated System u  Production Migration Setup •  Install Postgres Plus Advanced Server on target production server" •  Import migrated database from testing server" •  Setup of xDB Replication Server " –  Snapshot process will migrate production Oracle data ! –  Deltas are captured by xDB triggers! –  Once snapshot is done, synchronization is performed! © 2011 EnterpriseDB. All rights reserved. 46
  • 47.
    Summary" u  Migrations are no longer impossible u  Compatibility provides •  Lower cost of migrations" •  Shorter migration timelines" •  Lower risk (you can always go back)" u  EnterpriseDB provides •  Oracle compatibility" •  Automated tools to migrate from Oracle" –  And others: MySQL, Sybase, SQL Server (data & schema)! •  Migration Expertise for:" –  Planning! –  Performing migration! –  Testing ! –  Rollout! ! ! ! © 2011 EnterpriseDB. All rights reserved. 47
  • 48.
    EnterpriseDB Resources" " u  EnterpriseDB on-demand training •  http://www.enterprisedb.com/store/products/dba-training " u  Resources & Community •  Whitepapers, datasheets, podcasts, videos, community! •  http://www.enterprisedb.com/resources-community " u  Questions about Postgres products, support and services •  sales@enterprisedb.com or info@enterprisedb.com " u  Follow us on Twitter, Facebook & LinkedIn for daily updates •  Twitter: @EnterpriseDB " •  Facebook: https://www.facebook.com/EnterpriseDB" •  LinkedIn: EnterpriseDB: The Enterprise Postgres Company " " @2013 EnterpriseDB. All Rights Reserved.