A Practitioner's Guide to Successfully Migrate from Oracle ...

47
A PRACTITIONER'S GUIDE TO SUCCESSFULLY MIGRATE FROM SUCCESSFULLY MIGRATE FROM ORACLE TO SYBASE ASE – PART 1 PETER DOBLER PRESIDENT DOBLER CONSULTING SEPTEMBER 14 TH 2011

Transcript of A Practitioner's Guide to Successfully Migrate from Oracle ...

Page 1: A Practitioner's Guide to Successfully Migrate from Oracle ...

A PRACTITIONER'S GUIDE TO

SUCCESSFULLY MIGRATE FROM SUCCESSFULLY MIGRATE FROM

ORACLE TO SYBASE ASE – PART 1

PETER DOBLER

PRESIDENT DOBLER CONSULTING

SEPTEMBER 14TH 2011

Page 2: A Practitioner's Guide to Successfully Migrate from Oracle ...

ABOUT PETER DOBLER

• Peter Dobler is an accomplished IT database professional, with 25+ years of experience, who

delivers results by building sophisticated data systems; by implementing advanced application

software; and, by improving efficiencies and reducing costs. He founded Dobler Consulting,

(www.doblerconsulting.com) a Tampa, Florida consulting firm that delivers implementation

expertise for Sybase, Oracle and MS SQL Server in 2000. Dobler Consulting is a Sybase System

Integration partner and a premier partner for Sybase Professional Services. Peter designed and

deployed large scale, high performance, enterprise level DW systems exceeding 40 TB and

2 – October 18, 2011

deployed large scale, high performance, enterprise level DW systems exceeding 40 TB and

managed large IT groups of DBAs, System Engineers, Storage Engineering, and Security experts.

He is a nationally recognized premier Sybase expert who frequently gets invited to speak at

Sybase events. He can be reached at: mailto:[email protected] or 813-322-3240.

• Read Peter’s Database Technology Trends Blog (Behind the Scenes of Database Evolution) at:

http://www.peterdobler.com, and his Technology Tips Blog (Step-by- step Instructions on

Today's Challenging Technology) at http://www.techtipsntrick.com.

Page 3: A Practitioner's Guide to Successfully Migrate from Oracle ...

ABOUT THIS PRESENTATION

• This session is part 1 of a 2 part session

– Overview of the migration process

– 7 step migration process walkthrough

3 – October 18, 2011

– 7 step migration process walkthrough

– Migration path

• Session 2 will cover the deep dive into the technical aspects.

– Portability Check

– Technical Challenges

– Sample Code and Workarounds

Page 4: A Practitioner's Guide to Successfully Migrate from Oracle ...

OVERVIEW

4 – October 18, 2011

Page 5: A Practitioner's Guide to Successfully Migrate from Oracle ...

MIGRATION MYTHS

Typical database migration myths are:

• Boardroom decision based on personal preferences ->

financials

• Too complex -> more work -> financials

5 – October 18, 2011

• Too complex -> more work -> financials

• No good reason for migration -> resistance -> more work ->

financials

• Vendor A is better than vendor B -> financials

• Bottom-Line: Migration decisions are made by executives, not

technologists

Page 6: A Practitioner's Guide to Successfully Migrate from Oracle ...

MIGRATION SCOPE DEFINITION

It is necessary to understand the underlying differences between

Oracle and Sybase ASE. This knowledge will guide you through

the migration process and is the foundation for a successful

migration.

6 – October 18, 2011

migration.

One important fact about comparing Oracle with Sybase ASE is to

understand which part of Oracle will be compared with which

Sybase product. Unlike Oracle, which integrates all its technology

into one system, Sybase opted to separate these tasks with

unique and specialized products that communicate well with

each other.

Page 7: A Practitioner's Guide to Successfully Migrate from Oracle ...

ORACLE AND SYBASE COMPARED

Oracle Sybase

Oracle Database Server Sybase ASE

Oracle OLAP and DW Sybase IQ

Oracle Analytics Sybase IQ

7 – October 18, 2011

Oracle Analytics Sybase IQ

Oracle RAC Sybase ASE Cluster Edition

Oracle Times Ten Sybase ASE 15.5 In-Memory Database

Oracle Data GuardSybase Mirror Activator / Sybase Replication

Server

Oracle Streams / Golden Gate Sybase Replication Server

Page 8: A Practitioner's Guide to Successfully Migrate from Oracle ...

MIGRATION CHECKLIST

An Oracle to Sybase migration project should be divided into

individual sub-tasks.

1. Planning the migration

2. Designing architecture migration

8 – October 18, 2011

3. Implementing schema migration

4. Implementing data migration

5. Implementing application migration

6. Implementing operation migration

7. Validating the migration

Page 9: A Practitioner's Guide to Successfully Migrate from Oracle ...

PLANNING THE MIGRATION

9 – October 18, 2011

Page 10: A Practitioner's Guide to Successfully Migrate from Oracle ...

PLANNING THE MIGRATION

An Oracle to Sybase migration project will contain the same project management components as any other project.

• Milestones

10 – October 18, 2011

• WBS

• Resource allocations

The key to a successful migration is identifying possible show-stoppers before the project starts.

Page 11: A Practitioner's Guide to Successfully Migrate from Oracle ...

PLANNING THE MIGRATION

• Identify all the Oracle specific functionalities that are being used in the application(s).

• Have a migration solution or workaround for every Oracle component in place.

Identify Functionalities and Performing a Portability Check

11 – October 18, 2011

• Have a migration solution or workaround for every Oracle component in place.

• Perform a portability check on the entire environment and all applications. (Session 2 will provide a deep dive)

Page 12: A Practitioner's Guide to Successfully Migrate from Oracle ...

PLANNING THE MIGRATION

• Identify Oracle to Sybase migration incompatibilities.For example:

• Object tables (Sybase supports Java object columns)

Identifying Incompatibilities

12 – October 18, 2011

• Object tables (Sybase supports Java object columns)

• Pseudo Columns (ROWNUM, Flashback columns)

• SQL Syntax (SQL extensions for OLAP, ORACLE SQL Syntax)

• SQL*Plus

Page 13: A Practitioner's Guide to Successfully Migrate from Oracle ...

PLANNING THE MIGRATION

• If incompatibilities have been identified, plan for additional time to rewrite the application.

• The main goal of the planning stage is to identify possible major code rewrites that increase the cost of the migration

Identifying Possible Show Stoppers

13 – October 18, 2011

• The main goal of the planning stage is to identify possible major code rewrites that increase the cost of the migration itself.

• Can lead to deferring the migration project until major

application re-design is due.

• Can stop the project all-together.

Page 14: A Practitioner's Guide to Successfully Migrate from Oracle ...

DESIGNING ARCHITECTURE

MIGRATION

14 – October 18, 2011

MIGRATION

Page 15: A Practitioner's Guide to Successfully Migrate from Oracle ...

DESIGNING ARCHITECTURE MIGRATION

The architecture migration basically includes:

• Database definition and creation

• Sizing

15 – October 18, 2011

• Security

• Options

• Mapping of Oracle database elements to the Sybase ASE

counterparts.

Page 16: A Practitioner's Guide to Successfully Migrate from Oracle ...

DESIGNING ARCHITECTURE MIGRATION

• Major architecture differences between Oracle and Sybase are:

• Concurrency and Multi-Versioning

Major Differences Between Oracle and Sybase

16 – October 18, 2011

• Concurrency and Multi-Versioning

• Multi-Process vs. Multi-Thread Architecture

• Instance and Database vs. dataserver and databases

• Transaction Processing

• ANSI SQL vs. T-SQL

Page 17: A Practitioner's Guide to Successfully Migrate from Oracle ...

DESIGNING ARCHITECTURE MIGRATION

• Concurrency and Multi-Versioning

• The default transaction isolation level for both Oracle and

Sybase ASE is isolation level 1 / Read Committed.

• To mimic ANSI transaction handling and Oracle read

Be Aware

17 – October 18, 2011

• To mimic ANSI transaction handling and Oracle read

versioning with the least code re-write, you can use set

chained on and isolation level 3.

• This creates a bad situation for Sybase ASE. Isolation

level 3 in Sybase ASE creates a holdlock for every query,

and that creates a cascading blocking effect.

Page 18: A Practitioner's Guide to Successfully Migrate from Oracle ...

IMPLEMENTING SCHEMA

MIGRATION

18 – October 18, 2011

MIGRATION

Page 19: A Practitioner's Guide to Successfully Migrate from Oracle ...

IMPLEMENTING SCHEMA MIGRATION

In Oracle, a schema is equivalent to a user login. A schema always has a login, whereas a user login may or may not have a schema.

An Oracle schema typically translates directly into a Sybase ASE user database. Pay close attention to synonym definitions, as

19 – October 18, 2011

user database. Pay close attention to synonym definitions, as they can spawn additional requirements in the schema migration.

It is very important to completely understand the security and user permission requirements on every schema. The security dependencies will guide the Sybase ASE user database design.

Page 20: A Practitioner's Guide to Successfully Migrate from Oracle ...

IMPLEMENTING SCHEMA MIGRATION

• The main focus on a schema migration is on data type conversions. For most Oracle data types, there is a Sybase ASE equivalent, with some minor exceptions:

Data Types Limits

20 – October 18, 2011

• CLOB and BLOB exceed the Sybase ASE max. allocation for

TEXT and IMAGE

• CHAR, VARCHAR2 and RAW exceed Sybase ASE maximum

in a 2k page configuration.

• VARCHAR2 exceeds Sybase ASE maximum in a 4k page

configuration.

Page 21: A Practitioner's Guide to Successfully Migrate from Oracle ...

IMPLEMENTING SCHEMA MIGRATION

• Reverse engineering of all schemas

• Always use the data dictionary stored in the production

database.

High-level Tasks

21 – October 18, 2011

database.

• Use PowerDesigner to reverse engineer schemas and

convert data types

• Plan the object placement

• Create the new index strategy

• Migrate schema security and rules

Page 22: A Practitioner's Guide to Successfully Migrate from Oracle ...

IMPLEMENTING DATA

MIGRATION

22 – October 18, 2011

MIGRATION

Page 23: A Practitioner's Guide to Successfully Migrate from Oracle ...

IMPLEMENTING DATA MIGRATION

The data migration task can be broken up into the following three subtasks:

1. Planning: It is important to understand the various options available for

migrating the data, particularly the advantages and limitations of each of

the options. This subtask involves evaluating the characteristics of the

23 – October 18, 2011

the options. This subtask involves evaluating the characteristics of the

source data, and evaluating environmental and business constraints.

2. Execution: This subtask involves transferring the data using the Sybase

data migration tool, migrating the Oracle database objects to Sybase

database objects.

3. Validation: This subtask accounts for all the data validation and verifies

data integrity.

Page 24: A Practitioner's Guide to Successfully Migrate from Oracle ...

IMPLEMENTING DATA MIGRATION

• The method of data migration is largely dependent on the size of the database, and down time granted for the data transfer.

• Low volume and/or long down times allow for flat file exports and bcp imports.

Planning

24 – October 18, 2011

• Low volume and/or long down times allow for flat file exports and bcp imports.

• High volume systems and/or short downtime requirements should use Sybase Replication Server for the data movement.

Page 25: A Practitioner's Guide to Successfully Migrate from Oracle ...

IMPLEMENTING DATA MIGRATION

• Oracle does not provide a tool for flat file export. Custom stored procedures need to be created or a 3rd party tool like FACT has to be used.

Enterprise Connect Data Access (ECDA) allows for data transfer

Execution

25 – October 18, 2011

• Enterprise Connect Data Access (ECDA) allows for data transfer via proxy tables and by-passes flat files.

• Sybase Replication Server allows for up to last minute transaction synchronization with the shortest down time.

Page 26: A Practitioner's Guide to Successfully Migrate from Oracle ...

IMPLEMENTING DATA MIGRATION

• Alternatively Oracle tools, Oracle Streams or Golden Gate, for example, can be used for the data transfer as well.

Execution

26 – October 18, 2011

• For large datasets it is highly recommended to use some form of data replication. But only Sybase Replication Server provides the Data Assurance option that allows the validation of source and target data. This will eliminate the need to write custom code to compare source and target database.

Page 27: A Practitioner's Guide to Successfully Migrate from Oracle ...

IMPLEMENTING DATA MIGRATION

• Before allowing access to a production system after a migration, careful data validation steps have to be implemented.

Create custom scripts to compare the source database with

Validation

27 – October 18, 2011

• Create custom scripts to compare the source database with the target database.

• Or, utilize the Sybase Replication Server Data Assurance

feature.

Page 28: A Practitioner's Guide to Successfully Migrate from Oracle ...

IMPLEMENTING DATA MIGRATION

• Check the tuning of the database and memory usage settings applied

• Check for sufficient disk space for the expected size of the database 12

months ahead.

With Full Data Load, Check for Bottlenecks and Prepare System

28 – October 18, 2011

• Check for sufficient size of the tempdb database for handling temporary

working storage, sort activity and for temporary user tables.

• Check for sufficient size of transaction log of the user database created.

• Prepare database monitoring activities

• Document database and server configuration settings

Page 29: A Practitioner's Guide to Successfully Migrate from Oracle ...

IMPLEMENTING APPLICATION

MIGRATION

29 – October 18, 2011

MIGRATION

Page 30: A Practitioner's Guide to Successfully Migrate from Oracle ...

IMPLEMENTING APPLICATION MIGRATION

The application migration task is by far the largest and time consuming part of the entire migration project. The task can be divided into several application parts:

• Embedded SQL application

30 – October 18, 2011

• Embedded SQL application

• C or COBOL pre-compilers are doing 99% of the migration.

Only the SQL has to be checked for compatibility.

• ODBC client application

• The connection string changes, and possible stored

procedure calls are changing too.

Page 31: A Practitioner's Guide to Successfully Migrate from Oracle ...

IMPLEMENTING APPLICATION MIGRATION

• JDBC client application

• Connection string changes

• Database-specific library application

• Most difficult to migrate. Changing SQL*NET based API calls to CT-lib

Continued…

31 – October 18, 2011

• Most difficult to migrate. Changing SQL*NET based API calls to CT-lib

based API calls.

• C Applications

• Migrate OCI calls to CT-lib calls.

• Oracle forms

• Migrate to PowerBuilder Apps

Page 32: A Practitioner's Guide to Successfully Migrate from Oracle ...

IMPLEMENTING APPLICATION MIGRATION

In addition to the application layer migration, stored procedures, functions and triggers have to be migrated as well.

There are major differences between Oracle’s PL/SQL and Sybase T-SQL implementation that have to be accounted for.

Stored Procedures, Functions and Triggers

32 – October 18, 2011

There are major differences between Oracle’s PL/SQL and Sybase T-SQL implementation that have to be accounted for.

The most overlooked difference between PL/SQL and T-SQL is that PL/SQL checks each SQL statement for errors before proceeding to the next statement. T-SQL proceeds regardless of errors. This creates a lot of additional coding, which will be explained in Session 2.

Page 33: A Practitioner's Guide to Successfully Migrate from Oracle ...

IMPLEMENTING APPLICATION MIGRATION

PL/SQL vs. T-SQL

• Stored Procedures

• Sybase T-SQL stored procedure can return an integer

Stored Procedures

33 – October 18, 2011

• Sybase T-SQL stored procedure can return an integer

value; PL/SQL cannot.

• PL/SQL contains pseudo data types like SYS_REFCURSOR,

RECORD or TABLE. Views and temp tables have to be

used in T-SQL to migrate these data types.

Page 34: A Practitioner's Guide to Successfully Migrate from Oracle ...

IMPLEMENTING APPLICATION MIGRATION

PL/SQL vs. T-SQL

• Functions

• Most system PL/SQL functions exist in similar fashion in

Functions

34 – October 18, 2011

• Most system PL/SQL functions exist in similar fashion in

Sybase, but many have a different syntax and require

rewriting of the SQL statements.

• Many user defined PL/SQL functions can be migrated to

T-SQL functions. PL/SQL functions that return an integer

value can be migrated to a T-SQL stored procedure.

Page 35: A Practitioner's Guide to Successfully Migrate from Oracle ...

IMPLEMENTING APPLICATION MIGRATION

PL/SQL vs. T-SQL

• Triggers

• Oracle maintains BEFORE and AFTER STATEMENT triggers,

as well as, BEFORE and AFTER ROW triggers.

Triggers

35 – October 18, 2011

as well as, BEFORE and AFTER ROW triggers.

• Sybase ASE has only one after trigger, but all the Oracle

trigger functionalities can be handled with the pseudo

tables deleted and inserted. Oracle BEFORE STATEMENT

triggers can be converted into rules or folded into the

trigger code itself.

Page 36: A Practitioner's Guide to Successfully Migrate from Oracle ...

IMPLEMENTING APPLICATION MIGRATION

• Address the transaction processing method change from ANSI to T-SQL

• ANSI-SQL transactions start with either a insert, update or delete

statement. T-SQL uses a begin transaction command to mark a

transaction start.

• Convert savepoints into nested transactions.

High-level Summary

36 – October 18, 2011

• Convert savepoints into nested transactions.

• Recreate stored procedures, user defined functions and triggers

• Use of a 3rd party tool like SwisSQL is highly recommended

• Check all the SQL used in the application code for SQL language differences

• Check all the Java bases scripts for specific SQL

Page 37: A Practitioner's Guide to Successfully Migrate from Oracle ...

IMPLEMENTING APPLICATION MIGRATION

• Check for business objectives and requirements met

• Verify the feed from other systems under load to ensure that system

availability is unaffected at the time they run

High-level Summary

37 – October 18, 2011

• Check the security settings for the application set

• Check the required environment setting for the application

• Perform integration testing of the Application with third party system

• Determine the acceptable processing speed

Page 38: A Practitioner's Guide to Successfully Migrate from Oracle ...

IMPLEMENTING OPERATION

MIGRATION

38 – October 18, 2011

MIGRATION

Page 39: A Practitioner's Guide to Successfully Migrate from Oracle ...

IMPLEMENTING OPERATION MIGRATION

Every production application contains a series of operational procedures and tasks that keep the application data secure and performing at its best.

Examples of operational tasks are:

39 – October 18, 2011

Examples of operational tasks are:

• Backup and restore procedures

• Transaction log management

• Index maintenance tasks

• Data replication

Page 40: A Practitioner's Guide to Successfully Migrate from Oracle ...

VALIDATING THE MIGRATION

40 – October 18, 2011

Page 41: A Practitioner's Guide to Successfully Migrate from Oracle ...

VALIDATING THE MIGRATION

Before opening the newly migrated application(s) to production use, a thorough migration validation has to be preformed.

• Check for any system bottlenecks

• Count the number of objects in both the databases – Oracle

41 – October 18, 2011

• Count the number of objects in both the databases – Oracle and Sybase ASE

• Count the number of rows of each table in both databases

• Run the application under real world user load to simulate potential blocking contentions that could create a performance issue with transactions.

Page 42: A Practitioner's Guide to Successfully Migrate from Oracle ...

CONCLUSION

42 – October 18, 2011

Page 43: A Practitioner's Guide to Successfully Migrate from Oracle ...

MIGRATION PATH

Full Migration 3rd Party Software / ERP Migration

Planning the migration Planning the migration

Designing architecture migration

Implementing schema migration

43 – October 18, 2011

Implementing schema migration

Implementing data migration Implementing data migration

Implementing application migration

Implementing operation migration Implementing operation migration

Validating the migration Validating the migration

Page 44: A Practitioner's Guide to Successfully Migrate from Oracle ...

SESSION SUMMARY

• You cannot control the why, but you have full control over the how.

• Find issues and show stoppers before you begin the migration project. This saves time, money and frustration.

• Create a matrix with all the matching functionalities that can be migrated via a search and replace method.

44 – October 18, 2011

be migrated via a search and replace method.

• Detect performance and blocking issues before going live.

• Utilize all the tool help you can get.

• Test, test and test some more.

Page 45: A Practitioner's Guide to Successfully Migrate from Oracle ...

SESSION 2 HIGHLIGHTS

The next session addresses:

• Oracle And Sybase ASE Compared

• Portability Check With Workarounds

• SQL Language Differences With Sample Code

• Application Migration Examples

45 – October 18, 2011

• Application Migration Examples

• Data Migration Example

• Special Considerations

Page 46: A Practitioner's Guide to Successfully Migrate from Oracle ...

Q&A

Thank You.

Peter Dobler, Dobler Consulting

46 – October 18, 2011

Peter Dobler, Dobler [email protected]

Page 47: A Practitioner's Guide to Successfully Migrate from Oracle ...

Copyright

© Copyright 2011 SAP AG. All rights reserved.

No part of this publication may be reproduced or transmitted in any form or for any purpose without the express permission of SAP AG. The information contained herein may be changed without prior notice.

Some software products marketed by SAP AG and its distributors contain proprietary software components of other software vendors.

Microsoft, Windows, Excel, Outlook, and PowerPoint are registered trademarks of Microsoft Corporation.

IBM, DB2, DB2 Universal Database, System i, System i5, System p, System p5, System x, System z, System z10, System z9, z10, z9, iSeries, pSeries, xSeries, zSeries, eServer, z/VM, z/OS, i5/OS, S/390, OS/390, OS/400, AS/400, S/390 Parallel Enterprise Server, PowerVM, Power Architecture, POWER6+, POWER6, POWER5+, POWER5, POWER, OpenPower, PowerPC, BatchPipes, BladeCenter, System Storage, GPFS, HACMP, RETAIN, DB2 Connect, RACF, Redbooks, OS/2, Parallel Sysplex, MVS/ESA, AIX, Intelligent Miner, WebSphere, Netfinity, Tivoli and Informix are trademarks or registered trademarks of IBM Corporation.

Linux is the registered trademark of Linus Torvalds in the U.S. and other countries.

Adobe, the Adobe logo, Acrobat, PostScript, and Reader are either trademarks or registered trademarks of Adobe Systems Incorporated in the United States and/or other countries.

Oracle is a registered trademark of Oracle Corporation.

UNIX, X/Open, OSF/1, and Motif are registered trademarks of the Open Group.

Citrix, ICA, Program Neighborhood, MetaFrame, WinFrame, VideoFrame, and MultiWin are trademarks or registered trademarks of Citrix Systems, Inc.

HTML, XML, XHTML and W3C are trademarks or registered trademarks of W3C®, World Wide Web Consortium, Massachusetts Institute of Technology.

Java is a registered trademark of Sun Microsystems, Inc.

JavaScript is a registered trademark of Sun Microsystems, Inc., used under license for technology invented and implemented by Netscape.

SAP, R/3, SAP NetWeaver, Duet, PartnerEdge, ByDesign, SAP Business ByDesign, and other SAP products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of SAP AG in Germany and other countries.

Business Objects and the Business Objects logo, BusinessObjects, Crystal Reports, Crystal Decisions, Web Intelligence, Xcelsius, and other Business Objects products and services mentioned herein as well as their respective logos are trademarks or registered trademarks of Business Objects S.A. in the United States and in other countries. Business Objects is an SAP company.

All other product and service names mentioned are the trademarks of their respective companies. Data contained in this document serves informational purposes only. National product specifications may vary.

These materials are subject to change without notice. These materials are provided by SAP AG and its affiliated companies ("SAP Group") for informational purposes only, without representation or warranty of any kind, and SAP Group shall not be liable for errors or omissions with respect to the materials. The only warranties for SAP Group products and services are those that are set forth in the express warranty statements accompanying such products and services, if any. Nothing herein should be construed as constituting an additional warranty.