Streamline Business With Consolidation And Conversion To .

Transcription

IBM Information Management SoftwareFront coverStreamline Business withConsolidation andConversion to DB2 for z/OSConsolidate your investment inDB2 for z/OSAccelerate conversions withtools technologyAdapt to industry dynamicsPaolo BruniMarcos CaurimElise GotaySusan LawsonGlenn McGeochRebecca Pooleibm.com/redbooks

International Technical Support OrganizationStreamline Business with Consolidation andConversion to DB2 for z/OSSeptember 2012SG24-8044-00

Note: Before using this information and the product it supports, read the information in “Notices” onpage xv.First Edition (September 2012)This edition applies to IBM DB2 Version 10.1 for z/OS (program number 5605-DB2). Copyright International Business Machines Corporation 2012. All rights reserved.Note to U.S. Government Users Restricted Rights -- Use, duplication or disclosure restricted by GSA ADP ScheduleContract with IBM Corp.

ContentsFigures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . ixTables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiExamples . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiiiNotices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvTrademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviPreface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviiThe team who wrote this book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviiNow you can become a published author, too! . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xixComments welcome. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xixStay connected to IBM Redbooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xixPart 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1Chapter 1. Business considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1.1 Historically speaking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1.2 Industry dynamics driving change . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .1.3 The reality of software conversions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3445Chapter 2. Converting to DB2 for z/OS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 72.1 Converting to a relational DBMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82.2 Additional benefits of a relational DBMS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82.3 Benefits of SQL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102.4 Data definition language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.5 DB2 for z/OS is the platform of choice . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 112.5.1 Scalability, availability, and usability . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 122.5.2 Security . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.5.3 Database integrity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 132.5.4 Continuous operation support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.5.5 Centralized catalog . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.5.6 Recovery . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 142.5.7 Usability and productivity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 152.5.8 Transaction manager support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162.5.9 Robust Utility Suite and unlimited tools. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172.6 zEnterprise . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 202.7 Additional benefits of DB2 10 for z/OS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21Part 2. Migration methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23Chapter 3. Application and database conversion methodology. . . . . . . . . . . . . . . . . .3.1 Mature application challenges on the z platform . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.2 Mature application options, examples, and terminology . . . . . . . . . . . . . . . . . . . . . . . .3.2.1 Application and database conversion (manual or automated) . . . . . . . . . . . . . . .3.2.2 Application modernization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.2.3 Application migration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.2.4 Application replacement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.2.5 Application rewrite. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . Copyright IBM Corp. 2012. All rights reserved.2526272829292929iii

3.2.6 Application re-engineering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.2.7 Migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.2.8 Do nothing or status quo . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.3 Conversion as a feasible solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.4 Manual conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .3.4.1 Sample methods for manual conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .293030303233Chapter 4. Automated conversion methodology . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.1 Conversion tool data access options . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.2 Automated conversion tool projects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.2.1 Stage one: Assessment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.2.2 Stage two: Pilot . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.2.3 Stage three: Conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.3 Data conversion guidelines . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.3.1 Preparing for conversion testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.3.2 Addressing bugs and performance issues . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.3.3 Scheduling a dry run . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.3.4 Planning for a backout . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.4 Tool conversion strategies for 4GL programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .4.4.1 The 4GL dilemma . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .37383940424243444545454646Chapter 5. Application and database conversion best practices . . . . . . . . . . . . . . . . .5.1 Summary of best practices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.2 Stage one conversion planning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.2.1 Application survey and initial project sizing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.2.2 Fee-based assessment. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.2.3 Options risk analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5.3 Conversion skills and roles . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .47485051535454Chapter 6. Choosing a migration strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.1 Conversion strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.1.1 Big Bang strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.1.2 Loose coexistence strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.1.3 Piece-by-piece strategy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.1.4 Using transparency as a bridge strategy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.1.5 Combining migration strategies. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.1.6 Comparing strategies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.2 Automated conversion tool case study . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.2.1 Case study background . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.2.2 Identifying and conducting a pilot project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.2.3 Automated assessment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.2.4 Collecting, converting, and customizing the application and database. . . . . . . . .6.2.5 Application and database testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.2.6 Performance testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.2.7 Implementation tests . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.2.8 Production implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.2.9 Post-conversion tuning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.2.10 Relational redesign . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .6.3 IBM consultancy contact information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .5759606061616263646465666666676768686869Part 3. Tool-assisted conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71Chapter 7. Conversion solutions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 737.1 Automation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 74ivStreamline Business with Consolidation and Conversion to DB2 for z/OS

7.1.1 Application conversion challenges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7.1.2 Data conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7.2 Engaging the conversion tool vendors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7.2.1 Qualifying vendor tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7.3 Post project lessons learned . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7.4 IBM InfoSphere solutions assist conversion process . . . . . . . . . . . . . . . . . . . . . . . . . .7.4.1 Data replication . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7.4.2 Data federation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .7.4.3 Data transformation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .757676777879808181Chapter 8. Converting CA IDMS toDB2 for z/OS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 838.1 Performing a CA IDMS conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 848.1.1 Re-engineering and rewriting the application . . . . . . . . . . . . . . . . . . . . . . . . . . . . 848.1.2 Purchasing a software package . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 848.1.3 Converting existing systems . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 848.2 CA IDMS requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 858.2.1 CA IDMS key conversion factors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 868.2.2 Mapping CA IDMS data to DB2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 878.3 DB-Shuttle by ATERAS conversion solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 908.3.1 DB-Shuttle solution details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 908.3.2 Additional tasks outside of the standard DB-Shuttle conversion. . . . . . . . . . . . . . 928.3.3 Assessment process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 938.4 DB-Shuttle conversion process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 958.4.1 Challenges of the customer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 958.4.2 Environment of the customer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 968.4.3 Project phases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 988.4.4 Database and data conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1018.4.5 Application conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1068.4.6 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1088.4.7 Lessons learned . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110Chapter 9. Converting Adabas toDB2 for z/OS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9.1 Natural and Adabas conversions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9.2 Adabas requirements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9.2.1 Conversion challenges . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9.3 ConsistADS automated conversion solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9.3.1 ConsistADS solution overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9.3.2 ConsistADS solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9.3.3 DB2 for z/OS tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9.3.4 The ConsistADS products. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9.4 How ConsistADS maps ADABAS data files to DB2 . . . . . . . . . . . . . . . . . . . . . . . . . .9.5 ConsistADS conversion process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9.5.1 Challenge of the customer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9.5.2 Solution architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9.5.3 Project phases . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9.5.4 Data conversion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9.5.5 Converting the application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9.5.6 ConsistADS client results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9.6 Other solutions in the market . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9.7 OnTarget . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9.7.1 Adabas to DB2 for z/OS design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9.7.2 Features of the OnTarget solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41142142143143Contentsv

9.7.3 Customer conversion scenario . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9.7.4 OnTarget conversion process . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9.7.5 Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9.7.6 Lessons learned . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .9.8 eavRPM solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .144145147147147Part 4. Post-conversion tasks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 153viChapter 10. z/OS and DB2 setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10.1 DB2 system parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10.1.1 Thread management parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10.1.2 Locking parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10.1.3 Checkpoint control parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10.1.4 Distributed Data Facility parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10.1.5 DB2 log parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10.1.6 Resource management parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10.1.7 EDM pool parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10.2 Configuring the buffer pool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10.2.1 Buffer pool assignment . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10.2.2 Buffer pool sizing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10.2.3 Buffer pool thresholds . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10.2.4 Buffer pool tuning tools . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10.2.5 Automating buffer pool management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10.2.6 Additional buffer pool considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10.3 CICS configuration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10.3.1 CICS system initialization parameters . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10.3.2 DB2 threads in CICS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10.3.3 CICS DB2 resource definitions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10.3.4 Threadsafe programs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10.4 z/OS operating system . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10.4.1 Supported z/OS release levels . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .10.4.2 Workload Manager . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 69169170170173174174174Chapter 11. Application and SQL tuning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11.1 Application tuning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11.1.1 Reducing number of SQL statements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11.1.2 Eliminating programmatic joins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11.1.3 Remove cursor in cursor processing. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11.1.4 Filter in DB2, not in program . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11.1.5 Selective column retrieval . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11.1.6 Organize transactions to avoid contention and avoid deadlocks . . . . . . . . . . .11.1.7 Using optimistic locking to improve concurrency . . . . . . . . . . . . . . . . . . . . . . .11.1.8 Reducing sort cost . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11.1.9 Ensuring appropriate use of external stored procedures . . . . . . . . . . . . . . . . .11.1.10 Using basic SQL procedures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11.1.11 Promoting the use of dynamic statement cache . . . . . . . . . . . . . . . . . . . . . . .11.1.12 Converting single row processing to multi-row fetch or insert. . . . . . . . . . . . .11.1.13 Combine statements by using SELECT FROM INSERT . . . . . . . . . . . . . . . .11.1.14 Combining statements with SELECT FROM UPDATE or DELETE . . . . . . . .11.1.15 Using the SQL scalar fullselect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11.1.16 Using MERGE for synchronization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11.1.17 Combining statements with SELECT FROM MERGE . . . . . . . . . . . . . . . . . .11.1.18 Close cursors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11.2 SQL tuning and optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 84185186186187Streamline Business with Consolidation and Conversion to DB2 for z/OS

11.2.1 Improving sequential access. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11.2.2 Improving index usage . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11.2.3 Ensuring appropriate predicate filtering . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11.2.4 Using common table expressions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11.2.5 Using recursive SQL for retrieving ordered sets . . . . . . . . . . . . . . . . . . . . . . . .11.2.6 Using uncommitted read . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11.2.7 Monitoring and maintaining applicable organization and statistics . . . . . . . . . .11.2.8 Using EXPLAIN to verify access path . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11.3 IBM tools for application and SQL tuning . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11.3.1 InfoSphere Optim Query Workload Tuner for DB2 for z/OS . . . . . . . . . . . . . . .11.3.2 IBM Tivoli OMEGAMON XE for DB2 Performance Expert on z/OS . . . . . . . . .11.3.3 IBM DB2 Path Checker for z/OS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .11.3.4 IBM DB2 SQL Performance Analyzer for z/OS. . . . . . . . . . . . . . . . . . . . . . . . .11.3.5 IBM DB2 Query Monitor for z/OS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .187187187188189192193195195195196196196197Chapter 12. Maximizing DB2 for z/OS features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12.1 Using DB2 for z/OS features . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12.2 Using identity columns and sequence objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12.2.1 Identity columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12.2.2 Sequence objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12.3 Referential integrity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12.4 Triggers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12.5 Temporal data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12.6 In-memory tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12.7 Table check constraints . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12.8 DSNULI . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12.9 RELEASE(DEALLOCATE) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12.10 INCLUDE columns . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12.11 Scrollable cursors . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12.12 DB2 built-in functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12.13 Non-padded indexes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12.14 Clustering index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12.14.1 Natural keys versus surrogate keys . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12.15 Materialized query tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12.16 Compression . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12.17 Append processing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12.17.1 Member Cluster . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12.17.2 APPEND option of CREATE and ALTER table. . . . . . . . . . . . . . . . . . . . . . . .12.18 Temporary tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12.18.1 Created temporary tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12.18.2 Declared temporary tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12.19 Clone tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12.20 Large data support . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12.20.1 Partitioned table spaces . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12.21 Storing LOB data. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .12.22 Storing XML data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10211211213213213214214214215217217217218218Part 5. Appendixes . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219Appendix A. IBM Information Management Services Migration Practice . . . . . . . . .Strategy for a successful migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Customer partnering is a key element to success . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Migration strategy. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Phase zero . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Contents221222222224226vii

Calibration, design, and planning phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .Conversion phase . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Streamline Business with Consolidation and Conversion to DB2 for z/OS Paolo Bruni Marcos Caurim Elise Gotay Susan Lawson Glenn McGeoch Rebecca Poole Consolidate your investment in DB2 for z/OS Accelerate con