Академический Документы
Профессиональный Документы
Культура Документы
com/db2/labchats
ibm.com/db2/labchats
2009 IBM Corporation
Agenda
Motivation Oracle compatibility in DB2 9.7 Steps of enablement to DB2 Choosing the right applications Customer and partner experiences
Motivation
TINYINT
NUMBER VARCHAR2
SELECT * FROM T
recursion, ..
DB2
Your choices
SQL Standard
Pick one dialect and stick (or be stuck) with it. For ISVs: Pick two or all and have dual/triple maintenance Pick intersect only and escape to Java, Hibernate etc You loose either way!
4
2009 IBM Corporation
Problem
5
MTK can only help with data base objects and DDL e.g. procedures, triggers, functions, tables ..but SQL is littered throughout the application code! Impedance mismatch can cause performance issues
2009 IBM Corporation
A new approach
Syntax toleration
Where no semantic conflicts exist
Added infrastructure
Compatibility modes
Early feedback
More than 300 participants in the Early Access
Some participants with multiple applications Many applications that currently use Oracle Many participants enabled their applications to use DB2 in a few days 7.5M LOC PL/SQL for biggest beta customer
Concurrency Control
Pre DB2 9.7 DB2 9.7 Architecture
DB2 default
Cursor stability blocks Reader Writer Reader No No* Writer Yes Yes
* In default isolation DB2 keeps no rows locked while scanning
10
No Yes
2009 IBM Corporation
No
select * from T1
Locks
12
13
14
Function Conversion and Formatting Date arithmetic String manipulation Misc TO_CHAR, TO_DATE, TO_TIMESTAMP, TO_NUMBER, TO_CLOB EXTRACT, ADD_MONTHS, INITCAP, RPAD, LPAD, INSTR, DECODE, NVL, LEAST, GREATEST, BITAND
16
Tree walk recursion, includes helper functions (9.5) Old style OUTER JOIN syntax (9.5) Dummy one row, one column table (9.5) Pseudo column for ROWNUMBER() (9.5) Get update lock without a cursor Pseudo column syntax for RID_BIT() Independent transactions for auditing Quickly delete a table without logging For table, sequence, module Catalogued, private temporary table
18
20
IF, WHILE, :=, etc.. Try/catch handling Variables that cannot be set Step through numbers Step through result set of query Step through result set of cursor Define conditions with or without SQLCODEs Anchored scalar data types Anchored row types Procedure executes in own commit scope
PL/SQL in DB2
Area Anonymous block Scalar function Procedure PL/SQL Package Trigger Including DEFAULT, and named parameters Known as MODULE in SQL PL Row level, Before or After Server side scripting New also in SQL PL dialect
22
23
print debugging and simple reporting Server side I/O API Cross session semaphoring Cross session data pipe Job scheduler Alternate API to DB2 native LOB functions Alternate API to PREPARE/EXECUTE Misc functions and procedures Server API to email Server API to SMTP
2009 IBM Corporation
25
Steps of Enablement
1. Identify and size-up candidate using the MEET DB2 Tool 2. Enable application using the IBM Data Movement Tool 3. Test, Test, Test 4. Parallel production 5. Cut-Over
26
99.0% of statements
immediately transferable to IBM DB2
MEET Report Rapid assessment of application Early confirmation of compatibility Lists details and source code line number for exceptions
28
2009 IBM Corporation
100%
80%
% of SQL statements
60%
90-99% of statements
immediately transferable to IBM DB2
40%
29
30
31
32
Paradigm shift
"The new IBM DB2 offers true ENABLEMENT and not mere PORTING. This feature is a paradigm shift in the very concept of database migration!" Godson Retna, Senior Architect, Cognizant Technology Solutions
33
34
35
Why DB2 9.7? Business Driver to hold down costs Key business driver: hold down personnel costs
by maintaining skilled professionals for one enterprise software stack, instead of two. personnel, even more than hardware and software, is a critical cost to be considered. we already have specialists in WebSphere, MQ Series and DB2
36
Lines of code
Java: 2501 files with 171,285 lines of code JSP: 387 files with 19,101 lines of code XML: 400 files with 153,897 lines XSD:63 XSD files with 4,898 lines JS (Javascript): 60 files with 21,350 lines. Tables: 223 Views: 194, many nested
37
Ease of Migration It worked! It migrated successfully! We ran the exact same tests as with JBoss / Oracle With WebSphere / DB2 9.7:
Read Consistency worked
This was a very big deal! Writers didnt block readers for the application
Equivalent Performance
Some normal tuning using indexes
38
Resolution:
Either drop the RI or break out the aggregation into multiple tables
Datatypes
Conversion tool and Number columns (easy to fix)
Converted to DECFLOAT(16) by conversion tool Unqualified Decimal column resulted in Decimal (5, 0) Easy to fix the DDL once identified
Non-problem differences upon review: Timestamp Manipulation: Microseconds Varchar2: No problem for our application
39
DB2 9.7 Beta Program was a great experience! Thanks to IBM, IDUG, Gold Consultants Beta program experience was very good! Thanks to:
IBM
Maria Schwenger (DB2 enablement advocate)
IDUG
Chris Eaton (IBM Toronto Lab - DB2 Technical Evangelist) Martin Hubel (Martin Hubel Consulting)
40
www.annantech.com
AnnanTech 2009
AnnanTech 2009
Background
AnnanTech is an IT service provider. Our experience spans Finance, Risk Management, Business Continuity, Security and Information Assurance. WISDOM is our CME (Central Management Encyclopaedia) system which connects/accesses all your existing systems to give a single, useful focused view of your business information in one place. WISDOM had been designed to support multiple databases simultaneously, but actual port had not been required from MS SQL Server by clients. But the need arose for both Oracle and DB2 support at the same time i.e. twice the problem with same number of hands!
42
42 www.annantech.com
The Port
Luckily WISDOMs internal structures were designed for this, but did still require actual work to port base tables, stored procedures and dealing with some SQL/DDL syntax differences. We used Oracle migration tool and IBM Migration Tool Kit (MTK) to get part way a lot of WISDOMs code is dynamic, which means neither migration tool works 100% for us. First completed Oracle port as a reference point using Oracle migration tools Oracle done. Minor tweaks of code to run natively on DB2 (note: we were using Beta, so this would be less now), and set DB2 for Oracle compatibility DB2 9.7 done.
43
43 www.annantech.com
Summary
Remember: we wanted to support all platforms a bit more complex than a single port. From supporting a single platform, we now support four in just over the time that wouldve been required for a single port. DB2 9.7 gave us One Dev Platform, suite of tools, etc. for:
Native (i.e. Legacy) DB2 support; Oracle support; and New DB2 9.7 support (one code base for 2 platforms going forward)
i.e. BANG FOR BUCK In Conclusion: Were proud to be part of the DB2 beta programme and tremendously pleased with DB2 9.7 and it saved us a lot of effort! And support given to us as ISV was of a very high standard.
44 www.annantech.com
44
Gene Ostrovsky
Vice President R & D, ExactCost, Inc.
45
Background
ExactCost is a software technology company focused on Clinical Cost & Process Improvement solutions for healthcare providers Our proprietary technology enables healthcare providers to improve their revenue and operational margins. ExactCost solutions are delivered via the Web, without any capital investment, enabling the organization to achieve sustainable bottom-line improvements.
46
Becoming Blue
Offer our clients a complete package including ExactCost solutions and the hardware and services from one of the strongest brands in the world. Participate in IBMs HIF (Health Integration Framework) and acquire new clients and leads. Demonstrate ExactCost solutions to potential customers at IBMs Dallas Innovation Center.
47
48
> Questions
49
Thank You!
ibm.com/db2/labchats
n ha T
u yo
a or f
d en t
g in
50