Mais conteúdo relacionado Semelhante a Tungsten University: Replicate Between MySQL And Oracle (20) Tungsten University: Replicate Between MySQL And Oracle2. ©Continuent 2013
Introducing Continuent
2
• The leading provider of clustering and
replication for open source DBMS
• Our Product: Continuent Tungsten
• Clustering - Commercial-grade HA, performance
scaling and data management for MySQL
• Replication - Flexible, high-performance data
movement
3. ©Continuent 2013.
Tungsten Replicator
3
Tungsten Replicator is a fast,
open source, database
replication engine
Designed for speed and flexibility
GPLV2 license
100% open source
Annual support subscription available from Continuent
“Golden Gate without the Price Tag”
®
5. ©Continuent 2012 5
Extract Filter Apply
Stage
Extract Filter Apply
Stage
Extract Filter Apply
Stage
Pipeline
Master
DBMS
Transaction
History Log
Queue
Slave
DBMS
Tungsten Replication Service
9. ©Continuent 2013.
Steps to Heterogeneous Replication
1. Prepare (translate) schema for
the slave DBMS
2. Set up replication
3. Provision initial data
4. Continue real-time replication
ddlscan
tungsten-installer
Parallel Apply
11. ©Continuent 2013.
Use Case: Real-Time Sales/Order
Ful!llment
Real-Time Replication
Web-based Sales Purchase Ordering
3M
Order
Items
~1M
Xacts/
Day
18. ©Continuent 2012
Features
18
• Translates schema with replication in mind
• Provides errors and warnings proactively
• Can rename schema/tables/columns
• Easy
• Straightforward to extend (write new
templates)
19. ©Continuent 2012
Usage (MySQL to Oracle Example)
19
$ cd tungsten-replicator/bin
$ ./ddlscan
-db test
-template ddl-mysql-oracle.vm
-user tungsten
-pass secret
22. ©Continuent 2012
Result of ddlscan
22
CREATE TABLE 3colors
/* ERROR: table starts with a number, use rename option and a
filter */
(
id NUMBER(10, 0),
color VARCHAR2(1) /* ENUM('R','G','B') */,
enabled NUMBER(1) /* BIT(1) - no constraints for 0 or 1 */,
acolumnthatdoesntfittooracleat NUMBER(10, 0)
/* WARN: truncated column name exceeding 30 characters
(acolumnthatdoesntfittooracleatall) */
/* ERROR: table must have a primary key! */
);
CREATE TABLE talks
...
27. ©Continuent 2012
Master Installation
27
tools/tungsten-installer -a
--master-slave
--service-name=frommysql
--cluster-hosts=db1
--master-host=db1
--datasource-port=3306
--datasource-user=tungsten
--datasource-password=secret
--home-directory=/opt/continuent
--mysql-use-bytes-for-string=false
--mysql-enable-enumtostring=true
--mysql-enable-settostring=true
--start-and-report
28. ©Continuent 2012
Slave Installation
28
tools/tungsten-installer -a
--master-slave
--service-name=frommysql
--cluster-hosts=db2
--master-host=db1
--datasource-type=oracle
--datasource-oracle-service=ORCL
--datasource-user=tungsten_frommysql
--datasource-password=secret
--home-directory=/opt/continuent
--svc-applier-filters=dropstatementdata
--start-and-report
31. ©Continuent 2013.
Parallel Apply on Replicas
Extract
Filter
(Shard)
Apply
Extract/Filter/
Apply
Stage Stage Stage
Pipeline
Master
DBMS
Slave
DBMS
Transaction
History Log
Parallel
Queue
Extract/Filter/Apply
Extract/Filter/Apply
Extract/Filter/Apply
Provisioning
Multi-
tenant
source
32. ©Continuent 2012
Provisioning (Parallel Apply)
32
• Restore a backup and let it replicate
Production
Schema
Translated
tables
Replication
Replication
Replication
Replication
Replication
Replication
Replication
Provisioning
Schema
34. ©Continuent 2012
Continue Replicating Real-Time Data
34
• Discard provisioning schema and leave single
channel
Production
Schema
Provisioned
Tables
Replication
Replication
Replication
Replication
Replication
Replication
Replication
Provisioning
Schema
35. ©Continuent 2013.
How Does Tungsten Do That?
35
MySQL
Binlog
binlog_format=row
Service
frommysql
Tungsten Master
Replicator
MySQLExtractor
Special Filters
•Transform
ENUM to string
•Transform SET
to string
Service
frommysql
Tungsten Slave
Replicator
Special Filters
•Drop DDL
•Map names to upper case
•Rename too long or reserved
objects
•Optimize updates to remove
unchanged columns
•Ignore extra tables
OracleApplierMySQLExtractor
38. ©Continuent 2013.
How Does Tungsten Do That?
38
Service
fromoracle
Tungsten Master
Replicator
OracleCDCExtractor
No Special Filters
Service
fromoracle
Tungsten Slave
Replicator
Special Filters
•Map names to lower case
•Ignore extra tables
•Heartbeat table renaming
demo
schema
demo_pub
schema
Oracle CDC
(Synchronous or
Async Hotlog)
MySQLApplierOracleCDCExtractor
40. ©Continuent 2013.
How Does Tungsten Do That?
40
Service
fromoracle
Tungsten Master
Replicator
OracleCDCExtractor
No Special Filters
Service
fromoracle
Tungsten Slave
Replicator
Special Filters
No Special Filters
demo
schema
demo_pub
schema
Oracle CDC
(Synchronous or
Async Hotlog)
Tungsten Slave
Replicator
OracleApplierOracleCDCExtractor
42. ©Continuent 2013.
Oracle RAC and Continuent Tungsten
Continuent Tungsten
Cluster for MySQLOracle 11G RAC
Connect your favorite clusters!
47. ©Continuent 2013
Support for Tungsten Replicator
47
• Community support is available on project
mailing list
• Continuent o!ers implementation services and
annual 24/7 support subscriptions
• We do not o!er hourly or per-incident support
(sorry!)
• For high availability or disaster recovery needs,
check out Continuent Tungsten clustering
• Meanwhile, have fun and try it out!
48. ©Continuent 2013
Tungsten University Sessions
48
• Introduction to Continuent Tungsten 2.0 (May
16 and May 21)
• Load a Vertica Data Warehouse with MySQL
Data (May 30 and June 4)
Send any feedback to: tu@continuent.com
49. ©Continuent 2013. 49
Continuent Web Page:
http://www.continuent.com
Tungsten Replicator:
http://code.google.com/p/tungsten-replicator
Our Blogs:
http://"yingclusters.blogspot.com
http://scale-out-blog.blogspot.com
http://datacharmer.blogspot.com
http://continuent-tungsten.blogspot.com
560 S. Winchester Blvd., Suite 500
San Jose, CA 95128
Tel +1 (866) 998-3642
Fax +1 (408) 668-1009
e-mail: sales@continuent.com