a practical guide to migrating from oracle to mysql · 2007-04-06 · encryption transparent, rc4,...

29
1 Copyright 2006 MySQL AB The World’s Most Popular Open Source Database A Practical Guide to Migrating from Oracle to MySQL Robin Schumacher Director of Product Management, MySQL AB

Upload: others

Post on 24-May-2020

7 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A Practical Guide to Migrating from Oracle to MySQL · 2007-04-06 · Encryption Transparent, RC4, DES, AES, etc. AES, DES, MD5 SHA1; 128/256 SSL Supported Yes Yes Group Management

1Copyright 2006 MySQL AB The World’s Most Popular Open Source Database

A Practical Guide to Migrating fromOracle to MySQL

Robin SchumacherDirector of Product Management, MySQL AB

Page 2: A Practical Guide to Migrating from Oracle to MySQL · 2007-04-06 · Encryption Transparent, RC4, DES, AES, etc. AES, DES, MD5 SHA1; 128/256 SSL Supported Yes Yes Group Management

2Copyright 2006 MySQL AB The World’s Most Popular Open Source Database

Agenda

• Quick look at MySQL AB• Relationship between Oracle and MySQL• Non-technical reasons why to migrate to MySQL from Oracle• Technical contrasts between Oracle and MySQL• MySQL engine, security, and datatype migration considerations• Migration path strategy • A brief look at the MySQL Migration Toolkit• Final migration considerations• Resources for jump starting migration efforts

Page 3: A Practical Guide to Migrating from Oracle to MySQL · 2007-04-06 · Encryption Transparent, RC4, DES, AES, etc. AES, DES, MD5 SHA1; 128/256 SSL Supported Yes Yes Group Management

3Copyright 2006 MySQL AB The World’s Most Popular Open Source Database

Overview of MySQL AB• Founded in 1995• Operations in 30 countries• 10 million product installations• 50,000 downloads each day• Over 5 million downloads of 5.0 to date• Dramatically reduces TCO of database management• Bundled by more than 100 SW and HW companies• Sold by partners such as HP, Dell, Novell, Unisys, and

others

Page 4: A Practical Guide to Migrating from Oracle to MySQL · 2007-04-06 · Encryption Transparent, RC4, DES, AES, etc. AES, DES, MD5 SHA1; 128/256 SSL Supported Yes Yes Group Management

4Copyright 2006 MySQL AB The World’s Most Popular Open Source Database

Chosen by Successful, Modern Companies

• Embedded– ”Batteries included” database in

software applications– Network elements

• High Volume Web Sites– Dynamic content– eCommerce– Gaming & entertainment– Scale Out

• Enterprise– Data Warehousing– High-Volume Transactions– Departmental– Intranet/Extranet– Scale Out

Page 5: A Practical Guide to Migrating from Oracle to MySQL · 2007-04-06 · Encryption Transparent, RC4, DES, AES, etc. AES, DES, MD5 SHA1; 128/256 SSL Supported Yes Yes Group Management

5Copyright 2006 MySQL AB The World’s Most Popular Open Source Database

Relationship Between MySQL and Oracle

• Innobase and Oracle valued partners of MySQL• Oracle announced as one of our “Partners of the

Year” at 2006 MySQL User’s Conference.• InnoDB one of MySQL’s Storage Engines• Business as usual

Page 6: A Practical Guide to Migrating from Oracle to MySQL · 2007-04-06 · Encryption Transparent, RC4, DES, AES, etc. AES, DES, MD5 SHA1; 128/256 SSL Supported Yes Yes Group Management

6Copyright 2006 MySQL AB The World’s Most Popular Open Source Database

Why Migrate to MySQL?Cost Savings

Example: 10 server, 2 dual-core CPUs, 3 years support

$770K = 93%$2,596K = 98%Savings with MySQL

$830K$2,656K$60KTotal

$330K$1,056K$60K3-years Maintenance and Support

$500K$1,600K$0License

MS SQL Server Enterprise

Oracle Enterprise

MySQL Network

3 year cost comparison

Page 7: A Practical Guide to Migrating from Oracle to MySQL · 2007-04-06 · Encryption Transparent, RC4, DES, AES, etc. AES, DES, MD5 SHA1; 128/256 SSL Supported Yes Yes Group Management

7Copyright 2006 MySQL AB The World’s Most Popular Open Source Database

Why Migrate to MySQL?High-Performance

New SpecAppServer Benchmarks (May 2006)

31%542.17Oracle 4-core (Best)BEA/HP/Itanium/RedHat

16%615.64Oracle 8-core (Best)BEA/Sun/SPARC/Solaris

-712.87MySQL 4-core (Best)SunJavaAppServer/Sun/Opteron/Solaris

Percent MySQL Better Than Oracle

JOPS(Java Ops Per Second)

Database Server / Configuration

MySQL 4 core beats Oracle 8 core…!

Page 8: A Practical Guide to Migrating from Oracle to MySQL · 2007-04-06 · Encryption Transparent, RC4, DES, AES, etc. AES, DES, MD5 SHA1; 128/256 SSL Supported Yes Yes Group Management

8Copyright 2006 MySQL AB The World’s Most Popular Open Source Database

Why Migrate to MySQL?High-Performance

Last eWeek Database Shoot-Out

MySQL v5 33% better than v4 in TM1 benchmark and up to 20% faster in DBT2 when stored procedures used.

Page 9: A Practical Guide to Migrating from Oracle to MySQL · 2007-04-06 · Encryption Transparent, RC4, DES, AES, etc. AES, DES, MD5 SHA1; 128/256 SSL Supported Yes Yes Group Management

9Copyright 2006 MySQL AB The World’s Most Popular Open Source Database

Why Migrate to MySQL?Strong Feature Set

Highly-Available Clustered Database

Cost-based Optimizer

Backup with Point-in-Time Recovery

Open Source

Terabyte Database Size Capable

Stored Procedures, Triggers, Functions, Cursors, Updateable Views

Replication

Robust datatype support (BLOB’s, varchar, datetime, numerics, etc.)

Advanced Indexing (Clustered, Full-Text, Hash, R-Tree)

Server-Enforced Referential Integrity

Row-Level Locking, MVCC (readers don’t block writers)

ACID Transaction Support

Partitioned Tables/Indexes

Standard Heap Tables and B-Tree Indexes

OracleMySQLFeature

Page 10: A Practical Guide to Migrating from Oracle to MySQL · 2007-04-06 · Encryption Transparent, RC4, DES, AES, etc. AES, DES, MD5 SHA1; 128/256 SSL Supported Yes Yes Group Management

10Copyright 2006 MySQL AB The World’s Most Popular Open Source Database

Why Migrate to MySQL?Strong Feature Set

MySQL does not have all the features of Oracle but…• MySQL isn’t designed to be the most feature rich RBDMS but rather one that…

• Offers 80-90% of the features at 10% the cost of proprietary (90% TCO savings)• Provides very high-performance and rock-solid reliability• Easiest to install, setup, configure, maintain, and use• Easily co-exists with Oracle in the data center

Choose MySQL When it Makes Sense and Oracle When it Makes Sense

Page 11: A Practical Guide to Migrating from Oracle to MySQL · 2007-04-06 · Encryption Transparent, RC4, DES, AES, etc. AES, DES, MD5 SHA1; 128/256 SSL Supported Yes Yes Group Management

11Copyright 2006 MySQL AB The World’s Most Popular Open Source Database

Why Migrate to MySQL?MySQL Network

Certified Software for high reliability and stabilityMySQL Software Update Service offers customized updates and alerts for your specific environmentOnline Knowledge Base provides rapid answers to technical questionsProduction Support around-the-clock support directly from MySQL engineersIntellectual Property Protection with comprehensive indemnificationComing Soon! New Monitoring and Advisor Service offers proactive best practice enforcement, notifications, and advice for optimizing MySQL servers

Page 12: A Practical Guide to Migrating from Oracle to MySQL · 2007-04-06 · Encryption Transparent, RC4, DES, AES, etc. AES, DES, MD5 SHA1; 128/256 SSL Supported Yes Yes Group Management

12Copyright 2006 MySQL AB The World’s Most Popular Open Source Database

Oracle to MySQL Migration Scenarios

• Full application migrations• Partial application migrations (lookup data, web session info, etc.)• Business Intelligence migrations (data warehouse, marts, etc.)• Data archiving migrations (storing historical data, etc.) • Embedded database applications requiring smaller footprint

Web Customer Shopping, Session,

Account Information

New Transaction Data

Page 13: A Practical Guide to Migrating from Oracle to MySQL · 2007-04-06 · Encryption Transparent, RC4, DES, AES, etc. AES, DES, MD5 SHA1; 128/256 SSL Supported Yes Yes Group Management

13Copyright 2006 MySQL AB The World’s Most Popular Open Source Database

Contrasting Oracle and MySQL

• Cost-based• Cost-based• Cost-based Optimizer

• Filegroups• Files

• Tablespaces• Datafiles

• Tablespaces• Table/Index Files• Format files

Data Storage

• TempDB (2005+)• Transaction Logs

• Undo Tablespace (9i+)• Redo Logs• Archive Logs

• InnoDB Undo Space• InnoDB Logs• Falcon Log• Binary Log

Redo/Undo Logs

• Buffer cache• SQL cache • Misc caches (lock,

connection, workspace, etc.)

• Data cache (variants)• Log buffer• Shared Pool• Java Pool • Large Pool• PGA

• MyISAM key caches• InnoDB data cache• InnoDB log cache• Dictionary cache• Falcon caches• Query Cache• User caches

Memory Caches

Microsoft SQL ServerOracleMySQLArea

Page 14: A Practical Guide to Migrating from Oracle to MySQL · 2007-04-06 · Encryption Transparent, RC4, DES, AES, etc. AES, DES, MD5 SHA1; 128/256 SSL Supported Yes Yes Group Management

14Copyright 2006 MySQL AB The World’s Most Popular Open Source Database

Contrasting Oracle and MySQL

Page 15: A Practical Guide to Migrating from Oracle to MySQL · 2007-04-06 · Encryption Transparent, RC4, DES, AES, etc. AES, DES, MD5 SHA1; 128/256 SSL Supported Yes Yes Group Management

15Copyright 2006 MySQL AB The World’s Most Popular Open Source Database

Migration Considerations – What Engine?

HighHighLowHighHighLowMemory cost (relative to other engines)

HighMedHighestHighMedHighBulk insert speed

YesYesYesYesYesYesReplication support

NoNoNoYesNoNoBuilt-in Cluster/High-availability support

NoYesNoNoYesNoForeign Key support

NAMedSmallestMedMedSmallStorage cost (relative to other engines)

NoNoYesNoNoYesCompressed data

NAYesNoYesYesYesIndex caches

NAYesNoYesYesNoData caches

NoYesYesNoYesYesGeospatial support

NoYesNoNoYesNoMVCC snapshot read

TableRowRowRowMVCCTableLocking granularity

NoYesNoYesYesNoTransactions

Yes64TBNoYes110TBNoStorage limits

MemoryInnoDBArchiveNDBFalconMyISAMFeature

Page 16: A Practical Guide to Migrating from Oracle to MySQL · 2007-04-06 · Encryption Transparent, RC4, DES, AES, etc. AES, DES, MD5 SHA1; 128/256 SSL Supported Yes Yes Group Management

16Copyright 2006 MySQL AB The World’s Most Popular Open Source Database

Security and Datatype Considerations

Column (row via view)Column, RowPrivilege Granularity

Handled via loggingAudit subsystemAuditing

AES, DES, MD5 SHA1; 128/256Transparent, RC4, DES, AES, etc.Encryption

YesYesSSL Supported

On RoadmapROLESGroup Management

GRANT, REVOKE. Host consideration

GRANT, REVOKEObject Privileges Handled

Root. SYS, SYSTEM, othersBuilt-in Accounts

MySQLOracleSecurity Item

NoneBFILE

BLOBLONG RAW, BLOB

MEDIUMBLOBRAW

LONGTEXTCLOB, LONG

CHAR, VARCHAR, TEXT

CHAR, VARCHAR(2), NCHAR, NVARCHAR

MySQL DatatypeOracle Datatype

DATETIME,TIMESTAMPDATE, TIMESTAMP

DOUBLEFLOAT

DECIMALREAL, DOUBLE

DECIMAL (P,S)NUMBER (P,S), DECIMAL (P,S)

INT, BIGINT, DECIMALNUMBER, DECIMAL

MySQL DatatypeOracle Datatype

Page 17: A Practical Guide to Migrating from Oracle to MySQL · 2007-04-06 · Encryption Transparent, RC4, DES, AES, etc. AES, DES, MD5 SHA1; 128/256 SSL Supported Yes Yes Group Management

17Copyright 2006 MySQL AB The World’s Most Popular Open Source Database

Miscellaneous Migration Considerations

Objects in Oracle that do not have a complement in MySQL include:

• TYPEs• Synonyms • Materialized Views (coming in upcoming version)• Dimensions• Sequences (MySQL uses AUTOINCREMENT columns)• Bitmap Indexes• Global Partitioned Indexes (coming soon)• Packages (although MySQL does have stored procedures)• Java Stored Procedures• DDL and Statement-Based Triggers (MySQL has Row-Based)

Page 18: A Practical Guide to Migrating from Oracle to MySQL · 2007-04-06 · Encryption Transparent, RC4, DES, AES, etc. AES, DES, MD5 SHA1; 128/256 SSL Supported Yes Yes Group Management

18Copyright 2006 MySQL AB The World’s Most Popular Open Source Database

Migration Strategies

3 4 522

• User accounts • Entities• Relationships• Datatypes• Rules (data, etc.)

• Simple moves • Transformations• Aggregations • Data Profiling /

Cleansing

• ETL Runs• Scheduled/Recurring• Validation• Migrate Code?

• Simulation• Metric Analysis• Review

11

Document Sources

• User Accounts • Entities• Relationships• Datatypes• Rules (data, etc.)

Data Migration Lifecycle

Design Targets

Design ETL Flows

Build/RunMigrations

Performance Test

• Scripts/Manual• Data Models• Models, Reports, etc.

• Scripts/Manual• Data Models• Models, Reports, etc.

• Scripts/Vendor Supplied

• Tactical 3rd Party• Enterprise Global

• Scripts/Manual• Tactical 3rd Party• Enterprise Global

• Manual• Tactical 3rd Party• Automated

Page 19: A Practical Guide to Migrating from Oracle to MySQL · 2007-04-06 · Encryption Transparent, RC4, DES, AES, etc. AES, DES, MD5 SHA1; 128/256 SSL Supported Yes Yes Group Management

19Copyright 2006 MySQL AB The World’s Most Popular Open Source Database

Migration Strategies – Step 1

Document Oracle Sources

1. Manual2. 3rd party Tool3. MySQL Workbench (Beta)

Best Practice – Use Models!

Page 20: A Practical Guide to Migrating from Oracle to MySQL · 2007-04-06 · Encryption Transparent, RC4, DES, AES, etc. AES, DES, MD5 SHA1; 128/256 SSL Supported Yes Yes Group Management

20Copyright 2006 MySQL AB The World’s Most Popular Open Source Database

Migration Strategies – Step 2

Define MySQL Targets

1. Manual2. 3rd party Tool3. MySQL Workbench (Beta) or MySQL Migration Toolkit

Best Practice – Use Models or Migration Toolkit!

Page 21: A Practical Guide to Migrating from Oracle to MySQL · 2007-04-06 · Encryption Transparent, RC4, DES, AES, etc. AES, DES, MD5 SHA1; 128/256 SSL Supported Yes Yes Group Management

21Copyright 2006 MySQL AB The World’s Most Popular Open Source Database

Migration Strategies – Step 3

Design ETL Flows

1. Manual via scripts2. 3rd party Tool3. MySQL Migration Toolkit

Best Practice – Use Third Party Tool or Migration Toolkit!

Page 22: A Practical Guide to Migrating from Oracle to MySQL · 2007-04-06 · Encryption Transparent, RC4, DES, AES, etc. AES, DES, MD5 SHA1; 128/256 SSL Supported Yes Yes Group Management

22Copyright 2006 MySQL AB The World’s Most Popular Open Source Database

Migration Strategies – Step 4

Build and Run Migration Routines

1. Manual via scripts2. 3rd party Tool3. MySQL Migration Toolkit

Best Practice – Use Third Party Tool or Migration Toolkit!

Page 23: A Practical Guide to Migrating from Oracle to MySQL · 2007-04-06 · Encryption Transparent, RC4, DES, AES, etc. AES, DES, MD5 SHA1; 128/256 SSL Supported Yes Yes Group Management

23Copyright 2006 MySQL AB The World’s Most Popular Open Source Database

Migration Strategies – Step 5

Performance Test

1. Manual2. 3rd party Tool3. MySQL mysqlslap utility

Best Practice – Use Third Party Tool or mysqlslap!

Page 24: A Practical Guide to Migrating from Oracle to MySQL · 2007-04-06 · Encryption Transparent, RC4, DES, AES, etc. AES, DES, MD5 SHA1; 128/256 SSL Supported Yes Yes Group Management

24Copyright 2006 MySQL AB The World’s Most Popular Open Source Database

Migration Toolkit – How Does it Work?

1. Connect to and Reverse Engineer Oracle Source2. Connect to MySQL Target3. Select Schemas/Objects to Migrate4. Customize MySQL Target Schemas/Objects5. Transform Oracle Schemas/Objects to MySQL Schemas/Objects6. Move Data from Oracle to MySQL

Page 25: A Practical Guide to Migrating from Oracle to MySQL · 2007-04-06 · Encryption Transparent, RC4, DES, AES, etc. AES, DES, MD5 SHA1; 128/256 SSL Supported Yes Yes Group Management

25Copyright 2006 MySQL AB The World’s Most Popular Open Source Database

Oracle-to-MySQL Object Translation

Schema Migration Toolkit Database

Table Migration Toolkit Table

Index Migration Toolkit Index

View Migration Toolkit View

Stored Procedure manual Stored

Procedure

Function manual Function

Trigger manual Trigger

Page 26: A Practical Guide to Migrating from Oracle to MySQL · 2007-04-06 · Encryption Transparent, RC4, DES, AES, etc. AES, DES, MD5 SHA1; 128/256 SSL Supported Yes Yes Group Management

26Copyright 2006 MySQL AB The World’s Most Popular Open Source Database

Other Oracle->MySQL Migration Considerations

• For large data migrations, ensure all proper MySQL parms are set (Migration Toolkit will do automatically for you).

• Enable sql_mode option in MySQL 5.0 for maximum data integrity • Look into 3rd party management tools to manage both Oracle & MySQL• Ensure to mirror Oracle needs in MySQL (autogrowth datafiles, binary

logging for point-in-time recovery, etc.)• Ensure MySQL memory defaults are not used for demanding systems• Look into MySQL 5.0+ Instance Manager to manage multiple MySQL’s• When tuning migrated SQL code, utilize slow query log to catch bad SQL• Periodically check MySQL error log just like Oracle alert log• Look to MySQL Network for production/data center applications

Page 27: A Practical Guide to Migrating from Oracle to MySQL · 2007-04-06 · Encryption Transparent, RC4, DES, AES, etc. AES, DES, MD5 SHA1; 128/256 SSL Supported Yes Yes Group Management

27Copyright 2006 MySQL AB The World’s Most Popular Open Source Database

Conclusion

Does it make sense to migrate from Oracle to MySQL?

• Financial? Yes! 10-20% of the cost of Oracle. • Reliability? Yes! MySQL maintains the highest levels of uptime at many

enterprise installations.• Performance? Yes! MySQL has proven track record against Oracle.• Ease of Use? Yes! MySQL is much easier to install, setup, and administer.• Safety? Yes! MySQL Network provides certified software, around-the-

clock support, and much more to provide data center-level confidence.

Choose MySQL When it Makes Sense and Oracle When it Makes Sense

Page 28: A Practical Guide to Migrating from Oracle to MySQL · 2007-04-06 · Encryption Transparent, RC4, DES, AES, etc. AES, DES, MD5 SHA1; 128/256 SSL Supported Yes Yes Group Management

28Copyright 2006 MySQL AB The World’s Most Popular Open Source Database

Resources

• Professional Services 5-day “Migration Jumpstart”– www.mysql.com/migration

• MySQL Migration Toolkit– http://www.mysql.com/products/tools/migration-toolkit/

• MySQL Migration Central– http://www.mysql.com/why-mysql/migration/

• MySQL Migration Forums– http://fourms.mysql.com

• MySQL Case Studies– http://www.mysql.com/it-resources/case-studies/

• MySQL Whitepapers– http://www.mysql.com/why-mysql/white-papers/

Page 29: A Practical Guide to Migrating from Oracle to MySQL · 2007-04-06 · Encryption Transparent, RC4, DES, AES, etc. AES, DES, MD5 SHA1; 128/256 SSL Supported Yes Yes Group Management

29Copyright 2006 MySQL AB The World’s Most Popular Open Source Database

A Practical Guide toMigrating from

Oracle to MySQL

Thank You!

[email protected]