db2 udb v82 on the windows evironment

Upload: ricardo-ribeiro

Post on 28-Feb-2018

242 views

Category:

Documents


2 download

TRANSCRIPT

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    1/370

    ibm.com/redbooks

    Draft Document for Review September 22, 2004 3:24 pm SG24-7102-00

    DB2 UDB V8.2 on theheWindows Environmentvironment

    Whei-Jen Chen

    Ajit Mungale

    Carlos Raymundo

    Andreas Thuering

    Experience the power of Stinger on

    Windows environment

    Application development using

    DB2 with .NET and Java

    Leverage DB2s powerful

    autonomic technology

    Front cover

    http://www.redbooks.ibm.com/http://www.redbooks.ibm.com/http://www.redbooks.ibm.com/http://www.redbooks.ibm.com/
  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    2/370

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    3/370

    DB2 UDB V8.2 on the Windows Environment

    September 2004

    International Technical Support Organization

    Draft Document for Review September 22, 2004 3:24 pm 7102edno.fm

    SG24-7102-00

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    4/370

    7102edno.fm Draft Document for Review September 22, 2004 3:24 pm

    Copyright International Business Machines Corporation 2004. All rights reserved.

    Note to U.S. Government Users Restricted Rights -- Use, duplication or disclosure restricted by GSA ADPSchedule Contract with IBM Corp.

    First Edition (September 2004)

    This edition applies to DB2 Universal Database Version 8.2 for use with Microsoft OperatingSystem Windows 2000 Server and Window Server 2003.

    This document created or updated on September 22, 2004.

    Note: Before using this information and the product it supports, read the information inNotices on page xv.

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    5/370

    Copyright IBM Corp. 2004. All rights reserved. iii

    Draft Document for Review September 22, 2004 3:24 pm 7102TOC.fm

    Contents

    Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . vii

    Tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii

    Notices . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvTrademarks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xvi

    Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviiThe team that wrote this redbook. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xviii

    Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xixBecome a published author . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xixComments welcome. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xx

    Chapter 1. Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11.1 DB2 UDB overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2

    1.1.1 DB2 technology strategy priorities . . . . . . . . . . . . . . . . . . . . . . . . . . . 21.1.2 DB2 family. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31.1.3 DB2 UDB products for Windows . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 91.1.4 Try and buy product availability. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    1.2 DB2 UDB version 8.2 technology highlights . . . . . . . . . . . . . . . . . . . . . . . 111.2.1 SQL enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 111.2.2 Security enhancements. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141.2.3 Business intelligence enhancements . . . . . . . . . . . . . . . . . . . . . . . . 151.2.4 Autonomic computing enhancements . . . . . . . . . . . . . . . . . . . . . . . . 161.2.5 Usability enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

    1.2.6 High Availability enhancements . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

    1.3 DB2 UDB V8.2 integration with Microsoft Windows . . . . . . . . . . . . . . . . . 231.3.1 System security. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231.3.2 Application development . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

    Chapter 2. installation and migration. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272.1 DB2 UDB V8.2 Installation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28

    2.1.1 Installation overview for DB2 on Windows . . . . . . . . . . . . . . . . . . . . 282.1.2 DB2 UDB V8.2 server installation . . . . . . . . . . . . . . . . . . . . . . . . . . . 312.1.3 DB2 UDB V8.2 client installation. . . . . . . . . . . . . . . . . . . . . . . . . . . . 36

    2.2 Migration . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 412.2.1 Migrating DB2 between versions of Windows. . . . . . . . . . . . . . . . . . 41

    2.2.2 Migrating between versions of DB2 UDB . . . . . . . . . . . . . . . . . . . . . 482.2.3 Migrating from 32-bit to 64-bit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    6/370

    7102TOC.fm Draft Document for Review September 22, 2004 3:24 pm

    iv DB2 UDB V8.2 on the Windows Environment

    2.2.4 Migrating everything at once. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

    Chapter 3. Administration and management. . . . . . . . . . . . . . . . . . . . . . . 533.1 Backup, recovery, and logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

    3.1.1 Automated backup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 543.1.2 Self-tuning backup and restore . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 643.1.3 Backup compression. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66

    3.1.4 Logs in backup images . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 673.2 Automated log file management . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 683.3 RECOVER command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 693.4 Automated table maintenance. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

    3.4.1 Automatic statistic collection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 70

    3.4.2 Automatic statistic profiling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 76

    3.4.3 Automatic reorganization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 803.5 Integrated Design Advisor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86

    Chapter 4. Security. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1174.1 Windows Domain handling and user IDs . . . . . . . . . . . . . . . . . . . . . . . . 118

    4.1.1 Improved Windows Domain and Active Directory support . . . . . . . 1184.1.2 User ID and group name enhancements . . . . . . . . . . . . . . . . . . . . 127

    4.2 Running DB2 under the local system account . . . . . . . . . . . . . . . . . . . . 1314.3 Protecting DB2 UDB system files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 135

    4.4 Using DB2 with data encryption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1384.5 The new DB2 security exit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141

    4.5.1 DB2 authentication before version 8.2 . . . . . . . . . . . . . . . . . . . . . . 1414.5.2 The new DB2 authentication model in version 8.2 . . . . . . . . . . . . . 1424.5.3 The DB2 security plug-ins . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1434.5.4 Developing Security plug-ins. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1524.5.5 Deploying a userid/password plug-in . . . . . . . . . . . . . . . . . . . . . . . 1574.5.6 Deploying a group retrieval plug-in . . . . . . . . . . . . . . . . . . . . . . . . . 158

    4.5.7 Deploying a GSS-API plug-in . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 158

    4.5.8 Error Handling. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 160

    Chapter 5. Performance and monitoring. . . . . . . . . . . . . . . . . . . . . . . . . . 1615.1 SQL query optimization enhancements . . . . . . . . . . . . . . . . . . . . . . . . . 162

    5.1.1 Native SQL procedures. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1625.1.2 SQL statement size limit increased to 2 MB . . . . . . . . . . . . . . . . . . 1625.1.3 Data sampling in SQL queries . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1625.1.4 Dynamic SQL re-optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1655.1.5 Specifying a lock wait mode strategy . . . . . . . . . . . . . . . . . . . . . . . 1665.1.6 Improved query execution plans . . . . . . . . . . . . . . . . . . . . . . . . . . . 1675.1.7 Multipage file allocation on SMS table spaces . . . . . . . . . . . . . . . . 167

    5.1.8 Automatic setting of table space prefetch size . . . . . . . . . . . . . . . . 1675.2 Multi Dimension Clustering tables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    7/370

    Contents v

    Draft Document for Review September 22, 2004 3:24 pm 7102TOC.fm

    5.2.1 MDC performance recommendations . . . . . . . . . . . . . . . . . . . . . . . 170

    5.3 Improvement of the RUNSTATS utility . . . . . . . . . . . . . . . . . . . . . . . . . . 1715.3.1 Improved RUNSTATS performance through sampling . . . . . . . . . . 1715.3.2 Throttling of the RUNSTATS utility . . . . . . . . . . . . . . . . . . . . . . . . . 172

    5.4 DB2 Performance Elements in Windows . . . . . . . . . . . . . . . . . . . . . . . . 1735.5 DB2 Activity Monitor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 176

    Chapter 6. High availability. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1916.1 HADR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1926.2 Automatic client reroute. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2176.3 Index logging . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 220

    Chapter 7. Using DB2 with Java. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2237.1 Java Database Connectivity (JDBC). . . . . . . . . . . . . . . . . . . . . . . . . . . . 224

    7.1.1 Types of JDBC driver: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2247.1.2 Writing a JDBC application . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225

    7.2 SQL Java (SQLJ) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2337.2.1 Writing SQLJ application. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 234

    Chapter 8. Using DB2 with .NET framework. . . . . . . . . . . . . . . . . . . . . . . 2398.1 An Overview of ADO.NET. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2408.2 ADO.NET architecture. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240

    8.2.1 Connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2418.2.2 Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242

    8.2.3 DataReader. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2448.2.4 DataAdapter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2448.2.5 DataSet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246

    8.3 Connecting to the database . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2468.4 Data Providers for DB2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247

    8.4.1 OLE DB .NET Data Provider. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 248

    8.4.2 ODBC .NET Data Provider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251

    8.4.3 DB2 .NET Data Provider . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2578.4.4 Comparison between Providers . . . . . . . . . . . . . . . . . . . . . . . . . . . 260

    8.5 Performing operation on DB2 database . . . . . . . . . . . . . . . . . . . . . . . . . 2618.5.1 Using DataAdapter and DataSet (Disconnected model). . . . . . . . . 2618.5.2 Calling Stored Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2648.5.3 Controlling transaction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2668.5.4 Using Large Objects (LOBs) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2688.5.5 Binding Data Controls with ADO.NET. . . . . . . . . . . . . . . . . . . . . . . 2718.5.6 Accessing DB2 with Web Forms. . . . . . . . . . . . . . . . . . . . . . . . . . . 281

    8.6 Add-in and stored procedure in CLR. . . . . . . . . . . . . . . . . . . . . . . . . . . . 2818.6.1 IBM DB2 Development Add-In overview. . . . . . . . . . . . . . . . . . . . . 281

    8.6.2 DB2 Tools toolbar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2828.6.3 DB2 Project type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 282

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    8/370

    7102TOC.fm Draft Document for Review September 22, 2004 3:24 pm

    vi DB2 UDB V8.2 on the Windows Environment

    8.6.4 Data Connections folder in the IBM Explorer . . . . . . . . . . . . . . . . . 284

    8.6.5 DB2 SQL Editor. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2858.7 Developing DB2 stored procedures in .NET . . . . . . . . . . . . . . . . . . . . . . 285

    8.7.1 Save and build the solution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 290

    Chapter 9. Consuming DB2 Web Services in .NET . . . . . . . . . . . . . . . . . 2979.1 Web services and DB2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 298

    9.2 Web Object Runtime Framework (WORF) . . . . . . . . . . . . . . . . . . . . . . . 2999.2.1 Document access definition extension (DADX) . . . . . . . . . . . . . . . 2999.2.2 DB2 XML Extender . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3019.2.3 How WORF process a Web service request?. . . . . . . . . . . . . . . . . 3029.2.4 Setting up WORF environment for Windows . . . . . . . . . . . . . . . . . 303

    9.2.5 Creating and deploying DB2 WORF Service . . . . . . . . . . . . . . . . . 306

    9.3 Consuming DADX Web service using .NET client . . . . . . . . . . . . . . . . . 315

    Chapter 10. Problem resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31910.1 RAS. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32010.2 PD/PSI. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32010.3 Information to collect . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32010.4 db2support utility . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32210.5 Understanding DB2DIAG.LOG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32210.6 DB2DIAG tool . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 326

    10.7 Prevention versus resolution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 328

    Related publications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335IBM Redbooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335Other publications . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 335Online resources . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 336How to get IBM Redbooks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337

    Help from IBM . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 337

    Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    9/370

    Copyright IBM Corp. 2004. All rights reserved. vii

    Draft Document for Review September 22, 2004 3:24 pm 7102LOF.fm

    Figures

    2-1 Generating a response file through DB2 Setup Wizard. . . . . . . . . . . . . 312-2 DB2 Setup Launchpad. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 322-3 DB2 Run Time Lite Client Choose Language . . . . . . . . . . . . . . . . . . . . 372-4 DB2 Run Time Lite Client Setup Welcome . . . . . . . . . . . . . . . . . . . . . . 372-5 DB2 Development Client Setup Launchpad . . . . . . . . . . . . . . . . . . . . . 392-6 Backup and restore combinations with DB2 UDB V8.1 for Windows . . 422-7 Executing the db2relocatedb command. . . . . . . . . . . . . . . . . . . . . . . . . 472-8 DB2 migrate command syntax. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 50

    3-1 Starting configure Automatic Maintenance . . . . . . . . . . . . . . . . . . . . . . 553-2 Configure automatic maintenance - Introduction . . . . . . . . . . . . . . . . . . 56

    3-3 Select automatic maintenance type. . . . . . . . . . . . . . . . . . . . . . . . . . . . 573-4 Specify when automatic maintenance will run . . . . . . . . . . . . . . . . . . . . 58

    3-5 Specify maintenance window. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 593-6 Manage the notification list . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 603-7 Select maintenance activity to configure . . . . . . . . . . . . . . . . . . . . . . . . 613-8 Configure settings - Backup Database (BACKUP) . . . . . . . . . . . . . . . . 62

    3-9 Review the automatic maintenance settings . . . . . . . . . . . . . . . . . . . . . 63

    3-10 Automatic statistic collection overview. . . . . . . . . . . . . . . . . . . . . . . . . . 713-11 Automated runstats - select activity . . . . . . . . . . . . . . . . . . . . . . . . . . . . 733-12 Automated runstats - configure setting . . . . . . . . . . . . . . . . . . . . . . . . . 743-13 Automated runstats - summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 753-14 Automated statistics profiling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 77

    3-15 Stored RUNSTATS profile in SYSIBM.SYSTABLES. . . . . . . . . . . . . . . 803-16 Automatic reorg evaluation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 813-17 Automated reorg - specify offline maintenance window. . . . . . . . . . . . . 82

    3-18 Automated reorg - select activity . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 833-19 Automated reorg - configure setting. . . . . . . . . . . . . . . . . . . . . . . . . . . . 843-20 Automated reorg - summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 85

    3-21 Show the different sources to get SQL statements for you workload . . 893-22 Selecting the Design Advisor from the DB2 Control Center . . . . . . . . . 903-23 Select the DB2 Design Advisor from the Tools menu . . . . . . . . . . . . . . 913-24 Introduction to the Design Advisor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 923-25 Design Advisor features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 933-26 Defining a new workload . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 94

    3-27 Select the import source for your workload . . . . . . . . . . . . . . . . . . . . . . 953-28 importing a workload file . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 963-29 Adjust the frequency of your SQL statement . . . . . . . . . . . . . . . . . . . . . 973-30 The workload dialog if there are already specified workloads available 98

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    10/370

    7102LOF.fm Draft Document for Review September 22, 2004 3:24 pm

    viii DB2 UDB V8.2 on the Windows Environment

    3-31 Change an already existing workload . . . . . . . . . . . . . . . . . . . . . . . . . . 99

    3-32 Use Explained SQL Statements for your workload . . . . . . . . . . . . . . . 1003-33 Using SQL statements for your workload captured by the Event Monitor .1013-34 Update the catalog statistics by doing RUNSTATS before the run . . . 1023-35 Specify the recommendation options. . . . . . . . . . . . . . . . . . . . . . . . . . 1033-36 Adjust the calculation recommendations . . . . . . . . . . . . . . . . . . . . . . . 104

    3-37 Design Advisor Recommendations . . . . . . . . . . . . . . . . . . . . . . . . . . . 1053-38 DDL statements generated by the Design Advisor . . . . . . . . . . . . . . . 1063-39 Details of the calculation before and after the run of the workload . . . 1063-40 Errors in a workloads SQL statements . . . . . . . . . . . . . . . . . . . . . . . . 1073-41 The SQL statement which caused the error . . . . . . . . . . . . . . . . . . . . 108

    3-42 Review unused database objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . 109

    3-43 Scheduling to create the Design Advisor recommended objects. . . . . 1103-44 Create the Tools Catalog database to enable the DB2 Scheduling function1113-45 Create the Tools Catalog database . . . . . . . . . . . . . . . . . . . . . . . . . . . 1123-46 An excerpt of a DB2 Design Advisor recommendation report . . . . . . . 113

    3-47 Advanced Scheduling . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1143-48 The created recommendation run task in the DB2 Task Center . . . . . 1154-1 Topology of the Active Directory domain db2test.almaden.ibm.com. . 1214-2 A user in a global group which is not directly authorized in DB2 UDB. 122

    4-3 The DB2_SAMPLE_READERS group which is authorized in DB2 UDB. .1234-4 Connect authorizations for the DB2_SAMPLE_READERS group. . . . 1244-5 DB2_SAMPLE_READERS table authorizations . . . . . . . . . . . . . . . . . 1254-6 Local group DB2_SAMPLE_READERS on Server LOCHNESS. . . . . 1264-7 User IDs taken from the local SAM of the server LOCHNESS . . . . . . 1274-8 Logon with a user name with special characters in DB2 Control Center . .128

    4-9 Long user names . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1294-10 Long group names. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1304-11 Logon with a long user name in DB2 Control Center specifying domain. .1304-12 DB2 processes in Windows Task Manager . . . . . . . . . . . . . . . . . . . . . 1324-13 DB2 Services before changing to the LocalSystem account . . . . . . . . 133

    4-14 Stop the DB2 Services. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1344-15 Changing DB2 Services to Local System account. . . . . . . . . . . . . . . . 1354-16 Protection of the DB2 instance directories. . . . . . . . . . . . . . . . . . . . . . 136

    4-17 Protected DB2 system files . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1374-18 Activation the data encryption functionality on a DB2 server. . . . . . . . 1394-19 Setting security options when cataloging a database . . . . . . . . . . . . . 1404-20 The IBM directory for the DB2 default security plug-ins. . . . . . . . . . . . 144

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    11/370

    Figures ix

    Draft Document for Review September 22, 2004 3:24 pm 7102LOF.fm

    4-21 Security plug-in architecture on the DB2 Client . . . . . . . . . . . . . . . . . . 146

    4-22 Client-side plug-in functionality . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1474-23 The IBM client plug-in directory . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1484-24 Security plug-in architecture on the DB2 Server . . . . . . . . . . . . . . . . . 1494-25 Functionality of the Server-side plug-in . . . . . . . . . . . . . . . . . . . . . . . . 1504-26 New authentication plug-in parameters in database configuration manager153

    5-1 Different results in data sampling. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1645-2 A regular table with a clustering index . . . . . . . . . . . . . . . . . . . . . . . . . 1695-3 A multidimensional clustering table . . . . . . . . . . . . . . . . . . . . . . . . . . . 1695-4 Performance screen of the Task Manager. . . . . . . . . . . . . . . . . . . . . . 1745-5 Database Manager Instance Performance counters. . . . . . . . . . . . . . 175

    5-6 Database Manager instance performance counters . . . . . . . . . . . . . . 176

    5-7 Activity Monitor Setup Wizard.. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1775-8 Activity Monitor - Introduction. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1785-9 Selecting Monitoring Task . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1795-10 Filter selection screen . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1805-11 Top CPU-time consuming applications . . . . . . . . . . . . . . . . . . . . . . . . 181

    5-12 Selecting lock chains for an application. . . . . . . . . . . . . . . . . . . . . . . . 1825-13 Application lock chains. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1835-14 Show Lock Details . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1845-15 Application lock details. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 185

    5-16 Show application statement. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1865-17 Explain SELECT SQL statement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1875-18 Explain SQL Statement setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1885-19 Access plan . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1896-1 HADR implementation . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1926-2 Invoking HADR Setup wizard from Tools bar . . . . . . . . . . . . . . . . . . . 1936-3 Invoking HADR Setup wizard. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1946-4 HADR Database Selection. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 194

    6-5 HADR Introduction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1956-6 HADR: Confirm the primary database selection . . . . . . . . . . . . . . . . . 1966-7 HADR: Identify a standby database. . . . . . . . . . . . . . . . . . . . . . . . . . . 1976-8 HADR: Specify a backup image of the primary database . . . . . . . . . . 1986-9 HADR: Restore database on standby system . . . . . . . . . . . . . . . . . . . 1996-10 HADR: Copy objects to the standby system . . . . . . . . . . . . . . . . . . . . 200

    6-11 HADR: Specify TCP/IP communication parameters . . . . . . . . . . . . . . 2016-12 HADR: Configure databases for automatic client reroute . . . . . . . . . . 2026-13 HADR: specify synchronization mode . . . . . . . . . . . . . . . . . . . . . . . . . 203

    6-14 HADR: Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2046-15 HADR: Perform HADR setup . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2066-16 HADR setup completed successfully . . . . . . . . . . . . . . . . . . . . . . . . . . 2076-17 HADR: Managing HADR . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 208

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    12/370

    7102LOF.fm Draft Document for Review September 22, 2004 3:24 pm

    x DB2 UDB V8.2 on the Windows Environment

    6-18 HADR: TAKEHOVER. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 211

    6-19 HADR Example - Create table. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2126-20 HADR example - take over the primary system. . . . . . . . . . . . . . . . . . 2136-21 HADR example: start old primary as standby . . . . . . . . . . . . . . . . . . . 2136-22 HADR example: Old primary now is the standby. . . . . . . . . . . . . . . . . 2146-23 HADR example: Switch the roles back to original setup . . . . . . . . . . . 2158-1 ADO.NET. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 240

    8-2 ADO.NET architecture . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2418-3 Relation between Data consumer, Provider and Database . . . . . . . . . 2478-4 Providers in .NET to connect DB2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2488-5 ODBC Data Source Administrator. . . . . . . . . . . . . . . . . . . . . . . . . . . . 252

    8-6 Create New Data Source. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253

    8-7 Add ODBC IBM DB2 driver . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 253

    8-8 ODBC Data Source Administrator . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2548-9 Test connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2558-10 Add Reference. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2588-11 Output of using DataTable and DataRow to populate data . . . . . . . . . 2638-12 XML returned by GETXML() method . . . . . . . . . . . . . . . . . . . . . . . . . . 264

    8-13 Employee Information . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2698-14 8.10 dbControls . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2728-15 DB2 Data Adapter Configuration Wizard . . . . . . . . . . . . . . . . . . . . . . . 2738-16 DB2 Data Adapter Configuration Wizard - Step 1 . . . . . . . . . . . . . . . . 274

    8-17 DB2 Data Adapter Configuration Wizard - Step 2 . . . . . . . . . . . . . . . . 2758-18 DB2 Data Adapter Configuration Wizard - Step 3 . . . . . . . . . . . . . . . . 276

    8-19 DB2 Data Adapter Configuration Wizard - Finish . . . . . . . . . . . . . . . . 2778-20 DB2DataAdpater and Db2Connection created . . . . . . . . . . . . . . . . . . 2788-21 Generate Data Set . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2798-22 db2DataSet1 created. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2798-23 Drop DataGrid and text boxes on form . . . . . . . . . . . . . . . . . . . . . . . . 2808-24 Staff Information. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 281

    8-25 DB2 tool bar . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2828-26 IBM project folder. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2838-27 DB2 project type . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2848-28 IBM Explorer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2858-29 Open a DB2 project . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2868-30 DB2 Data connection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 286

    8-31 DB2 project created in Solution Explorer . . . . . . . . . . . . . . . . . . . . . . . 2878-32 Solution Explorer - db2Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2888-33 Project Dependencies - db2Class . . . . . . . . . . . . . . . . . . . . . . . . . . . . 289

    8-34 Add New Item - db2Project.db2p. . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2918-35 DB2 CLR Procedure Wizard . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2928-36 CLR Method Seleciton . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2928-37 CLR Procedure wizard - Specifications . . . . . . . . . . . . . . . . . . . . . . . . 293

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    13/370

    Figures xi

    Draft Document for Review September 22, 2004 3:24 pm 7102LOF.fm

    8-38 DB2 CLR Proceudre wizard - Summary . . . . . . . . . . . . . . . . . . . . . . . 294

    8-39 CLR Assemblies . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2958-40 Created stored procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2958-41 Parameter Values . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2969-1 Web services Consumer and Provider . . . . . . . . . . . . . . . . . . . . . . . 2989-2 DADX File and elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3019-3 browsing DADX file from browser . . . . . . . . . . . . . . . . . . . . . . . . . . . . 301

    9-4 WORF processes a Web service request . . . . . . . . . . . . . . . . . . . . . . 3029-5 Web Services Listing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3079-6 Web directory. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3089-7 empInfo.dadx with TEST command. . . . . . . . . . . . . . . . . . . . . . . . . . . 3139-8 WSDL sample . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 314

    9-9 Add Web Reference. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 316

    9-10 Solution Explorer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3179-11 Net Console output . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31810-1 Control Center inform about 2 Health Center Alerts . . . . . . . . . . . . . . 32910-2 DB2 pop-up message informing that there are alerts in Health Centre.33010-3 Application section of Event Viewer showing DB2-0 service related events

    33110-4 Health Center Alert logged in the Event Log.. . . . . . . . . . . . . . . . . . . . 33210-5 Log Full error logged in the Event Viewer.. . . . . . . . . . . . . . . . . . . . . . 333

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    14/370

    7102LOF.fm Draft Document for Review September 22, 2004 3:24 pm

    xii DB2 UDB V8.2 on the Windows Environment

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    15/370

    Copyright IBM Corp. 2004. All rights reserved. xiii

    Draft Document for Review September 22, 2004 3:24 pm 7102LOT.fm

    Tables

    4-1 client API functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1554-2 Server plug-in API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1564-3 Group plug-in API . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1567-1 Java packages. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2257-2 DataSource provided by DB2 JDBC Driver . . . . . . . . . . . . . . . . . . . . . 2277-3 Difference betwwen SQLJ and JDBC . . . . . . . . . . . . . . . . . . . . . . . . . 2348-1 Connection object properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2428-2 Connection object methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 242

    8-3 Command object properties. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2438-4 Command object methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 243

    8-5 DataReader class properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2448-6 DataReader methods. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2448-7 DataAdapter properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2458-8 DataAdapter methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2458-9 DataSet properties . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 2468-10 DataSet methods . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 246

    8-11 Provider code level comparison. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 260

    8-12 .NET provider functionality comparison . . . . . . . . . . . . . . . . . . . . . . . . 2619-1 DAX operations and elements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3009-2 JAR files. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3049-3 Properties in group.properties file . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3109-4 SQL and XML schema type. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 312

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    16/370

    7102LOT.fm Draft Document for Review September 22, 2004 3:24 pm

    xiv DB2 UDB V8.2 on the Windows Environment

    f f S 7102 f

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    17/370

    Draft Document for Review September 22, 2004 3:24 pm 7102spec.fm

    Copyright IBM Corp. 2004. All rights reserved. xv

    Notices

    This information was developed for products and services offered in the U.S.A.

    IBM may not offer the products, services, or features discussed in this document in other countries. Consultyour local IBM representative for information on the products and services currently available in your area.Any reference to an IBM product, program, or service is not intended to state or imply that only that IBMproduct, program, or service may be used. Any functionally equivalent product, program, or service thatdoes not infringe any IBM intellectual property right may be used instead. However, it is the user'sresponsibility to evaluate and verify the operation of any non-IBM product, program, or service.

    IBM may have patents or pending patent applications covering subject matter described in this document.The furnishing of this document does not give you any license to these patents. You can send licenseinquiries, in writing, to:IBM Director of Licensing, IBM Corporation, North Castle Drive Armonk, NY 10504-1785 U.S.A.

    The following paragraph does not apply to the United Kingdom or any other country where such provisionsare inconsistent with local law: INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDESTHIS PUBLICATION "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF NON-INFRINGEMENT,MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Some states do not allow disclaimerof express or implied warranties in certain transactions, therefore, this statement may not apply to you.

    This information could include technical inaccuracies or typographical errors. Changes are periodically madeto the information herein; these changes will be incorporated in new editions of the publication. IBM maymake improvements and/or changes in the product(s) and/or the program(s) described in this publication atany time without notice.

    Any references in this information to non-IBM Web sites are provided for convenience only and do not in anymanner serve as an endorsement of those Web sites. The materials at those Web sites are not part of thematerials for this IBM product and use of those Web sites is at your own risk.

    IBM may use or distribute any of the information you supply in any way it believes appropriate withoutincurring any obligation to you.

    Information concerning non-IBM products was obtained from the suppliers of those products, their publishedannouncements or other publicly available sources. IBM has not tested those products and cannot confirm

    the accuracy of performance, compatibility or any other claims related to non-IBM products. Questions onthe capabilities of non-IBM products should be addressed to the suppliers of those products.

    This information contains examples of data and reports used in daily business operations. To illustrate themas completely as possible, the examples include the names of individuals, companies, brands, and products.All of these names are fictitious and any similarity to the names and addresses used by an actual businessenterprise is entirely coincidental.

    COPYRIGHT LICENSE:This information contains sample application programs in source language, which illustrates programmingtechniques on various operating platforms. You may copy, modify, and distribute these sample programs inany form without payment to IBM, for the purposes of developing, using, marketing or distributing application

    programs conforming to the application programming interface for the operating platform for which thesample programs are written. These examples have not been thoroughly tested under all conditions. IBM,therefore, cannot guarantee or imply reliability, serviceability, or function of these programs. You may copy,modify, and distribute these sample programs in any form without payment to IBM for the purposes ofdeveloping, using, marketing, or distributing application programs conforming to IBM's applicationprogramming interfaces.

    7102spec fm Draft Doc ment for Re ie September 22 2004 3 24 pm

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    18/370

    7102spec.fm Draft Document for Review September 22, 2004 3:24 pm

    xvi DB2 UDB V8.2 on the Windows Environment

    Trademarks

    The following terms are trademarks of the International Business Machines Corporation in the United States,other countries, or both:

    AIX

    AS/400DB2 ConnectDB2 ExtendersDB2 Universal DatabaseDB2DRDAEserverEveryplaceHACMPibm.com

    IBM

    IMSInformixIntelligent MineriSeriesMVSNet.DataNetfinityNetVistaOS/390Perform

    Redbooks (logo)

    RedbooksRETAINS/390SQL/400TMEWebSpherexSeriesz/OS

    The following terms are trademarks of other companies:

    Intel, Intel Inside (logos), MMX, and Pentium are trademarks of Intel Corporation in the United States, othercountries, or both.

    Microsoft, Windows, Windows NT, and the Windows logo are trademarks of Microsoft Corporation in theUnited States, other countries, or both.

    Java and all Java-based trademarks and logos are trademarks or registered trademarks of SunMicrosystems, Inc. in the United States, other countries, or both.

    UNIX is a registered trademark of The Open Group in the United States and other countries.

    SET, SET Secure Electronic Transaction, and the SET Logo are trademarks owned by SET SecureElectronic Transaction LLC.

    Other company, product, and service names may be trademarks or service marks of others.

    Draft Document for Review September 22 2004 3:24 pm 7102pref fm

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    19/370

    Copyright IBM Corp. 2004. All rights reserved. xvii

    Draft Document for Review September 22, 2004 3:24 pm 7102pref.fm

    Preface

    This redbook provides updated information of DB2 UDB V8.2 for Windowsenvironment. This book is organized as follows.

    Chapter 1 IntroductionIn this chapter we introduces the DB2 technology strategy for the IBM DB2family especially the DB2 Universal Database (UDB) version 8.2. It provides ahigh level description of the new features and functions introduced in DB2UDB version 8.2 and how the new capabilities and features of DB2 UDB v 8.2integrate with Windows Server 2003 and Visual Studio 2003.

    Chapter 2 Installation and migrationIn this chapter we describe the basic procedures of installing 32-bit DB2 UDBVersion 8.2 on Windows Server 2003. We also provide steps for variousmigration scenarios.

    Chapter 3 Administration and management

    In this chapter we discuss the DB2 UDB V8.2 advancements in administrationand management. The autonomic and management enhancements make theDBAs job easier then ever.

    Chapter 4 SecurityIn this chapter we discuss the new security enhancements of DB2 UDB V8.2in the Windows environment such as active directory domains support, dataencryption, and security plug-ins.

    Chapter 5 Performance and monitoring

    In this chaper we provide information about the new performanceenhancements of the DB2 UDB Version 8.2. The monitoring tool ActivityMonitor is also discussed.

    Chapter 6 High availabilityThis chapter covers the new high availability features in the new release ofDB2 UDB including High Availability Disaster Recovery (HADR) feature,Automatic Client Reroute, and Index logging.

    Chapter 7 Using DB2 with JavaIn this chapter we discuss various ways to use Java Database Connectivity(JDBC) to perform operations on the database and Structured QueryLanguage for Java (SQLJ).

    Chapter 8 Using DB2 with .NET frameworkIn this chapter we discuss various features available for .NET applicationdevelopers. Topics covered are ADO.NET, various Providers, and applicationdevelopment using DB2 .NET Provider.

    7102pref fm Draft Document for Review September 22 2004 3:24 pm

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    20/370

    7102pref.fm Draft Document for Review September 22, 2004 3:24 pm

    xviii DB2 UDB V8.2 on the Windows Environment

    Chapter 9 Consuming DB2 Web Services in .NET

    In this chapter we introduce Web Object Runtime Framework (WORF) andshow you how to use DB2 as Web service provider as well as consumer.

    Chapter 10 Problem resolution

    In this chapter we introduce the enhanced DB2 diagnostic log and new toolsfor examining DB2 diagnostic log.

    The team that wrote this redbook

    This redbook was produced by a team of specialists from around the worldworking at the International Technical Support Organization, San Jose Center.

    Whei-Jen Chenis a Project Leader at the International Technical SupportOrganization, San Jose Center. She has extensive experience in applicationdevelopment, database design and modeling, and DB2 system administration.Whei-Jen is an IBM Certified Solutions Expert in Database Administration andApplication Development as well as an IBM Certified IT specialist.

    Ajit Mungalehas been working with IBM GSI as a Senior Software Engineer. Hehas extensive experience with Microsoft technologies and has worked withalmost all languages and technologies. He also has experience with IBM

    products, including IBM WebSphere and MQ. He is author of couple of otherbooks and published articles on Microsoft .NET.

    Carlos RaymondoCarlos Raymundo is a Independent Senior Consulting ITSpecialist at Trujillo Peru. He has 14 years of experience providing technicalsupport across a variety of products and technologies in Database ManagementSystems. He has over 11 years of experience as a professor at the Computingand System Department at the Antenor Orrego University. He holds a Mastersdegree in Management Information Systems from the Instituto Tecnologico deMonterrey and the Antenor Orrego University, and is candidate for a Doctoraldegree in System Engineering with major in Computing from the FedericoVillareal National University. Also he holds several Industrial certifications in ITproducts like IBM Certified Database Administrator, Oracle DatabaseAdministrator Master and Microsoft Certified System Engineering. He can bereached at [email protected].

    Andreas Thueringis a Senior IT Specialist at IBM Global Services in Basel,Switzerland. He has 18 years IT experience in the areas of applicationdevelopment, middleware implementation, database modelling, design andadministration on the Linux, AIX and Windows platforms. He has knowledge ofseveral database systems and programming environments with differentlanguages. Andreas works with DB2 on distributed platforms since 1995. He has

    Draft Document for Review September 22, 2004 3:24 pm 7102pref.fm

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    21/370

    Preface xix

    a ocu e o e e Sep e be , 00 3 p 7102pref.fm

    project experience in the insurance, pharmaceutical, healthcare,telecommunications and energy industries. .

    Acknowledgements

    The authors express their deep gratitude for the help they received from thefollowing people. They contributed advice, support and written content.

    Il-sung Lee isan IBM DB2 UDB developer. One of his area of specialty is theDB2 UDB security.

    Volker Marklis an designer from IBM Almaden Research Center. One of hisspecialty is query optimization and self-managing databases

    Dale McInnis isan IBM DB2 UDB developer. Dales area of specialty is the DB2UDB backup, recovery and high availability.

    Jan Nelken isan IBM DB2 UDB and DM support. One of his area of specialty isproblem determination in DB2.

    We would also like to thank the following people for their support andcontributions:

    Mike LoganIBM DB2 Product Management and Marketing

    Andrew Hilden, Jackson Hui, Matt Huras, Leon Katsnelson, Desmond Lam, IvanLew, Garfield Lewis, Aslam Nomani, Jay Pederson, Hiep Phuong, Sam Qita,Scott Walkty, Shili YangIBM Toronto Labortory

    Michael Schenker, Dirk WollscheidIBM Silican Valley Labortory

    Emma JacobsInternational Technical Support Organization, San Jose Center

    Become a published author

    Join us for a two- to six-week residency program! Help write an IBM Redbookdealing with specific products or solutions, while getting hands-on experiencewith leading-edge technologies. You'll team with IBM technical professionals,Business Partners and/or customers.

    7102pref.fm Draft Document for Review September 22, 2004 3:24 pm

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    22/370

    p p p

    xx DB2 UDB V8.2 on the Windows Environment

    Your efforts will help increase product acceptance and customer satisfaction. Asa bonus, you'll develop a network of contacts in IBM development labs, andincrease your productivity and marketability.

    Find out more about the residency program, browse the residency index, and

    apply online at:ibm.com/redbooks/residencies.html

    Comments welcome

    Your comments are important to us!

    We want our Redbooks to be as helpful as possible. Send us your commentsabout this or other Redbooks in one of the following ways:

    Use the online Contact usreview redbook form found at:

    ibm.com/redbooks

    Send your comments in an Internet note to:

    [email protected]

    Mail your comments to:

    IBM Corporation, International Technical Support OrganizationDept. QXXE Building 80-E2650 Harry RoadSan Jose, California 95120-6099

    Draft Document for Review September 22, 2004 3:24 pm 7102ch01.fm

    http://www.redbooks.ibm.com/residencies.htmlhttp://www.redbooks.ibm.com/residencies.htmlhttp://www.redbooks.ibm.com/http://www.redbooks.ibm.com/http://www.redbooks.ibm.com/contacts.htmlhttp://www.redbooks.ibm.com/contacts.htmlhttp://www.redbooks.ibm.com/http://www.redbooks.ibm.com/http://www.redbooks.ibm.com/residencies.htmlhttp://www.redbooks.ibm.com/residencies.html
  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    23/370

    Copyright IBM Corp. 2004. All rights reserved. 1

    Chapter 1. Introduction

    In this chapter we introduce the DB2 technology strategy for the IBM DB2 familyespecially the DB2 Universal Database (UDB) version 8.2. We provide an high

    level description of the new features and functions introduced in DB2 UDBversion 8.2 and how the new capabilities and features of DB2 UDB V8.2 integratewith Windows Server 2003 and Visual Studio 2003.

    This chapter contains the following sections:

    DB2 UDB overview

    DB2 technology strategy priorities DB2 family DB2 UDB products for Windows

    DB2 UDB version 8.2 technology highlights

    SQL enhancements Security enhancements Business intelligences enhancements Automatic computing enhancements High availability enhancements

    DB2 UDB V8.2 integration with Microsoft Windows

    New features in Windows 2003 New features in Visual Studio 2003

    1

    7102ch01.fm Draft Document for Review September 22, 2004 3:24 pm

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    24/370

    2 DB2 UDB V8.2 on the Windows Environment

    1.1 DB2 UDB overview

    In this section we provide an introduction to the DB2 technology strategy, adescription of IBM DB2 family, specially the DB2 UDB for Windows.

    1.1.1 DB2 technology strategy priorities

    The DB2 UDB database is the most advanced self-managing, self-configuring,self-optimizing database in the world. The IBM DB2 technology strategy for thenext few years will be:

    Optimize for multiple workload environments

    From Palmtop to teraflop, DB2 supports various hardware platform. DB2 UDB

    provides different editions that are suited to different business needs andworkload environment. The highly scalable features allow the informationsystem to grow with business grows. The configuration, tuning, andmonitoring tools allow system supports and DBAs to optimize the databasesystems for multiple workload environments.

    Deliver optimized transparent access to all forms of digitized

    information

    IBM is the only company that supports a customer's complete enterprisecontent management requirements, including support for all forms ofinformation, document and records management, collaboration, Web content,information integration, digital rights management and storage. IBM DB2continuously delivers enterprise content management software which enablesclients to link their business processes and gain a seamless flow ofinformation across and beyond the enterprise.

    Ease application development

    In each release of DB2 UDB, IBM has brought application developmentfunctionality to a new level. The DB2 UDB V8.2 accelerates the applicationdevelopment life cycle by simplifying and minimizing the development cyclesand costs associated with building and deploying on demand e-businessdatabase applications. It provides significant new application developmentfunctionality such as new SQL features, seamless integration with Java andMicrosoft .NET development environment, and the new DB2 Run-Time ClientLite which makes building and redistributing DB2 applications easier.

    Minimize DBA skill requirements

    DB2 has been incorporating capabilities that have come from IBM's ongoing

    autonomic computing initiative for making computers more able toself-manage. New features like Configuration advisor, Design advisorprovided by each release of DB2 database server software will automate

    Draft Document for Review September 22, 2004 3:24 pm 7102ch01.fm

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    25/370

    Chapter 1. Introduction 3

    common administrative tasks and minimize DBA skill requirements, therebyreducing DB2 total cost of ownership.

    Deliver high quality database services

    DB2 is the core of a wide variety of data management products and solutions.

    With the strong commitment to research and development, IBM InformationManagement has delivered the high quality database services in the area ofbusiness intelligence, enterprise content and records management,federation and information integration.

    Be the best ISV partner

    IBM provides ISVs with comprehensive technical, marketing and salessupport to help meet the specific needs of medium sized businesses. Alignedwith this IBM strategy, DB2 UDB has continuously delivered functions and

    features which facilitate ISVs to provide customers with flexible and secureinformation management solutions that span multiple computing platforms,including Windows.

    1.1.2 DB2 family

    The IBM DB2 database software family is the worldwide leader in the industryand marks the next stage in the evolution of the relational database. DB2 is theindustry's first multimedia, Web-ready relational database management system

    delivering leading capabilities in reliability, performance, and scalability. DB2 isthe database of choice for customers and partners developing and deployingcritical solutions. The DB2 family is a consistent set of relational databasemanagement systems (RDBMS) utilizing shared technologies and a commonapplication programming interface.

    These are the specific RDBMS products that make up the DB2 family:

    DB2 Universal Database for z/OS and OS/390:The premier IBM enterpriseRDBMS for use on the mainframe to run powerful enterprise applications, and

    make large scale e-commerce a reality

    DB2 Universal Database for iSeries: An advanced, 64-bit relationaldatabase system that provides leading-edge performance in e-business anddata warehousing environments (the iSeries and DB2 UDB for iSeries incombination provide the flexibility and adaptability to support any type ofworkload, small or large)

    DB2 Server for VSE and VM:A full-function RDBMS supporting productionand interactive IBM VM and VSE environments for your company

    DB2 Everyplace:Mobile relational database and enterprise synchronizationarchitecture for mobile and embedded devices

    7102ch01.fm Draft Document for Review September 22, 2004 3:24 pm

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    26/370

    4 DB2 UDB V8.2 on the Windows Environment

    DB2 Universal Database V8.2:is the IBM object-relational database solutionfor the UNIX, Linux, and Windows operating environments. It is built on a solidfoundation, bringing together a client/server database product with IBM'sleadership in mission-critical relational database technology. The result is ahighly scalable, highly extensible, very easy-to-use and manage database

    that can be trusted with your most critical database applications. DB2 UDB isavailable on the following platforms:

    Windows NT/2000/XP/Server 2003, Windows 95/98/ME Linux (on Intel) Linux (on 390) AIX HP-UX Sun Solaris

    DB2 UDB capabilities and benefitsThe main capabilities and benefits of DB2 Universal Database are:

    Superior scalability

    One of the best benefits of DB2 UDB is the scalability. It can run on a laptopor mobile device supporting a mobile user, or it can run on a massivelyparallel machine such as SMPs (symmetric multiprocessors) and clusters ofSMPs to support multiple terabytes of data and thousands of users.

    DB2 UDB's scalability features can be grouped into three major capabilities:

    Advanced parallel processing High-performance computing Efficient large database operations

    Multimedia extensibility

    Another major benefit of DB2 UDB is extensibility, the key of this capability iscalled object-relational technology. We mean the ability to store and managenot only traditional relational tables with characters and numbers alsomultimedia, complex objects such as documents, images, audio, video,spatial information, time-series data, etc. This may also includeindustry-specific objects such as x-rays, fingerprints, engineering drawings,insurance claim forms, etc.

    DB2 UDB's object-relational capabilities allow you to add your own data typesand business functions to the database effectively tailoring the database tofit your specific business or application requirements.

    DB2 UDB's extensibility features can be grouped into the following categories:

    Universal data Business rules Advanced SQL

    Draft Document for Review September 22, 2004 3:24 pm 7102ch01.fm

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    27/370

    Chapter 1. Introduction 5

    DB2 Extenders

    Web enablement

    Customers need to be able to make the data stored in their DB2 databasesystems accessible to employees of the company, and selectively to their

    suppliers and customers through private network (intranet) and publicnetwork (Internet) applications. DB2 Universal Database is fully integratedwith Web technology so that data can be easily accessed from the Internet orfrom your intranet with complete security. The following facilities included withUDB allow you to Web-enable your database applications right out of the box:

    DB2 Java Support Net.Data A Webserver Database Gateway

    Partner solutions

    In order to implement a data management solution that meets the changingneeds of your business, you will need a robust relational database, andcarefully chosen applications to run against it. DB2 Universal Databaseprovides the rock-solid foundation required to successfully deploy enterprisesolutions, while thousands of ISVs (Independent Software Vendors) offer adiverse range of sophisticated applications that support DB2.

    In close partnership with IBM, leading software developers like Siebel, I2,SAP, Baan, Dassault, and PeopleSoft, develop enterprise resource planning

    (ERP) solutions and CRM solutions as well as B2B solutions and otherapplications that deliver the functionality your user base needs. Thesepremier ISVs recognize that DB2 Universal Database has the performance,reliability, and flexibility to meet the demands of today's operational andbusiness intelligence applications.

    For the most up-to-date information on solutions and to look through theon-line IBM Solutions Catalog, go to these two sites:

    http://www.software.ibm.com/data/partners/

    http://www.software.ibm.com/solutions/isv Business intelligence powerhouse

    By Business Intelligence (BI) we mean applications like data warehousing,data mining, on-line analytical process (OLAP), and decision support. Manycustomers are looking for ways to mine and analyze their operational data forcompetitive advantage. These are among the most important uses of datamanagement technology today because they provide customers withexcellent returns on their investment.

    Several factors make DB2 UDB an outstanding data store for BI applications:

    These applications often involve large volumes of data. Typical small tomedium size warehouses and datamarts might contain 50 GB to 300 GB.

    7102ch01.fm Draft Document for Review September 22, 2004 3:24 pm

    http://www.software.ibm.com/data/partners/http://www.software.ibm.com/solutions/isvhttp://www.software.ibm.com/solutions/isvhttp://www.software.ibm.com/solutions/isvhttp://www.software.ibm.com/data/partners/http://www.software.ibm.com/data/partners/
  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    28/370

    6 DB2 UDB V8.2 on the Windows Environment

    Large installations can contain several terabytes. UDB addresses theserequirements with its outstanding scalability, including advanced parallelquery and VLDB operations.

    Queries against the database tend to be very complex. UDB has the mostadvanced query optimizer in the industry, providing excellent queryperformance with a minimum of DBA time required for tuning.

    DB2 UDB has some features specifically designed to assist with on-lineanalytical processing (OLAP) support.

    DB2 also offers the Data Warehouse Manager feature, an integrated set oftools for building, managing, and maintaining data warehouses anddatamarts. The Warehouse Manager tool works with the WarehouseCenter, the integrated GUI tool which co-ordinates and automates theactivities needed to extract, clean, and populate the data into your

    informational data store.

    Advanced optimizer

    The DB2 SQL optimizer strengthens DB2's leadership position in queryoptimization for traditional applications and also extends for object-orientedapplications. This new optimization technology provides the function andperformance needed by customers to analyze and exploit vast amount ofvaluable information stored in their databases, such as decision supportapplications.

    The optimizer incorporates a very sophisticated query rewrite phase thatautomatically transforms a complex query into a simpler query that is easy tooptimize and search for the best query execution plan, as well as employingmore sophisticated techniques of modeling the cost of different ways offetching the data from disk. As a result, the end user will realize the bestpossible performance regardless of the way a query is structured.

    A related technology is DB2's support of Materialized Query Tables (MQT) orAutomated Summary Tables (AST). Using MQT queries that might take

    minutes or hours to complete can be shortened dramatically, often to secondsor even sub-second response times. This is done by precalculating summaryinformation into a summary table, then using the power of optimizer's queryrewriting to change the submitted query so that it retrieves the informationfrom the summary table, rather than recalculating it. Users don't have tochange their queries to take advantage of this performance improvement, it'shandled automatically by the DB2 optimizer once the administrator definesthe MQT.

    OLAP support

    Data warehouse and OLAP applications are characterized by the use of aspecial design technique, which is called star schema, to model relationaldata for multidimensional analysis (MDA). Under this schema it is common for

    Draft Document for Review September 22, 2004 3:24 pm 7102ch01.fm

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    29/370

    Chapter 1. Introduction 7

    a large fact table to be joined to multiple dimension tables in a verycomplex SQL join query. Any optimization techniques that can be used toimprove the performance of these joins can significantly improve theperformance of the overall application. DB2 Universal Database has specialoptimization techniques to do this:

    Index ANDing using dynamic bit mapsUDB uses dynamic bit-map technology to efficiently combine multipleindexes. Performance is improved for queries that use columns that arekey columns of different indexes over the same table. This includes theuse of indexes for multiway joins.

    Star joinsDB2's star join algorithm exploits dynamic bit maps to join a large facttable with a series of relatively small dimension tables, thus minimizing

    data I/O. Ease of use and management:DB2 Universal Database is one of the

    easiest databases in the industry to use and manage. It includes a completesuite of graphical tools to satisfy the needs of:

    Database administrators (DBAs) Application programmers

    It also includes tools to assist with client set-up and ad hoc query andreporting for end users.

    Administering databases with the DB2 Administration ToolsYou can administer local or remote servers using the DB2 AdministrationTools. Use the Control Center to perform administration tasks such asconfiguring DB2 instances and databases, backing up and recoveringdata, scheduling jobs, and managing media, all from a graphical interface.

    DB2 Autonomic computing technologyIBM has put a lot of research and development effort into providingAutonomic Computing functionality within DB2 making database

    administration more manageable, increase efficiencies and lower thecosts associated with managing an IT infrastructure as data managementsystems continue to grow in size and complexity

    Data access and replication

    DB2 Universal Database is a distributed, fully networked RDBMS. It providesyou with the flexibility of placing data anywhere in your network required foroptimum service and productivity, and provides efficient means for clients toaccess that data over the network. Further, DB2 provides the most efficient

    and seamless integration of data on mainframe and midrange data servers inthe industry allowing you to reduce costs and improve cycle-times byleveraging your current investments in data, hardware, software, and skills.

    DB2 UDB's support for distributed data can be grouped into three categories:

    7102ch01.fm Draft Document for Review September 22, 2004 3:24 pm

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    30/370

    8 DB2 UDB V8.2 on the Windows Environment

    Client/server data access Data replication Host data integration through DRDA

    Federated systems

    A DB2 federated system is a special type of distributed databasemanagement system (DBMS). A federated system consists of a DB2 instancethat operates as a server, a database that serves as the federated database,one or more data sources, and clients (users and applications) who accessthe database and data sources. With a federated system you can senddistributed requests to multiple data sources within a single SQL statement.The power of a DB2 federated system is in its ability to:

    Join data from local tables and remote data sources, as if all the data arelocal.

    Take advantage of the data source processing strengths, by sendingdistributed requests to the data sources for processing.

    Compensate for SQL limitations at the data source by processing parts ofa distributed request at the federated server.

    Write capability to perform INSERT, UPDATE, and DELETE actions on thedata sources

    Ability to create remote tables on relational data sources.

    Federated database systems provide the middleware functionality foroutstanding information integration. Built into DB2 Enterprise Server Edition isthe ability to federate relational data across IBMs family of databases,including the DB2 family and Informix IDS.

    Multi-platform support

    DB2 Universal Database is one of the most open database platformsavailable. It runs on the most popular UNIX and Intel server platformsincluding AIX, HP-UX, Solaris, Linux and Windows NT/2000/Server 2003/XP.

    It supports all major industry standards relevant to distributed data so that itcan be accessed using thousands of existing tools and applications, and canbe easily managed within an open, network computing environment. Thesecapabilities allow you to reduce costs and improve cycle-times by leveragingyour current investments in data, hardware, software, and skills.

    Bullet-proof reliability

    DB2 Universal Database is setting the standard for quality and reliability in theclient/server database industry. As more mission-critical applications are

    implemented on UNIX and Intel platforms, IBM's ability to bringmainframe-level reliability to this environment has become a major factor inchoosing DB2. Better reliability and availability can reduce your costs, while

    Draft Document for Review September 22, 2004 3:24 pm 7102ch01.fm

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    31/370

    Chapter 1. Introduction 9

    scalability both within and across platforms can reduce the risk of dead-endprojects.

    1.1.3 DB2 UDB products for Windows

    DB2 UDB for Windows consist of several different product offerings based on asingle code base that provides you with a great deal of flexibility in licensingdepending on your requirements. In this section we provide brief descriptions ofthe various DB2 UDB products for Windows.

    The following are various DB2 UDB packages available for selection based onthe business requirements:

    DB2 UDB Enterprise Server Edition

    DB2 UDB Enterprise Server Edition (ESE) meets the database server needsof midsize to large businesses. It can be deployed in any environment on anysize server. ESE is the ideal foundation for building data warehouses,transaction processing, or Web-based solutions as well as a back end forpackaged solutions like ERP, CRM, and SCM. Additionally, ESE offersconnectivity and integration for other enterprise DB2 and Informix datasources.

    DB2 Database Partitioning Feature

    The DB2 Database Partitioning Feature (DPF) allows DB2 UDB EnterpriseServer Edition customers to partition a database within a single system oracross a cluster of systems. The DPF capability provides the customer withmultiple benefits including scalability to support very large databases orcomplex workloads and increased parallelism for administration tasks.

    DB2 UDB Workgroup Server Edition

    DB2 UDB Workgroup Server Edition (WSE) is the database server designedfor deployment in a departmental or small business environment that involves

    a small number of internal users. WSE uses a licensing model designed toprovide an attractive price point for smaller installations while still providing afull function database server. WSE can be deployed in any environment onsystems with up to four CPUs.

    DB2 UDB Workgroup Server Unlimited Edition

    DB2 UDB Workgroup Server Unlimited Edition (WSUE) product offers asimplified per processor licensing model for deployment in a departmental orsmall business environment that has Internet users or number of users thatmakes per processor licensing more attractive than the DB2 UDB WorkgroupServer Edition licensing model. The WSUE can be deployed in Linux, UNIX,and Windows environments on systems with up to four CPUs.

    DB2 UDB Express Edition

    7102ch01.fm Draft Document for Review September 22, 2004 3:24 pm

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    32/370

    10 DB2 UDB V8.2 on the Windows Environment

    The DB2 UDB Express is a specifically tailored database offering for smalland medium businesses (SMBs). The key features include simplifieddeployment, autonomic management capabilities, and applicationdevelopment support. It is designed for independent software vendors whoneed an easy to install database integrated into their application software

    solution. It is a multi-user version that supports local and remote applicationsin stand alone and local area network environments.

    DB2 UDB Personal Edition

    DB2 UDB Personal Edition (PE) provides a single user database engine idealfor deployment to PC-based users. PE can be remotely managed, making itthe perfect choice for deployment in occasionally connected or remote officeimplementations that dont require multi-user capability.

    DB2 Universal Developers Edition

    DB2 UDB Universal Developers Edition (UDE) offers a low-cost package for asingle application developer to design, build, or prototype applications fordeployment of any of the DB2 client or server platforms. It includes all clientand server DB2 editions, DB2 Connect, DB2 Extenders, DB2 WarehouseManager, and Intelligent Miner. The software in this package cannot be usedfor production systems.

    DB2 Personal Developers Edition

    DB2 UDB Personal Developers Edition (PDE) enables a developer to designand build single user desktop applications.

    In addition, IBM also offers following DB2 clients free of charge:

    Run Time Client

    Provides the functionality required for an application to access DB2 UniversalDatabase servers and DB2 Connect servers. Its functionality includescommunication protocol support and support for application interfaces suchas JDBC, SQLJ, ODBC, CLI, OLE DB, and .NET.

    Run Time Client Lite:

    This is a new addition in DB2 UDB Version 8.2. Run-time Client Lite is asmaller footprint version of the DB2 Run-Time Client and is available only onWindows environments. It provides basic functions that allow yourapplications to access DB2 UDB server. The DB2 Run-Time Client Lite alsocontains support necessary for JDBC, SQLJ, ODBC, CLI, OLE DB and .NETsimilar to the DB2 Run-Time client. With its reduced installation image size,the DB2 Run-Time Client Lite is ideal for mass deployment or for bundling

    with your applications.

    Administration Client

    Draft Document for Review September 22, 2004 3:24 pm 7102ch01.fm

    P id th bilit f li t f i t f l tf t d

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    33/370

    Chapter 1. Introduction 11

    Provides the ability for any client from a variety of platforms to access andadminister DB2 databases. The DB2 Administration Client has all the featuresof the DB2 Run-Time Client and includes all the DB2 administration tools andsupport for Thin Clients.

    Application Development Client

    Use it in order to develop DB2 database applications, including storedprocedures, user defined functions, and client applications. Also contains allof the functionality available in the DB2 Run-Time Client. It is a collection ofgraphical and non-graphical tools and components for developingcharacter-based, multimedia, and object-oriented applications. Specialfeatures include the Development Center and sample applications for allsupported programming languages. The Application Development Clientincludes the tools and components provided as part of the DB2

    Administration Client product.

    1.1.4 Try and buy product availability

    IBM provides sixty day evaluation copies of most of the above products fordownload over the internet. The evaluation code can be obtained by following theinstructions at this Web page:

    http://www-3.ibm.com/software/data/db2/udb/

    1.2 DB2 UDB version 8.2 technology highlights

    IBM DB2 UDB V8.2 for Linux, UNIX and Windows, codename Stinger, marks thenext stage in the evolution of the relational database. The technology highlightsfor DB2 UDB V8.2 are:

    SQL Enhancements Security Enhancements

    Business Intelligences Enmeshments Automatic Computing Enhancements High availability enhancements

    We introduce the highlights of DB2 UDB V8.2. For more detail on the specificenhancements see the IBM DB2 Universal Database Stinger Web site:

    http://www.ibm.com/software/data/db2/stinger/

    1.2.1 SQL enhancements

    The following enhancements have been added:

    7102ch01.fm Draft Document for Review September 22, 2004 3:24 pm

    Native PSM

    http://www-3.ibm.com/software/data/db2/udb/http://www-306.ibm.com/software/data/db2/stinger/http://www-306.ibm.com/software/data/db2/stinger/http://www-3.ibm.com/software/data/db2/udb/
  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    34/370

    12 DB2 UDB V8.2 on the Windows Environment

    Native PSM

    The creation of SQL procedures does not require a C or C++ compiler on theserver; therefore C or C++ compiler setup is not required. When you create aSQL procedure its procedural statements are converted to a nativerepresentation called Native PSM (Persist Storage Module). The new PSM

    generates a plan and bytecode that is stored in the catalog. When a SQLprocedure is called, the native representation is loaded from the catalog andthe DB2 engine executes the procedure at execution time.

    Support of CALL statement in a Trigger body

    You can now invoke procedures from triggers or any other dynamiccompound statement, in single partition environments, by executing a CALLstatement that references a procedure within a trigger action.

    When a procedure called by a trigger-action, it enables you to encapsulatecomplex logic in the trigger, such as operations on other tables in thedatabase, or operations external to the database like sending an E-mail orwriting an audit record to a file in the file system of the database server.

    Support for REOPT Bind option

    The new REOPT option defers the compilation of the SQL statement until runtime when the access plan can be optimized using the actual values for theinput variables - host variables, special registers, and parameter markers.This new feature can improve the execution performance.

    Larger SQL statement

    The previous 64KB limit on statement size limits the total size of statements(e.g. CREATE PROCEDURE or CREATE TRIGGER) which therefore limitsthe size of the object. Now DB2 UDB V8.2 provides an increased SQLstatement size up to 2MB. The new 2MB limit allows you to use largestatements when your application logic is in stored procedures or triggers.

    The increase in the statement size also provides more flexibility to migrate a

    trigger or stored procedure statement from another RDBMS to DB2 UDB. Thenew statement limit allows you to record auditing context records that havestatement text up to 2MB.

    Support SET LOCK WAIT / NO WAIT:

    Traditional locking approaches can result in applications blocking each other.This happens when one application must wait for another application torelease its lock. Strategies to deal with the impact of such blocking usuallyprovide a mechanism to specify the maximum acceptable duration of the

    block. That is the amount of time that an application will wait prior to returningwithout a lock.

    Draft Document for Review September 22, 2004 3:24 pm 7102ch01.fm

    An application or session can now specify a lock wait mode strategy which is

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    35/370

    Chapter 1. Introduction 13

    An application or session can now specify a lock wait mode strategy which isused when the session requires a lock that it cannot obtain immediately. Thestrategy indicates whether the application or session will:

    Return a SQLCODE and SQLSTATE when it cannot obtain a lock

    Wait indefinitely for a lock Wait a specified amount of time for a lock

    Use the value of the locktimeoutdatabase configuration parameter whenwaiting for a lock

    The lock wait mode is specified through the new SET CURRENT LOCKTIMEOUT statement, which changes the value of the CURRENT LOCKTIMEOUT special register. The CURRENT LOCK TIMEOUT special registerspecifies the number of seconds to wait for a lock before returning an error

    indicating that a lock cannot be obtained. Changing generated column property

    Now we can change generated column properties without having to recreatethe table, using the ALTER COLUMN clause in the ALTER TABLE statementto alter the various ways that a column value can be generated, such as:

    Add the generated expression attribute to an existing non-generatedcolumn.

    Drop the generated expression attribute from an existing generatedexpression column.

    Add the identity attribute to an existing non-identity column.

    Drop the identity attribute from an existing identity column.

    Alter a generated column from GENERATED ALWAYS to GENERATEDBY DEFAULT, or from GENERATED BY DEFAULT to GENERATEDALWAYS.

    Drop the default attribute from a user-defined default column.

    Until this enhancement a generated expression or identity attributes could beassigned to a column only when it was created. Although the expression itselfcould be changed later, once a generated column was created, it could not bechanged to a non-generated column without dropping and then recreating thetable. Before dropping the table, you had to export the data in the table andthen reload that data into the recreated table with a redefined column.

    Toggle generated column property

    There are times when the default values of a column in a database table mustbe changed. The enhanced ALTER TABLE SQL statement allows you to setthe default value of a column to a different value. You have new options to

    7102ch01.fm Draft Document for Review September 22, 2004 3:24 pm

    change the generated values for a column You also can alter identity column

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    36/370

    14 DB2 UDB V8.2 on the Windows Environment

    change the generated values for a column. You also can alter identity columnand Generated Expression column.

    Nested savepoints

    DB2 UDB now supports the nesting of savepoints. You can have multiple

    levels of savepoints active simultaneously inside an application, and can rollback to any active savepoint, as required. A rollback to a particular savepointstatement also releases any active nested savepoints within the savepointbeing rolled back. Other new abilities of savepoints are:

    The ability to use savepoint-related statements within atomic compoundSQL statements

    The ability to use atomic compound SQL statements within an activesavepoint

    The ability to create a new savepoint level within a stored procedureinvocation

    The automatic creation of a new savepoint level within each call to auser-defined function (UDF)

    1.2.2 Security enhancements

    In database security area, the following enhancements have been added:

    Data encryption

    Two new authentication types are added to improve the user data securityduring client/server communication over the network:

    SQL_AUTHENTICATION_DATAENC, requires connections to use the dataencryption.

    SQL_AUTHENTICATION_DATAENC_CMP, allows for a compatibilitymode with down-level products that do not support the new authenticationtype. So they will be allowed to connect with SERVER_ENCRYPT and not

    encrypt user data.

    DB2 security exit

    Now you can create your own authentication and group managementmechanisms using DB2 provided plug-in framework to perform userauthentication. This new feature presents the customers alternatives to theauthentication methods currently provided by DB2. It allows the customers tocreate their own authentication mechanisms to handle:

    group membership authentication on the client side authentication on the serve

    Draft Document for Review September 22, 2004 3:24 pm 7102ch01.fm

    1.2.3 Business intelligence enhancements

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    37/370

    Chapter 1. Introduction 15

    1.2.3 Business intelligence enhancements

    In this release, several business intelligence enhancements have been added:

    Online import

    The Import utility now supports both offline (ALLOW NO ACCESS) and online

    (ALLOW WRITE ACCESS) locking modes. The default is the offline mode.Previous to version 8.1.4, only offline mode was available. The online modeprovides better availability of the target table and potential increase theperformance of the import utility.

    Online import is especially valuable when range-clustered table (RCT) areused. Load into RCTs is not supported, and therefore performing multipleconcurrent imports into a single target table is the most efficient way topopulate the database using supported DB2 utilities.

    Design Advisor

    The DB2 Design Advisor is a tool that can help you significantly improve yourworkload performance. The task of selecting which indexes, MQTs, clusteringdimensions, or partitions to create for a complex workload can be quitedaunting. The enhanced DB2 Design advisor includes the following features:

    Materialized Query Table advisor

    Now you have an advisor to recommend creation (and removal) ofMaterialized Query Tables (formerly known as AST's) based on submittedSQL workload. The MQT advisor will help you improving your workloadperformance.

    Multi-Dimensional Clustering advisor

    The MDC advisor feature recommends MDC clustering dimensions,including coarsifications on base columns in order to improve workloadperformance. This includes potentially recommending generated columnsthat define coarsification of dimensions. The MDC advisor has a goal toselect MDC solutions that result in a moderate table expansion.

    Partitioning advisor

    The Partitioning advisor is an extension to db2advisutility. The advisortakes a workload (consisting of SQL statements) as input and outputs thebest partition (minimizing the cost of the workload) for each table in theworkload. The tool can be used for the following applications:

    choose partitioning for MQTs recommended by the MQT Advisor

    decide the initial database partitioning before loading the data into the

    database

    migrating from a non-partitioned DB2 to partitioned DB2 ESE

    7102ch01.fm Draft Document for Review September 22, 2004 3:24 pm

    migrating to partitioned DB2 ESE applications from Informix or

  • 7/25/2019 Db2 Udb v82 on the Windows Evironment

    38/370

    16 DB2 UDB V8.2 on the Windows Environment

    g g p ppcompeting database systems

    find out the right database partitioning after the environment (workload,underlying data, number of partition groups) is changed

    You can use these features individually or in combination. The Design advisorwill generate recommendations for

    new Indexes new materialized query tables indexes on the materialized query tables conversion to multi-dimensional clustering tables re-partitioning of tables deletion of objects unused by the specified workload

    RUNSTASTS enhancements

    DB2 query optimize