zero outage oracle to db2 migrations - the fillmore group ... · heterogeneous replication –...
TRANSCRIPT
Zero Outage Oracle to DB2 Migrations
Frank C. Fillmore, Jr.
The Fillmore Group, Inc.
Session Code: G09
May 17, 2012 (8:30 a.m. – 9:30 a.m.) | Platform: Linux, Unix, Windows
Click to edit Master title style
Agenda
• Introduction
• Oracle to DB2 Migration Business Drivers
• DB2 for LUW v9.7 Oracle API Enablement
• Batch Data Migration Process
• IBM Data Movement Tool (IDMT)
• SET INTEGRITY
• Q Replication Overview
2
Click to edit Master title style
Agenda (continued)
• Heterogeneous Replication (Oracle to DB2)
• Supplemental Logging
• Oracle LogMiner
• IDMT + Heterogeneous Replication
• Problems Encountered/Best Practices
• Data Translation
• LogMiner disconnects
• Questions?
3
Click to edit Master title style
Introduction
• Customer Profile
• World-wide Top 50 integrated financial institution
• Online banking website with millions of transactions per day
• High profile outage in September 2010
• Original Technical Profile
• Eight(8) node Oracle Real Application Cluster (RAC)
• Sun Solaris servers
• Target Technical Profile
• Single image DB2 for LUW v9.7
• IBM Power 770 (AIX)
4
Click to edit Master title style
Oracle to DB2 Migration Business Drivers
• High Availability Disaster Recovery (HADR)
• Server consolidation: 36 servers reduced to 4
• Includes HADR secondary
• Reduce energy consumption, footprint, networking, software
• Reduce staffing costs (all databases)
• 12.1 FTE for DB2
• 27.1 FTE for Oracle
5
Click to edit Master title style
Oracle to DB2 Migration Business Drivers
• Reduce software license costs
• Fewer nodes to license
• DB2 Advanced Enterprise Server Edition (AESE) can be as low
as 1/3 the cost of Oracle
• Lower subscription and support (S&S) maintenance costs
• Business Value Assessment Tool
6
Click to edit Master title style
Oracle to DB2 Migration Business Drivers
• Better Performance
• DB2 on POWER delivers up to 3 times the performance per core
of Oracle database on SPARC
• Technical Support
• Fault Tolerance
7
Click to edit Master title style
DB2 for LUW v9.7 Oracle API Enablement
• Up to 98% compatibility with Oracle PL/SQL
• “Run Oracle applications on DB2 9.7 for LUW” www.ibm.com/developerworks/data/library/techarticle/dm-0907oracleappsondb2
• Supported in DB2 Express-C v9.7.5
• Try for free via download or in the cloud
http://www.ibm.com/developerworks/downloads/im/udbexp/cloud.html
• “Oracle to DB2 Migration Experience and Lessons
Learned from Canadian Blood”
• Session 196
• Friday, May 18, 2012 (09:15 AM - 10:15 AM)
8
Click to edit Master title style
Batch Data Migration Process
• IBM Data Movement Tool (IDMT) http://www.ibm.com/developerworks/data/library/techarticle/dm-0906datamovement
• Download, install, and configure IDMT
• Create and prepare the target DB2 database
• Invoke GUI or command line interface
• Connect to source Oracle and target DB2 databases
• Extract data and Data Definition Language (DDL) or DDL only
9
Click to edit Master title style
Batch Data Migration Process
• IBM Data Movement Tool (IDMT)
• Deploy objects and load data
• DB2 LOAD scripts are generated – some tuning advisable
http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=%2Fcom.ibm
.db2.luw.admin.cmd.doc%2Fdoc%2Fr0008305.html
• MODIFIED BY
• dateformat
• timeformat
• striptblanks
• nochecklengths
• norowwarnings
10
Click to edit Master title style
IDMT GUI
11
Click to edit Master title style
Batch Data Migration Process
• SET INTEGRITY
• Bring tables out of “set integrity pending” state
12
Click to edit Master title style
Q&A
• Q: So what’s not to like?
• A: The entire process for a multi-terabyte database will
take 5 days.
• The customer’s online banking system couldn’t be down
that long.
• Solution: use Oracle log-based changed data capture to
gather deltas while IDMT runs – reduce the outage.
13
Click to edit Master title style
Q Replication Overview
• Log-based Capture
• WebSphere MQ transport layer
• Control Tables manage replication metadata
• Subscriptions map source tables to target tables
14
Log-based
Capture
Source Target
Highly
parallel
Apply
Capture MQ Series Apply
DB2
Oracle
Sybase
SQL Server
Informix
DB2
Oracle
Control Tables Control Tables
Click to edit Master title style
Q Replication
• Definition and configuration – ASNCLP “ASNCLP Program Reference for Replication and Event Publishing” SC19-1018
• Tooling
• Q Replication Dashboard
• Replication Center
• ASNMON
15
Click to edit Master title style
Heterogeneous Replication – Oracle Setup
• Ensure that archive logging is enabled. To determine the
database log mode (ARCHIVELOG or
NOARCHIVELOG), use the following statement: SELECT LOG_MODE FROM SYS.V$DATABASE;
• Set minimal supplemental logging by using the following
statement: ALTER DATABASE ADD SUPPLEMENTAL LOG DATA;
• To check whether supplemental logging is enabled, query
the V$DATABASE view: SELECT SUPPLEMENTAL_LOG_DATA_MIN FROM V$DATABASE;
• If the query returns a value of YES or IMPLICIT, minimal
supplemental logging is enabled.
16
Click to edit Master title style
Heterogeneous Replication – Oracle Setup
• For each source table, enable table-level supplemental
logging by using the following statement: ALTER TABLE table_owner.table_name ADD SUPPLEMENTAL LOG DATA (ALL)
COLUMNS;
17
Click to edit Master title style
Heterogeneous Replication – LogMiner
18
Click to edit Master title style
Heterogeneous Replication – LogMiner Setup
• Create a table space for the LogMiner utility on the Oracle
source database.
• Create a LogMiner user account for Q Replication on the
Oracle source.
19
Click to edit Master title style
IDMT + Heterogeneous Replication
20
Heterogeneous Q Replication
Cold start Q Capture
BCV split
Q Apply start IDMT extract/load process
~ 5 days Q Capture start
Q Capture:
“load done”
message
Q Apply: empty
Spill queue
Click to edit Master title style
The Big Picture
21
Old App
Server
Oracle DB
Server
DB2 DB
Server
IDMT LOAD
Q Replication
New App
Server
Click to edit Master title style
Problems Encountered/Best Practices
• Oracle data type mapping in Subscriptions http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=%2Fcom.ibm.swg
.im.iis.repl.qrepl.doc%2Ftopics%2Fiiyrqdtscoramapping.html
• Expressions and cast functions in Subscriptions – Data Conversion
CREATE QSUB USING REPLQMAP SAMPLE_ASNCAP1_TO_TARGET_ASNAPP1
(SUBNAME TESTEXP DATA.EMPLOYEE TARGET NAME DATA.TGTEMPLOYEE
TRGCOLS ALL EXPRESSION (“DECIMAL(:PAYAMT,5,2)” TARGET CPAY));
http://publib.boulder.ibm.com/infocenter/db2luw/v9r7/index.jsp?topic=%2Fcom.ibm
.swg.im.iis.repl.qrepl.doc%2Ftopics%2Fiiyrqsubcrtcomputcols.html
22
Click to edit Master title style
Problems Encountered/Best Practices
• Monitoring LogMiner
• Occasionally LogMiner will disconnect and prevent Q Capture
from fetching Oracle log data
• Solution:
• Monitor Q Replication Dashboard for volume, log latency
• Periodically recycle LogMiner and Q Capture
23
Click to edit Master title style
Sources and Acknowledgements
• IBM DB2 v9.7 Information Center
• IBM DeveloperWorks
• Kim May, The Fillmore Group
• Jeff Richardson, IBM
• Christian Zentgraf, IBM
24
Frank C. Fillmore, Jr. The Fillmore Group, Inc.
Session G09
Zero Outage Oracle to DB2 Migrations