About this book
Notices and trademarks
Who should read this book?
How is this book structured?
A book for the community
Authors and Contributors
Acknowledgements
Foreword
PART I – OVERVIEW AND SETUP
Chapter 1 – What is DB2 Express-C?
1.1 Free to develop, deploy, and distribute…no limits!
1.2 Downloading DB2 Express-C
1.3 User assistance and technical support
1.4 DB2 servers
1.5 DB2 clients and drivers
1.6 Application development freedom
1.7 DB2 versions versus DB2 editions
1.8 Moving up to another DB2 edition
1.9 Maintenance and updates for DB2 Express-C
1.10 Related free software and DB2 components
1.10.1 IBM Data Studio
1.10.4 DB2 Text Search
1.10.5 WebSphere Application Server – Community Edition
1.11 Summary
Chapter 2 – Related features and products
2.1 Features included with DB2 Express subscription (FTL)
2.1.1 Fix packs
2.1.2 High Availability Disaster Recovery (HADR)
2.1.3 Data Replication
2.2 Features not available with DB2 Express-C
2.2.1 Database Partitioning
2.2.2 Connection Concentrator
2.2.3 Geodetic Extender
2.2.4 Label-based Access Control (LBAC)
2.2.5 Workload Manager (WLM)
2.2.6 Deep compression
2.2.7 SQL Compatibility
2.3 Fee-based products that are related to DB2
2.3.1 DB2 Connect
2.3.2 InfoSphere Federation Server
2.3.3 InfoSphere Replication Server
2.3.4 Optim Development Studio (ODS)
2.3.5 Optim Database Administrator (ODA)
2.4 DB2 Offerings on Amazon Elastic Compute Cloud
2.5 Summary
Chapter 3 – DB2 installation
3.1 Installation prerequisites
3.2 Operating system installation authority
3.3 Installation wizard
3.4 Validating your installation
3.5 Silent Install
3.6 Summary
3.7 Exercises
Chapter 4 – DB2 Environment
4.1 DB2 configuration
4.1.1 Environment variables
4.1.2 Database manager configuration file (dbm cfg)
4.1.3 Database configuration file (db cfg)
4.1.4 DB2 profile registry
4.2 The DB2 Administration Server (deprecated)
4.3 Summary
Chapter 5 – DB2 Tools
5.1 IBM Data Studio
5.2 Control Center (deprecated)
5.2.1 Launching the Control Center
5.3 Command Editor (deprecated)
5.3.1 Launching the Command Editor
5.3.2 Adding a database connection
5.4 SQL Assist Wizard (deprecated)
5.5 Show SQL Button (deprecated)
5.6 Task Center (deprecated)
5.6.1 The Tools Catalog database (deprecated)
5.7 Journal (deprecated)
5.7.1 Launching the Journal
5.8 Health Monitor (deprecated)
5.8.1 Health Center (deprecated)
5.9 Self-tuning memory manager
5.10 Scripting
5.10.1 SQL scripts
5.10.2 Operating system (shell) scripts
5.11 Windows Vista considerations
5.12 Summary
5.13 Exercises
PART II – LEARNING DB2: DATABASE ADMINISTRATION
Chapter 6 – DB2 Architecture
6.1 DB2 process model
6.2 DB2 memory model
6.3 DB2 storage model
6.3.1 Pages and Extents
6.3.2 Buffer pools
6.3.3 Table spaces
6.4 Summary
6.5 Exercises
Chapter 7 – DB2 Client Connectivity
7.1 DB2 Directories
7.1.1 System database directory
7.1.2 Local database directory
7.1.3 Node directory
7.1.4 DCS directory
7.2 Configuration Assistant (deprecated)
7.2.1 Setup required at the server
7.2.2 Setup required at the client
7.2.3 Creating Client and Server Profiles
7.3 Summary
7.4 Exercises
Chapter 8 – Working with Database Objects
8.1 Schemas
8.2 Public synonyms (or aliases)
8.3 Tables
8.3.1 Data Types
8.3.2 Identity Columns
8.3.3 Sequence objects
8.3.4 System catalog tables
8.3.5 Declared global temporary tables (DGTTs)
8.3.6 Create Global Temporary Tables (CGTTs)
8.4 Views
8.5 Indexes
8.5.1 Design Advisor
8.6 Referential integrity
8.7 Schema Evolution
8.8 Summary
8.9 Exercises
Chapter 9 – Data Movement Utilities
9.1 EXPORT utility
9.2 IMPORT utility
9.3 LOAD utility
9.4 The db2move utility
9.5 The db2look utility
9.6 Summary
9.7 Exercises
Chapter 10 – Database Security
10.1 Authentication
10.2 Authorization
10.2.1 Privileges
10.2.2 Authorities
10.2.3 Roles
10.3 Group privilege considerations
10.4 The PUBLIC group
10.5 The GRANT and REVOKE statements
10.6 Authorization and privilege checking
10.7 Extended Security on Windows
10.8 Summary
10.9 Exercises
Chapter 11 – Backup and Recovery
11.1 Database Logging
11.2 Types of logs
11.3 Types of logging
11.3.1 Circular logging
11.3.2 Archive logging
11.4 Database logging from the Control Center
11.5 Logging parameters
11.6 Database backup
11.7 Database recovery
11.7.1 Recovery types
11.7.2 Database restore
11.8 Other operations with BACKUP and RESTORE
11.9 Summary
11.10 Exercises
Chapter 12 – Maintenance Tasks
12.1 REORG, RUNSTATS, REBIND
12.1.1 The REORG command
12.1.2 The RUNSTATS command
12.1.3 BIND / REBIND
12.1.4 Maintenance tasks from the Control Center
12.2 Maintenance Choices
12.3 Summary
12.4 Exercises
Chapter 13 – Concurrency and Locking
13.1 Transactions
13.2 Concurrency
13.3 Problems without concurrency control
13.3.1 Lost update
13.3.2 Uncommitted read
13.3.3 Non-repeatable read
13.3.4 Phantom read
13.4 Isolation Levels
13.4.1 Uncommitted read
13.4.2 Cursor stability
13.4.3 Read stability
13.4.4 Repeatable read
13.4.5 Comparing isolation levels
13.4.6 Setting the isolation level
13.5 Lock escalation
13.6 Lock monitoring
13.7 Lock wait
13.8 Deadlock causes and detection
13.9 Concurrency and locking best practices
13.10 Summary
13.11 Exercises
PART III – LEARNING DB2: APPLICATION DEVELOPMENT
Chapter 14 – Introduction to DB2 Application Development
14.2.1 Stored Procedures
14.2.2 User-defined functions
14.2.3 Triggers
14.3.1 Embedded SQL
14.3.2 Static SQL vs. Dynamic SQL
14.3.3 CLI and ODBC
14.3.4 JDBC, SQLJ and pureQuery
14.3.5 OLE DB
14.3.6 ADO.NET
14.3.7 PHP
14.3.8 Ruby on Rails
14.3.9 Perl
14.3.10 Python
14.7.1 Working with Microsoft Access and Microsoft Excel
14.9 Sample programs
14.10 Summary
Chapter 15 – DB2 pureXML
15.1 Using XML with databases
15.2 XML databases
15.2.1 XML-enabled databases
15.2.2 Native XML databases
15.3 XML in DB2
15.3.1 pureXML technology advantages
15.3.2 XPath basics
15.3.3 XQuery basics
15.3.4 Inserting XML documents
15.3.5 Querying XML data
15.3.6 Joins with SQL/XML
15.3.7 Joins with XQuery
15.3.8 Update and delete operations
15.3.9 XML indexing
15.4 Working with XML Schemas
15.4.1 Registering your XML Schemas
15.4.2 XML Schema validation
15.4.3 Other XML support
15.6 Summary
15.7 Exercises
Appendix A – Troubleshooting
A.1 Finding more information about error codes
A.2 SQLCODE and SQLSTATE
A.3 DB2 Administration Notification Log
A.4 db2diag.log
A.5 CLI traces
A.6 DB2 Defects and Fixes
Appendix B – References and Resources
B.1 References
B.2 Web sites:
B.3 Books
B.4 Contact emails