Home > Store

Understanding DB2: Learning Visually with Examples, 2nd Edition

Register your product to gain access to bonus material or receive a coupon.

Understanding DB2: Learning Visually with Examples, 2nd Edition

eBook (Watermarked)

  • Your Price: $42.39
  • List Price: $52.99
  • About Watermarked eBooks
  • This PDF will be accessible from your Account page after purchase and requires the free Adobe® Reader® software to read it.

    The eBook requires no passwords or activation to read. We customize your eBook by discreetly watermarking it with your name, making it uniquely yours.

    Watermarked eBook FAQ


  • Copyright 2008
  • Edition: 2nd
  • eBook (Watermarked)
  • ISBN-10: 0-13-713536-X
  • ISBN-13: 978-0-13-713536-3

The Easy, Visual Way to Master IBM® DB2 for Linux®, UNIX®, and Windows®—Fully Updated for Version 9.5

IBM DB2 9 and DB2 9.5 provide breakthrough capabilities for providing Information on Demand, implementing Web services and Service Oriented Architecture, and streamlining information management. Understanding DB2: Learning Visually with Examples, Second Edition, is the easiest way to master the latest versions of DB2 and apply their full power to your business challenges.

Written by four IBM DB2 experts, this book introduces key concepts with dozens of examples drawn from the authors' experience working with DB2 in enterprise environments. Thoroughly updated for DB2 9.5, it covers new innovations ranging from manageability to performance and XML support to API integration. Each concept is presented with easy-to-understand screenshots, diagrams, charts, and tables.

This book is for everyone who works with DB2: database administrators, system administrators, developers, and consultants. With hundreds of well-designed review questions and answers, it will also help professionals prepare for the IBM DB2 Certification Exams 730, 731, or 736.

Coverage includes

  • Choosing the right version of DB2 for your needs
  • Installing and configuring DB2
  • Understanding the DB2 environment, instances, and databases
  • Establishing client and server connectivity
  • Working with database objects
  • Utilizing breakthrough pureXML™ technology, which provides for nativeXML support
  • Mastering administration, maintenance, performance optimization, troubleshooting, and recovery
  • Understanding improvements in the DB2 process, memory, and storage models
  • Implementing effective database security
  • Leveraging the power of SQL and XQuery

Sample Content

Table of Contents

Foreword xxiii

Preface xxv

Acknowledgments xxxi

About the Authors xxxiii

Chapter 1 Introduction to DB2 1

1.1 Brief History of DB2 1

1.2 The Role of DB2 in the Information On-Demand World 4

1.3 DB2 Editions 13

1.4 DB2 Clients 20

1.5 Try-and-Buy Versions 22

1.6 Host Connectivity 23

1.7 Federation Support 23

1.8 Replication Support 24

1.9 IBM WebSphere Federation Server and WebSphere Replication Server 25

1.10 Special Package Offerings for Developers 25

1.11 DB2 Syntax Diagram Conventions 26

1.12 Case Study 28

1.13 Summary 29

1.14 Review Questions 30

Chapter 2 DB2 at a Glance: The Big Picture 33

2.1 SQL Statements, XQuery Statements, and DB2 Commands 33

2.2 DB2 Tools Overview 38

2.4 Federation 55

2.5 Case Study: The DB2 Environment 56

2.6 Database Partitioning Feature 58

2.7 Case Study: DB2 with DPF Environment 74

2.8 IBM Balanced Warehouse 79

2.9 Summary 81

2.10 Review Questions 81

Chapter 3 Installing DB2 85

3.1 DB2 Installation: The Big Picture 85

3.2 Installing DB2 Using the DB2 Setup Wizard 88

3.3 Non-Root Installation on Linux and Unix 102

3.4 Required User IDs and Groups 105

3.5 Silent Install Using a Response File 108

3.6 Advanced DB2 Installation Methods (Linux and UNIX Only)113

3.7 Installing a DB2 License 116

3.8 Installing DB2 in a DPF Environment 118

3.9 Installing Multiple db2 Versions and Fix Packs on the Same Server 119

3.10 Installing DB2 Fix Packs 126

3.11 Migrating DB2 129

3.12 Case Study 131

3.13 Summary 133

3.14 Review Questions 134

Chapter 4 Using the DB2 Tools 137

4.1 DB2 Tools: The Big Picture 137

4.2 The Command-Line Tools 138

4.3 Web-Based Tools 157

4.4 General Administration Tools 158

4.5 Information Tools 165

4.6 Monitoring Tools 167

4.7 Setup Tools 171

4.8 Other Tools 175

4.9 Tool Settings 179

4.10 Case Study 179

4.11 Summary 184

4.12 Review Questions 185

Chapter 5 Understanding the DB2 Environment, DB2 Instances, and Databases 189

5.1 The DB2 Environment, DB2 Instances, and Databases: The Big Picture 189

5.2 The DB2 Environment 190

5.3 The DB2 Instance 198

5.4 The Database Administration Server 216

5.5 Configuring a Database 217

5.6 Instance and Database Design Considerations 224

5.7 Case Study 225

5.8 Summary 227

5.9 Review Questions 227

Chapter 6 Configuring Client and Server Connectivity 231

6.1 Client and Server Connectivity: The Big Picture 231

6.2 The DB2 Database Directories 233

6.3 Supported Connectivity Scenarios 243

6.4 Configuring Database Connections Using the Configuration Assistant 258

6.5 Diagnosing DB2 Connectivity Problems 276

6.6 Case Study 283

6.7 Summary 285

6.8 Review Questions 286

Chapter 7 Working with Database Objects 289

7.1 DB2 Database Objects: The Big Picture 289

7.2 Databases 292

7.3 Partition Groups 298

7.4 Table Spaces 299

7.5 Buffer Pools 300

7.6 Schemas 301

7.7 Data Types 302

7.8 Tables

7.9 Indexes

7.10 Multidimensional Clustering Tables and Block Indexes 347

7.11 Combining DPF, Table Partitioning, and MDC 351

7.12 Views 352

7.13 Packages 357

7.14 Triggers 358

7.15 Stored Procedures 360

7.16 User-Defined Functions 362

7.17 Sequences 364

7.18 Case Study 366

7.19 Summary 369

7.20 Review Questions 370

Chapter 8 The DB2 Storage Model 375

8.1 The DB2 Storage Model: The Big Picture 375

8.2 Databases: Logical and Physical Storage of Your Data 377

8.3 Database Partition Groups 384

8.4 Table Spaces 388

8.5 Buffer Pools 406

8.6 Case Study 410

8.7 Summary 412

8.8 Review Questions 412

Chapter 9 Leveraging the Power of SQL 417

9.1 Querying DB2 Data 418

9.2 Modifying Table Data 433

9.3 Selecting from UPDATE, DELETE, or INSERT 434

9.4 The MERGE Statement 436

9.5 Recursive SQL 437

9.6 The UNION, INTERSECT, and EXCEPT Operators 439

9.7 Case Study 441

9.8 Summary 445

9.9 Review Questions 445

Chapter 10 Mastering the DB2 pureXML Support 453

10.1 XML: The Big Picture 454

10.2 pureXML in DB2 478

10.3 Querying XML Data 486

10.4 SQL/XML Publishing Functions 507

10.5 Transforming XML Documents Using XSLT Functions 509

10.6 Inserting XML Data into a DB2 Database 509

10.7 Updating and Deleting XML Data 511

10.8 XML Indexes 514

10.9 XML Schema Support and Validation in DB2 522

10.10 Annotated XML Schema Decomposition 529

10.11 XML Performance Considerations 532

10.12 pureXML Restrictions 533

10.13 Case Study 534

10.14 Summary 538

10.15 Review Questions 538

Chapter 11 Implementing Security 543

11.1 DB2 Security Model: The Big Picture 543

11.2 Authentication 545

11.3 Data Encryption 558

11.4 Administrative Authorities 558

11.5 Database Object Privileges 565

11.6 Label-Based Access Control (LBAC) 583

11.7 Authority and Privilege Metadata 590

11.8 Windows Domain Considerations 594

11.9 Trusted Contexts Security Enhancement 596

11.10 Case Study 598

11.11 Summary 599

11.12 Review Questions 600

Chapter 12 Understanding Concurrency and Locking 603

12.1 DB2 Locking and Concurrency: The Big Picture 603

12.2 Concurrency and Locking Scenarios 604

12.3 DB2 Isolation Levels 607

12.4 Changing Isolation Levels 612

12.5 DB2 Locking 619

12.6 Diagnosing Lock Problems 630

12.7 Techniques to Avoid Locking 643

12.8 Case Study 646

12.9 Summary 647

12.10 Review Questions 647

Chapter 13 Maintaining Data 651

13.1 DB2 Data Movement Utilities: The Big Picture 651

13.2 Data Movement File Formats 653

13.3 The DB2 EXPORT Utility 654

13.4 The DB2 IMPORT Utility 667

13.5 The DB2 Load Utility 676

13.6 The DB2MOVE Utility 697

13.7 The db2relocatedb Utility 700

13.8 Generating Data Definition Language 701

13.9 DB2 Maintenance Utilities 703

13.10 Case Study 715

13.11 Summary 717

13.12 Review Questions 717

Chapter 14 Developing Database Backup and Recovery Solutions 721

14.1 Database Recovery Concepts: The Big Picture 721

14.2 DB2 Transaction Logs 725

14.3 Recovery Terminology 737

14.4 Performing Database and Table Space Backups 738

14.5 Database and Table Space Recovery Using the RESTORE DATABASE Command 746

14.6 Database and Table Space Roll Forward 754

14.7 Recovering a Dropped Table 758

14.8 The Recovery History File 760

14.9 Database Recovery Using the RECOVER DATABASE Command 762

14.10 Rebuild Database Option 764

14.11 Backup Recovery through Online Split Mirroring and Suspended I/O Support 773

14.12 Maintaining High Availability with DB2 782

14.13 The Fault Monitor 799

14.14 Case Study 801

14.15 Summary 805

Chapter 15 The DB2 Process Model 811

15.1 The DB2 Process Model: The Big Picture 811

15.2 Threaded Engine Infrastructure 814

15.3 The DB2 Engine Dispatchable Units 816

15.4 Tuning the Number of EDUs 831

15.5 Monitoring and Tuning the DB2 Agents 833

15.6 The Connection Concentrator 834

15.7 Commonly Seen DB2 Executables 835

15.8 Additional Services/Processes on Windows 836

15.9 Case Study 837

15.10 Summary 838

15.11 Review Questions 839

Chapter 16 The DB2 Memory Model 843

16.1 DB2 Memory Allocation: The Big Picture 843

16.2 Instance-Level Shared Memory 845

16.3 Database-Level Shared Memory 846

16.4 Application-Level Shared Memory 850

16.5 Agent Private Memory 853

16.6 The Memory Model 855

16.7 Case Study 857

16.8 Summary 861

16.9 Review Questions 861

Chapter 17 Database Performance Considerations 865

17.1 Relation Data Performance Fundamentals 866

17.2 System/Server Configuration 866

17.3 The DB2 Configuration Advisor 869

17.4 Configuring the DB2 Instance 877

17.5 Configuring Your Databases 879

17.6 Lack of Proper Maintenance 884

17.7 Automatic Maintenance 888

17.8 The Snapshot Monitor 890

17.9 Event Monitors 893

17.10 The DB2 Optimizer 896

17.11 The Explain Tool and Explain Tables 897

17.12 Using Visual Explain to Examine Access Plans 898

17.13 Workload Management 899

17.14 Case Study 902

17.15 Summary 905

17.16 Review Questions 905

Chapter 18 Diagnosing Problems 909

18.1 Problem Diagnosis: The Big Picture909

18.2 How DB2 Reports Issues 909

18.3 DB2 Error Message Description 911

18.4 DB2 First Failure Data Capture 913

18.5 Receiving E-mail Notifications 919

18.6 Tools for Troubleshooting 921

18.7 Searching for Known Problems 930

18.8 Case Study931

18.9 Summary 934

18.10 Review Questions 935

Appendix A Solutions to the Review Questions 937

Appendix B Use of Uppercase versus Lowercase in DB2 961

Appendix CIBM Servers 965

Appendix D Using the DB2 System Catalog Tables 967Resources 981

Index 987


Submit Errata

More Information

InformIT Promotional Mailings & Special Offers

I would like to receive exclusive offers and hear about products from InformIT and its family of brands. I can unsubscribe at any time.


Pearson Education, Inc., 221 River Street, Hoboken, New Jersey 07030, (Pearson) presents this site to provide information about products and services that can be purchased through this site.

This privacy notice provides an overview of our commitment to privacy and describes how we collect, protect, use and share personal information collected through this site. Please note that other Pearson websites and online products and services have their own separate privacy policies.

Collection and Use of Information

To conduct business and deliver products and services, Pearson collects and uses personal information in several ways in connection with this site, including:

Questions and Inquiries

For inquiries and questions, we collect the inquiry or question, together with name, contact details (email address, phone number and mailing address) and any other additional information voluntarily submitted to us through a Contact Us form or an email. We use this information to address the inquiry and respond to the question.

Online Store

For orders and purchases placed through our online store on this site, we collect order details, name, institution name and address (if applicable), email address, phone number, shipping and billing addresses, credit/debit card information, shipping options and any instructions. We use this information to complete transactions, fulfill orders, communicate with individuals placing orders or visiting the online store, and for related purposes.


Pearson may offer opportunities to provide feedback or participate in surveys, including surveys evaluating Pearson products, services or sites. Participation is voluntary. Pearson collects information requested in the survey questions and uses the information to evaluate, support, maintain and improve products, services or sites, develop new products and services, conduct educational research and for other purposes specified in the survey.

Contests and Drawings

Occasionally, we may sponsor a contest or drawing. Participation is optional. Pearson collects name, contact information and other information specified on the entry form for the contest or drawing to conduct the contest or drawing. Pearson may collect additional personal information from the winners of a contest or drawing in order to award the prize and for tax reporting purposes, as required by law.


If you have elected to receive email newsletters or promotional mailings and special offers but want to unsubscribe, simply email information@informit.com.

Service Announcements

On rare occasions it is necessary to send out a strictly service related announcement. For instance, if our service is temporarily suspended for maintenance we might send users an email. Generally, users may not opt-out of these communications, though they can deactivate their account information. However, these communications are not promotional in nature.

Customer Service

We communicate with users on a regular basis to provide requested services and in regard to issues relating to their account we reply via email or phone in accordance with the users' wishes when a user submits their information through our Contact Us form.

Other Collection and Use of Information

Application and System Logs

Pearson automatically collects log data to help ensure the delivery, availability and security of this site. Log data may include technical information about how a user or visitor connected to this site, such as browser type, type of computer/device, operating system, internet service provider and IP address. We use this information for support purposes and to monitor the health of the site, identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents and appropriately scale computing resources.

Web Analytics

Pearson may use third party web trend analytical services, including Google Analytics, to collect visitor information, such as IP addresses, browser types, referring pages, pages visited and time spent on a particular site. While these analytical services collect and report information on an anonymous basis, they may use cookies to gather web trend information. The information gathered may enable Pearson (but not the third party web trend services) to link information with application and system log data. Pearson uses this information for system administration and to identify problems, improve service, detect unauthorized access and fraudulent activity, prevent and respond to security incidents, appropriately scale computing resources and otherwise support and deliver this site and its services.

Cookies and Related Technologies

This site uses cookies and similar technologies to personalize content, measure traffic patterns, control security, track use and access of information on this site, and provide interest-based messages and advertising. Users can manage and block the use of cookies through their browser. Disabling or blocking certain cookies may limit the functionality of this site.

Do Not Track

This site currently does not respond to Do Not Track signals.


Pearson uses appropriate physical, administrative and technical security measures to protect personal information from unauthorized access, use and disclosure.


This site is not directed to children under the age of 13.


Pearson may send or direct marketing communications to users, provided that

  • Pearson will not use personal information collected or processed as a K-12 school service provider for the purpose of directed or targeted advertising.
  • Such marketing is consistent with applicable law and Pearson's legal obligations.
  • Pearson will not knowingly direct or send marketing communications to an individual who has expressed a preference not to receive marketing.
  • Where required by applicable law, express or implied consent to marketing exists and has not been withdrawn.

Pearson may provide personal information to a third party service provider on a restricted basis to provide marketing solely on behalf of Pearson or an affiliate or customer for whom Pearson is a service provider. Marketing preferences may be changed at any time.

Correcting/Updating Personal Information

If a user's personally identifiable information changes (such as your postal address or email address), we provide a way to correct or update that user's personal data provided to us. This can be done on the Account page. If a user no longer desires our service and desires to delete his or her account, please contact us at customer-service@informit.com and we will process the deletion of a user's account.


Users can always make an informed choice as to whether they should proceed with certain services offered by InformIT. If you choose to remove yourself from our mailing list(s) simply visit the following page and uncheck any communication you no longer want to receive: www.informit.com/u.aspx.

Sale of Personal Information

Pearson does not rent or sell personal information in exchange for any payment of money.

While Pearson does not sell personal information, as defined in Nevada law, Nevada residents may email a request for no sale of their personal information to NevadaDesignatedRequest@pearson.com.

Supplemental Privacy Statement for California Residents

California residents should read our Supplemental privacy statement for California residents in conjunction with this Privacy Notice. The Supplemental privacy statement for California residents explains Pearson's commitment to comply with California law and applies to personal information of California residents collected in connection with this site and the Services.

Sharing and Disclosure

Pearson may disclose personal information, as follows:

  • As required by law.
  • With the consent of the individual (or their parent, if the individual is a minor)
  • In response to a subpoena, court order or legal process, to the extent permitted or required by law
  • To protect the security and safety of individuals, data, assets and systems, consistent with applicable law
  • In connection the sale, joint venture or other transfer of some or all of its company or assets, subject to the provisions of this Privacy Notice
  • To investigate or address actual or suspected fraud or other illegal activities
  • To exercise its legal rights, including enforcement of the Terms of Use for this site or another contract
  • To affiliated Pearson companies and other companies and organizations who perform work for Pearson and are obligated to protect the privacy of personal information consistent with this Privacy Notice
  • To a school, organization, company or government agency, where Pearson collects or processes the personal information in a school setting or on behalf of such organization, company or government agency.


This web site contains links to other sites. Please be aware that we are not responsible for the privacy practices of such other sites. We encourage our users to be aware when they leave our site and to read the privacy statements of each and every web site that collects Personal Information. This privacy statement applies solely to information collected by this web site.

Requests and Contact

Please contact us about this Privacy Notice or if you have any requests or questions relating to the privacy of your personal information.

Changes to this Privacy Notice

We may revise this Privacy Notice through an updated posting. We will identify the effective date of the revision in the posting. Often, updates are made to provide greater clarity or to comply with changes in regulatory requirements. If the updates involve material changes to the collection, protection, use or disclosure of Personal Information, Pearson will provide notice of the change through a conspicuous notice on this site or other appropriate way. Continued use of the site after the effective date of a posted revision evidences acceptance. Please contact us if you have questions or concerns about the Privacy Notice or any objection to any revisions.

Last Update: November 17, 2020