| Foreword |
|
xxiii | |
| Preface |
|
xxv | |
| Acknowledgments |
|
xxxi | |
| About the Authors |
|
xxxiii | |
|
Chapter 1 Introduction to DB2 |
|
|
1 | (32) |
|
|
|
1 | (3) |
|
1.2 The Role of DB2 in the Information On-Demand World |
|
|
4 | (9) |
|
|
|
5 | (2) |
|
1.2.2 Information On-Demand |
|
|
7 | (1) |
|
1.2.3 Service-Oriented Architecture |
|
|
8 | (1) |
|
|
|
9 | (2) |
|
|
|
11 | (1) |
|
1.2.6 DB2 and the IBM Strategy |
|
|
12 | (1) |
|
|
|
13 | (7) |
|
1.3.1 DB2 Everyplace Edition |
|
|
15 | (1) |
|
1.3.2 DB2 Personal Edition |
|
|
16 | (1) |
|
|
|
16 | (2) |
|
1.3.4 DB2 Express Edition |
|
|
18 | (1) |
|
1.3.5 DB2 Workgroup Server Edition |
|
|
18 | (1) |
|
1.3.6 DB2 Enterprise Server Edition |
|
|
18 | (2) |
|
|
|
20 | (2) |
|
|
|
22 | (1) |
|
|
|
23 | (1) |
|
|
|
23 | (1) |
|
|
|
24 | (1) |
|
1.9 IBM WebSphere Federation Server and WebSphere Replication Server |
|
|
25 | (1) |
|
1.10 Special Package Offerings for Developers |
|
|
25 | (1) |
|
1.11 DB2 Syntax Diagram Conventions |
|
|
26 | (2) |
|
|
|
28 | (1) |
|
|
|
29 | (1) |
|
|
|
30 | (3) |
|
Chapter 2 DB2 at a Glance: The Big Picture |
|
|
33 | (52) |
|
2.1 SQL Statements, XQuery Statements, and DB2 Commands |
|
|
33 | (5) |
|
|
|
35 | (1) |
|
|
|
35 | (2) |
|
2.1.3 DB2 System Commands |
|
|
37 | (1) |
|
2.1.4 DB2 Command Line Processor (CLP) Commands |
|
|
37 | (1) |
|
|
|
38 | (1) |
|
|
|
38 | (1) |
|
22.2 General Administration Tools |
|
|
39 | (1) |
|
|
|
39 | (1) |
|
|
|
40 | (1) |
|
|
|
40 | (1) |
|
|
|
41 | (1) |
|
|
|
41 | (14) |
|
|
|
42 | (2) |
|
2.3.2 The Database Administration Server |
|
|
44 | (1) |
|
2.3.3 Configuration Files and the DB2 Profile Registries(2) |
|
|
44 | (3) |
|
2.3.4 Connectivity and DB2 Directories(3) |
|
|
47 | (2) |
|
|
|
49 | (1) |
|
|
|
50 | (1) |
|
2.3.7 Tables, Indexes, and Large Objects(6) |
|
|
50 | (1) |
|
|
|
51 | (1) |
|
|
|
51 | (1) |
|
2.3.10 The Internal Implementation of the DB2 Environment |
|
|
51 | (4) |
|
|
|
55 | (1) |
|
2.5 Case Study: The DB2 Environment |
|
|
56 | (2) |
|
2.6 Database Partitioning Feature |
|
|
58 | (7) |
|
2.6.1 Database Partitions |
|
|
58 | (4) |
|
2.6.2 The Node Configuration File |
|
|
62 | (2) |
|
2.6.3 An Instance in the DPF Environment |
|
|
64 | (1) |
|
2.64 Partitioning a Database |
|
|
65 | (2) |
|
2.65 Configuration Files in a DPF Environment |
|
|
67 | (7) |
|
2.6.6 Logs in a DPF Environment |
|
|
67 | (1) |
|
2.6.7 The Catalog Partition |
|
|
68 | (1) |
|
|
|
68 | (1) |
|
2.6.9 Buffer Pools in a DPF Environment |
|
|
69 | (1) |
|
2.6.10 Table Spaces in a Partitioned Database Environment |
|
|
70 | (1) |
|
2.6.11 The Coordinator Partition |
|
|
70 | (1) |
|
2.6.12 Issuing Commands and SQL Statements in a DPF Environment |
|
|
70 | (2) |
|
2.6.13 The DB2NODE Environment Variable |
|
|
72 | (1) |
|
2.6.14 Distribution Maps and Distribution Keys |
|
|
73 | (1) |
|
2.7 Case Study: DB2 with DPF Environment |
|
|
74 | (5) |
|
2.8 IBM Balanced Warehouse |
|
|
79 | (2) |
|
|
|
81 | (1) |
|
|
|
81 | (4) |
|
|
|
85 | (52) |
|
3.1 DB2 Installation: The Big Picture |
|
|
85 | (3) |
|
3.2 Installing DB2 Using the DB2 Setup Wizard |
|
|
88 | (14) |
|
3.2.1 Step I for Windows: Launch the DB2 Setup Wizard |
|
|
88 | (2) |
|
3.2.2 Step I for Linux and UNIX: Launch the DB2 Setup Wizard |
|
|
90 | (1) |
|
3.2.3 Step 2: Choose an Installation Type |
|
|
91 | (1) |
|
3.2.4 Step 3: Choose Whether to Generate a Response File |
|
|
92 | (1) |
|
3.2.5 Step 4: Specify the Installation Folder |
|
|
92 | (1) |
|
3.2.6 Step 5: Set User Information for the DB2 Administration Server |
|
|
93 | (1) |
|
3.2.7 Step 6: Create and Configure the DB2 Instance |
|
|
94 | (2) |
|
3.2.8 Step 7: Create the DB2 Tools Catalog |
|
|
96 | (1) |
|
3.2.9 Step 8: Enable the Alert Notification Feature |
|
|
96 | (2) |
|
3.2.10 Step 9: Specify a Contact for Health Monitor Notification |
|
|
98 | (1) |
|
3.2.11 Step 10: Enable Operating System Security for DB2 Objects (Windows Only) |
|
|
98 | (2) |
|
3.2.12 Step 11: Start the Installation |
|
|
100 | (2) |
|
3.3 Non-Root Installation on Linux and Unix |
|
|
102 | (3) |
|
3.3.1 Differences between Root and Non-Root Installations |
|
|
102 | (1) |
|
3.3.2 Limitations of Non-Root Installations |
|
|
102 | (1) |
|
3.3.3 Installing DB2 as a Non-Root User |
|
|
103 | (1) |
|
3.3.4 Enabling Root-Based Features in Non-Root Installations |
|
|
104 | (1) |
|
3.4 Required User IDs and Groups |
|
|
105 | (3) |
|
3.4.1 User IDs and Groups Required for Windows |
|
|
105 | (1) |
|
3.4.2 IDs and Groups Required for Linux and UNIX |
|
|
106 | (2) |
|
3.4.3 Creating User IDs and Groups if NIS Is Installed in Your Environment (Linux and UNIX Only) |
|
|
108 | (1) |
|
3.5 Silent Install Using a Response File |
|
|
108 | (5) |
|
3.5.1 Creating a Response File |
|
|
110 | (2) |
|
3.5.2 Installing DB2 Using a Response File on Windows |
|
|
112 | (1) |
|
3.5.3 Installing DB2 Using a Response File on Linux and UNIX |
|
|
113 | (1) |
|
3.6 Advanced DB2 Installation Methods (Linux and UNIX Only) |
|
|
113 | (3) |
|
3.6.1 Installing DB2 Using the db2_install Script |
|
|
114 | (1) |
|
3.6.2 Manually Installing Payload Files (Linux and UNIX) |
|
|
115 | (1) |
|
3.7 Installing a DB2 License |
|
|
116 | (2) |
|
3.7.1 Installing a DB2 Product License Using the License Center |
|
|
117 | (1) |
|
3.7.2 Installing the DB2 Product License Using the db2licm Command |
|
|
117 | (1) |
|
3.8 Installing DB2 in a DPF Environment |
|
|
118 | (1) |
|
3.9 Installing Multiple db2 Versions and Fix Packs on the Same Server |
|
|
119 | (7) |
|
3.9.1 Coexistence of Multiple DB2 Versions and Fix Packs (Windows) |
|
|
120 | (2) |
|
3.9.2 Using Multiple DB2 Copies on the Same Computer (Windows) |
|
|
122 | (2) |
|
3.9.3 Coexistence of Multiple DB2 Versions and Fix Packs (Linux and UNIX) |
|
|
124 | (2) |
|
3.10 Installing DB2 Rx Packs |
|
|
126 | (3) |
|
3.10.1 Applying a Regular DB2 Fix Pack (All Supported Platforms and Products) |
|
|
127 | (1) |
|
3.10.2 Applying Fix Packs to a Non-Root Installation |
|
|
128 | (1) |
|
|
|
129 | (2) |
|
3.11.1 Migrating DB2 Servers |
|
|
129 | (1) |
|
3.11.2 Migration Steps for a DB2 Server on Windows |
|
|
129 | (1) |
|
3.11.3 Migration Steps for a DB2 Server on Linux and UNIX |
|
|
130 | (1) |
|
|
|
131 | (2) |
|
|
|
133 | (1) |
|
|
|
134 | (3) |
|
Chapter 4 Using the DB2 Tools |
|
|
137 | (52) |
|
4.1 DB2 Tools: The Big Picture |
|
|
137 | (1) |
|
4.2 The Command-Line Tools |
|
|
138 | (15) |
|
4.2.1 The Command Line Processor and the Command Window |
|
|
139 | (14) |
|
|
|
153 | (4) |
|
|
|
157 | (1) |
|
4.3.1 The Data Server Administration Console |
|
|
157 | (1) |
|
4.4 General Administration Tools |
|
|
158 | (7) |
|
|
|
158 | (4) |
|
|
|
162 | (1) |
|
|
|
163 | (1) |
|
4.4.4 The Replication Center |
|
|
164 | (1) |
|
|
|
164 | (1) |
|
|
|
165 | (2) |
|
|
|
165 | (1) |
|
4.5.2 Checking for DB2 Updates |
|
|
166 | (1) |
|
|
|
167 | (4) |
|
4.6.1 The Activity Monitor |
|
|
167 | (1) |
|
|
|
168 | (2) |
|
|
|
170 | (1) |
|
4.6.4 Indoubt Transaction Manager |
|
|
170 | (1) |
|
4.6.5 The Memory Visualizer |
|
|
170 | (1) |
|
|
|
171 | (4) |
|
4.7.1 The Configuration Assistant |
|
|
171 | (1) |
|
4.7.2 Configure DB2 .NET Data Provider |
|
|
172 | (1) |
|
|
|
173 | (1) |
|
4.7.4 Register Visual Studio Add-lns |
|
|
174 | (1) |
|
4.7.5 Default DB2 and Database Client Interface Selection Wizard |
|
|
174 | (1) |
|
|
|
175 | (4) |
|
4.8.1 The IBM Data Server Developer Workbench |
|
|
175 | (2) |
|
|
|
177 | (1) |
|
4.8.3 Satellite Administration Center |
|
|
177 | (1) |
|
|
|
177 | (2) |
|
|
|
179 | (1) |
|
|
|
179 | (5) |
|
|
|
184 | (1) |
|
|
|
185 | (4) |
|
Chapter 5 Understanding the DB2 Environment, DB2 Instances, and Databases |
|
|
189 | (42) |
|
5.1 The DB2 Environment DB2 Instances, and Databases: The Big Picture |
|
|
189 | (1) |
|
|
|
190 | (8) |
|
5.2.1 Environment Variables |
|
|
190 | (6) |
|
5.2.2 DB2 Profile Registries |
|
|
196 | (2) |
|
|
|
198 | (18) |
|
5.3.1 Creating DB2 Instances |
|
|
200 | (2) |
|
5.3.2 Creating Client Instances |
|
|
202 | (1) |
|
5.3.3 Creating DB2 Instances in a Multipartitioned Environment |
|
|
202 | (1) |
|
5.3.4 Dropping an Instance |
|
|
203 | (1) |
|
5.3.5 Listing the Instances in Your System |
|
|
203 | (1) |
|
5.3.6 The DB2INSTANCE Environment Variable |
|
|
204 | (1) |
|
5.3.7 Starting a DB2 Instance |
|
|
205 | (2) |
|
5.3.8 Stopping a DB2 Instance |
|
|
207 | (2) |
|
5.3.9 Attaching to an Instance |
|
|
209 | (1) |
|
5.3.10 Configuring an Instance |
|
|
210 | (4) |
|
5.3.11 Working with an Instance from the Control Center |
|
|
214 | (1) |
|
5.3.12 The DB2 Commands at the Instance Level |
|
|
215 | (1) |
|
5.4 The Database Administration Server |
|
|
216 | (1) |
|
|
|
217 | (1) |
|
5.5 Configuring a Database |
|
|
217 | (7) |
|
5.5.1 Configuring a Database from the Control Center |
|
|
221 | (2) |
|
5.5.2 The DB2 Commands at the Database Level |
|
|
223 | (1) |
|
5.6 Instance and Database Design Considerations |
|
|
224 | (1) |
|
|
|
225 | (2) |
|
|
|
227 | (1) |
|
|
|
227 | (4) |
|
Chapter 6 Configuring Client and Server Connectivity |
|
|
231 | (58) |
|
6.1 Client and Server Connectivity: The Big Picture |
|
|
231 | (2) |
|
6.2 The DB2 Database Directories |
|
|
233 | (10) |
|
6.2.1 The DB2 Database Directories: An Analogy Using a Book |
|
|
234 | (1) |
|
6.2.2 The System Database Directory |
|
|
235 | (2) |
|
6.2.3 The Local Database Directory |
|
|
237 | (1) |
|
|
|
237 | (2) |
|
6.2.5 The Database Connection Services Directory |
|
|
239 | (1) |
|
6.2.6 The Relationship between the DB2 Directories |
|
|
239 | (4) |
|
6.3 Supported Connectivity Scenarios |
|
|
243 | (15) |
|
6.3.1 Scenario I: Local Connection from a DB2 Client to a DB2 Server |
|
|
244 | (1) |
|
6.3.2 Scenario 2: Remote Connection from a DB2 Client to a DB2 Server |
|
|
245 | (4) |
|
6.3.3 Scenario 3: Remote Connection from a DB2 Client to a DB2 Host Server |
|
|
249 | (6) |
|
6.3.4 Scenario 4: Remote Connection from a DB2 Client to a DB2 Host Server via a DB2 Connect Gateway |
|
|
255 | (2) |
|
|
|
257 | (1) |
|
6.4 Configuring Database Connections Using the Configuration Assistant |
|
|
258 | (18) |
|
6.4.1 Configuring a Connection Using DB2 Discovery in the Configuration Assistant |
|
|
258 | (7) |
|
6.4.2 Configuring a Connection Using Access Profiles in the Configuration Assistant |
|
|
265 | (6) |
|
6.4.3 Configuring a Connection Manually Using the Configuration Assistant |
|
|
271 | (4) |
|
6.4.4 Automatic Client Reroute Feature |
|
|
275 | (1) |
|
6.4.5 Application Connection Timeout Support |
|
|
276 | (1) |
|
6.5 Diagnosing DB2 Connectivity Problems |
|
|
276 | (7) |
|
6.5.1 Diagnosing Client-Server TCP/IP Connection Problems |
|
|
277 | (6) |
|
|
|
283 | (2) |
|
|
|
285 | (1) |
|
|
|
286 | (3) |
|
Chapter 7 Working with Database Objects |
|
|
289 | (86) |
|
7.1 DB2 Database Objects: The Big Picture |
|
|
289 | (3) |
|
|
|
292 | (6) |
|
7.2.1 Database Partitions |
|
|
292 | (2) |
|
7.2.2 The Database Node Configuration File (db2nodes.cfg) |
|
|
294 | (4) |
|
|
|
298 | (1) |
|
|
|
299 | (1) |
|
7.4.1 Table Space Classification |
|
|
299 | (1) |
|
7.4.2 Default Table Spaces |
|
|
300 | (1) |
|
|
|
300 | (1) |
|
|
|
301 | (1) |
|
|
|
302 | (8) |
|
7.7.1 DB2 Built-in Data Types |
|
|
302 | (5) |
|
|
|
307 | (1) |
|
7.7.3 Choosing the Proper Data Type |
|
|
308 | (2) |
|
|
|
310 | (33) |
|
7.8.1 Table Classification |
|
|
310 | (1) |
|
7.8.2 System Catalog Tables |
|
|
310 | (2) |
|
|
|
312 | (2) |
|
|
|
314 | (2) |
|
|
|
316 | (1) |
|
|
|
317 | (2) |
|
|
|
319 | (11) |
|
7.8.8 Not Logged Initially Tables |
|
|
330 | (1) |
|
|
|
331 | (3) |
|
|
|
334 | (6) |
|
|
|
340 | (1) |
|
7.8.12 Materialized Query Tables and Summary Tables |
|
|
341 | (1) |
|
|
|
342 | (1) |
|
|
|
343 | (4) |
|
7.9.1 Working with Indexes |
|
|
343 | (3) |
|
|
|
346 | (1) |
|
7.10 Multidimensional Clustering Tables and Block Indexes |
|
|
347 | (4) |
|
|
|
347 | (2) |
|
|
|
349 | (1) |
|
|
|
350 | (1) |
|
7.10.4 Choosing Dimensions for MDC Tables |
|
|
351 | (1) |
|
7.1 I Combining DPF, Table Partitioning, and MDC |
|
|
351 | (1) |
|
|
|
352 | (5) |
|
7.12.1 View Classification |
|
|
354 | (3) |
|
7.12.2 Using the-With Check Option |
|
|
357 | (1) |
|
|
|
357 | (1) |
|
|
|
357 | (1) |
|
|
|
358 | (2) |
|
|
|
360 | (2) |
|
7.16 User-Defined Functions |
|
|
362 | (2) |
|
|
|
364 | (2) |
|
|
|
366 | (3) |
|
|
|
366 | (2) |
|
|
|
368 | (1) |
|
|
|
369 | (1) |
|
|
|
370 | (5) |
|
Chapter 8 The DB2 Storage Model |
|
|
375 | (42) |
|
8.1 The DB2 Storage Model: The Big Picture |
|
|
375 | (2) |
|
8.2 Databases: Logical and Physical Storage of Your Data |
|
|
377 | (7) |
|
8.2.1 Creating a Database |
|
|
377 | (2) |
|
8.2.2 Database Creation Examples |
|
|
379 | (3) |
|
|
|
382 | (1) |
|
|
|
383 | (1) |
|
8.2.5 The Sample Database |
|
|
383 | (1) |
|
8.3 Database Partition Groups |
|
|
384 | (4) |
|
8.3.1 Database Partition Group Classifications |
|
|
384 | (1) |
|
8.3.2 Default Partition Groups |
|
|
385 | (1) |
|
8.3.3 Creating Database Partition Groups |
|
|
385 | (1) |
|
8.3.4 Modifying a Database Partition Group |
|
|
386 | (1) |
|
8.3.5 Listing Database Partition Groups |
|
|
387 | (1) |
|
8.3.6 Dropping a Database Partition Group |
|
|
388 | (1) |
|
|
|
388 | (18) |
|
|
|
388 | (1) |
|
|
|
389 | (1) |
|
|
|
389 | (1) |
|
|
|
389 | (2) |
|
8.4.5 Creating Table Spaces |
|
|
391 | (1) |
|
|
|
392 | (1) |
|
|
|
393 | (1) |
|
|
|
394 | (2) |
|
8.4.9 Table Space Considerations in a Multipartition Environment |
|
|
396 | (1) |
|
8.4.10 Listing Table Spaces |
|
|
397 | (4) |
|
8.4.11 Altering a Table Space |
|
|
401 | (5) |
|
|
|
406 | (4) |
|
8.5.1 Creating Buffer Pools |
|
|
406 | (3) |
|
8.5.2 Altering Buffer Pools |
|
|
409 | (1) |
|
8.5.3 Dropping Buffer Pools |
|
|
409 | (1) |
|
|
|
410 | (2) |
|
|
|
412 | (1) |
|
|
|
412 | (5) |
|
Chapter 9 Leveraging the Power of SQL |
|
|
417 | (36) |
|
|
|
418 | (15) |
|
|
|
418 | (1) |
|
9.1.2 The SELECT Statement with COUNT Aggregate Function |
|
|
419 | (1) |
|
9.1.3 The SELECT Statement with DISTINCT Clause |
|
|
419 | (1) |
|
9.1.4 DB2 Special Registers |
|
|
420 | (2) |
|
9.1.5 Scalar and Column Functions |
|
|
422 | (1) |
|
9.1.6 The CAST Expression |
|
|
422 | (1) |
|
|
|
423 | (1) |
|
9.1.8 Using Fetch First N Rows Only |
|
|
423 | (1) |
|
|
|
424 | (1) |
|
9.1.10 The Between Predicate |
|
|
425 | (1) |
|
|
|
425 | (1) |
|
9.1.12 The Order By Clause |
|
|
425 | (1) |
|
9.1.13 The Group By Having Clause |
|
|
426 | (1) |
|
|
|
427 | (2) |
|
9.1.15 Working with NULLs |
|
|
429 | (1) |
|
9.1.16 The CASE Expression |
|
|
429 | (1) |
|
9.1.17 Adding a Row Number to the Result Set |
|
|
430 | (3) |
|
|
|
433 | (1) |
|
9.3 Selecting from UPDATE, DELETE, or INSERT |
|
|
434 | (2) |
|
|
|
436 | (1) |
|
|
|
437 | (2) |
|
9.6 The UNION, INTERSECT, and EXCEPT Operators |
|
|
439 | (2) |
|
9.6.1 The UNION and UNION ALL Operators |
|
|
439 | (2) |
|
9.6.2 The INTERSECT and INTERSECT ALL Operators |
|
|
441 | (1) |
|
9.6.3 The EXCEPT and EXCEPT ALL Operators |
|
|
441 | (1) |
|
|
|
441 | (4) |
|
|
|
445 | (1) |
|
|
|
445 | (8) |
|
Chapter 10 Mastering the DB2 pureXML Support |
|
|
453 | (90) |
|
10.1 XML: The Big Picture |
|
|
454 | (24) |
|
|
|
456 | (1) |
|
10.1.2 Well-Formed versus Valid XML Documents |
|
|
457 | (2) |
|
|
|
459 | (1) |
|
|
|
460 | (4) |
|
10.1.5 Working with XML Documents |
|
|
464 | (6) |
|
10.1.6 XML versus the Relational Model |
|
|
470 | (3) |
|
|
|
473 | (5) |
|
|
|
478 | (8) |
|
10.2.1 pureXML Storage in DB2 |
|
|
478 | (7) |
|
10.2.2 Base-Table Inlining and Compression of XML Data |
|
|
485 | (1) |
|
10.2.3 The pureXML Engine |
|
|
485 | (1) |
|
|
|
486 | (21) |
|
10.3.1 Querying XML Data with XQuery |
|
|
486 | (10) |
|
10.3.2 Querying XML Data with SQL/XML |
|
|
496 | (11) |
|
10.4 SQL/XML Publishing Functions |
|
|
507 | (2) |
|
10.5 Transforming XML Documents Using XSLT Functions |
|
|
509 | (1) |
|
10.6 Inserting XML Data into a DB2 Database |
|
|
509 | (2) |
|
|
|
510 | (1) |
|
10.7 Updating and Deleting XML Data |
|
|
511 | (3) |
|
|
|
514 | (8) |
|
|
|
514 | (1) |
|
10.8.2 User-Created Indexes |
|
|
515 | (3) |
|
10.8.3 Conditions for XML Index Eligibility |
|
|
518 | (4) |
|
10.9 XML Schema Support and Validation in DB2 |
|
|
522 | (7) |
|
10.9.1 XML Schema Repository |
|
|
523 | (2) |
|
|
|
525 | (3) |
|
10.9.3 Compatible XML Schema Evolution |
|
|
528 | (1) |
|
10.10 Annotated XML Schema Decomposition |
|
|
529 | (3) |
|
10.11 XML Performance Considerations |
|
|
532 | (1) |
|
10.11.1 Choosing Correctly Where and How to Store Your XML Documents |
|
|
532 | (1) |
|
10.11.2 Creating Appropriate Indexes and Using SQL/XML and XQuery Statements Efficiently |
|
|
532 | (1) |
|
10.11.3 Ensure That Statistics on XML Columns Are Collected Accurately |
|
|
533 | (1) |
|
10.12 pureXML Restrictions |
|
|
533 | (1) |
|
|
|
534 | (4) |
|
|
|
538 | (1) |
|
|
|
538 | (5) |
|
Chapter 11 Implementing Security |
|
|
543 | (60) |
|
11.1 DB2 Security Model: The Big Picture |
|
|
543 | (2) |
|
|
|
545 | (13) |
|
11.2.1 Configuring the Authentication Type at a DB2 Server |
|
|
545 | (2) |
|
11.2.2 Configuring the Authentication Type at a DB2 Client |
|
|
547 | (2) |
|
11.2.3 Authenticating Users at/on the DB2 Server |
|
|
549 | (1) |
|
11.2.4 Authenticating Users Using the Kerberos Security Service |
|
|
550 | (1) |
|
11.2.5 Authenticating Users with Generic Security Service Plug-ins |
|
|
551 | (3) |
|
11.2.6 Authenticating Users at/on the DB2 Client(s) |
|
|
554 | (4) |
|
|
|
558 | (1) |
|
11.4 Administrative Authorities |
|
|
558 | (7) |
|
11.4.1 Managing Administrative Authorities |
|
|
562 | (3) |
|
11.5 Database Object Privileges |
|
|
565 | (18) |
|
|
|
565 | (1) |
|
11.5.2 Table Space Privileges |
|
|
566 | (1) |
|
11.5.3 Table and View Privileges |
|
|
567 | (2) |
|
|
|
569 | (1) |
|
11.5.5 Package Privileges |
|
|
570 | (1) |
|
11.5.6 Routine Privileges |
|
|
570 | (1) |
|
11.5.7 Sequence Privileges |
|
|
571 | (2) |
|
11.5.8 XSR Object Privileges |
|
|
573 | (1) |
|
11.5.9 Security Label Privileges |
|
|
574 | (1) |
|
11.5.10 LBAC Rule Exemption Privileges |
|
|
575 | (1) |
|
11.5.11 SET SESSION AUTHORIZATION Statement and SETSESSIONUSER Privilege |
|
|
576 | (1) |
|
11.5.12 Implicit Privileges |
|
|
577 | (2) |
|
11.5.13 Roles and Privileges |
|
|
579 | (2) |
|
11.5.14 TRANSFER OWNERSHIP Statement |
|
|
581 | (2) |
|
11.6 Label-Based Access Control (LBAC) |
|
|
583 | (7) |
|
|
|
586 | (1) |
|
11.6.2 Implementing an LBAC Security Solution |
|
|
586 | (2) |
|
|
|
588 | (1) |
|
11.6.4 Column Level Security |
|
|
589 | (1) |
|
11.7 Authority and Privilege Metadata |
|
|
590 | (4) |
|
11.8 Windows Domain Considerations |
|
|
594 | (2) |
|
11.8.1 Windows Global Groups and Local Groups |
|
|
594 | (2) |
|
|
|
596 | (1) |
|
11.9 Trusted Contexts Security Enhancement |
|
|
596 | (2) |
|
|
|
598 | (1) |
|
|
|
599 | (1) |
|
|
|
600 | (3) |
|
Chapter 12 Understanding Concurrency and Locking |
|
|
603 | (48) |
|
12.1 DB2 Locking and Concurrency: The Big Picture |
|
|
603 | (1) |
|
12.2 Concurrency and Locking Scenarios |
|
|
604 | (3) |
|
|
|
604 | (2) |
|
|
|
606 | (1) |
|
12.2.3 Nonrepeatable Reads |
|
|
606 | (1) |
|
|
|
607 | (1) |
|
12.3 DB2 Isolation Levels |
|
|
607 | (5) |
|
|
|
608 | (1) |
|
|
|
609 | (1) |
|
|
|
610 | (1) |
|
|
|
611 | (1) |
|
12.4 Changing Isolation Levels |
|
|
612 | (7) |
|
12.4.1 Using the DB2 Command Window |
|
|
613 | (1) |
|
12.4.2 Using the DB2 PRECOMPILE and BIND Commands |
|
|
613 | (2) |
|
12.4.3 Using the DB2 Call Level Interface |
|
|
615 | (2) |
|
12.4.4 Using the Application Programming Interface |
|
|
617 | (1) |
|
12.4.5 Working with Statement Level Isolation Level |
|
|
618 | (1) |
|
|
|
619 | (11) |
|
|
|
619 | (6) |
|
|
|
625 | (2) |
|
|
|
627 | (1) |
|
|
|
628 | (1) |
|
|
|
629 | (1) |
|
12.6 Diagnosing Lock Problems |
|
|
630 | (13) |
|
12.6.1 Using the list applications Command |
|
|
630 | (1) |
|
12.6.2 Using the force application Command |
|
|
631 | (2) |
|
12.6.3 Using the Snapshot Monitor |
|
|
633 | (3) |
|
12.6.4 Using Snapshot Table Functions |
|
|
636 | (1) |
|
12.6.5 Using the Event Monitor |
|
|
636 | (1) |
|
12.6.6 Using the Activity Monitor |
|
|
637 | (6) |
|
12.6.7 Using the Health Center |
|
|
643 | (1) |
|
12.7 Techniques to Avoid Locking |
|
|
643 | (3) |
|
|
|
646 | (1) |
|
|
|
647 | (1) |
|
|
|
647 | (4) |
|
Chapter 13 Maintaining Data |
|
|
651 | |
|
13.1 DB2 Data Movement Utilities: The Big Picture |
|
|
651 | (2) |
|
13.2 Data Movement File Formats |
|
|
653 | (1) |
|
13.2.1 Delimited ASCII (DEL) Format |
|
|
653 | (1) |
|
13.2.2 Non-Delimited ASCII (ASC) Format |
|
|
653 | (1) |
|
13.2.3 PC Version of IXF (PC/IXF) Format |
|
|
654 | (1) |
|
|
|
654 | (1) |
|
|
|
654 | (1) |
|
13.3 The DB2 EXPORT Utility |
|
|
654 | (13) |
|
13.3.1 File Type Modifiers Supported in the Export Utility |
|
|
656 | (1) |
|
13.3.2 Exporting Large Objects |
|
|
657 | (2) |
|
13.3.3 Exporting XML Data |
|
|
659 | (4) |
|
13.3.4 Specifying Column Names |
|
|
663 | (1) |
|
13.3.5 Authorities Required to Perform an Export |
|
|
664 | (1) |
|
13.3.6 Exporting a Table Using the Control Center |
|
|
664 | (2) |
|
13.3.7 Run an export Command Using the ADMIN_CMD Procedure |
|
|
666 | (1) |
|
13.4 The DB2 IMPORT Utility |
|
|
667 | (9) |
|
|
|
669 | (1) |
|
13.4.2 Allow Concurrent Write Access |
|
|
670 | (1) |
|
13.4.3 Regular Commits during an Import |
|
|
670 | (1) |
|
13.4.4 Restarting a Failed Import |
|
|
671 | (1) |
|
13.4.5 File Type Modifiers Supported in the Import Utility |
|
|
672 | (1) |
|
13.4.6 Importing Large Objects |
|
|
672 | (1) |
|
13.4.7 Importing XML Data |
|
|
673 | (1) |
|
13.4.8 Select Columns to Import |
|
|
674 | (1) |
|
13.4.9 Authorities Required to Perform an Import |
|
|
675 | (1) |
|
13.4.10 Importing a Table Using the Control Center |
|
|
676 | (1) |
|
13.4.11 Run an import Command with the ADMIN_CMD Procedure |
|
|
676 | (1) |
|
13.5 The DB2 Load Utility |
|
|
676 | (21) |
|
|
|
677 | (1) |
|
|
|
678 | (8) |
|
13.5.3 File Type Modifiers Supported in the load Utility |
|
|
686 | (3) |
|
13.5.4 Loading Large Objects |
|
|
689 | (1) |
|
|
|
689 | (1) |
|
13.5.6 Collecting Statistics |
|
|
690 | (1) |
|
13.5.7 The COPY YES/NO and NONRECOVERABLE Options |
|
|
690 | (1) |
|
13.5.8 Validating Data against Constraints |
|
|
690 | (1) |
|
13.5.9 Performance Considerations |
|
|
691 | (1) |
|
13.5.10 Authorities Required to Perform a Load |
|
|
691 | (1) |
|
13.5.11 Loading a Table Using the Control Center |
|
|
692 | (1) |
|
13.5.12 Run a load Command with the ADMIN_CMD Procedure |
|
|
693 | (1) |
|
13.5.13 Monitoring a Load Operation |
|
|
693 | (4) |
|
|
|
697 | (3) |
|
13.7 The db2relocatedb Utility |
|
|
700 | (1) |
|
13.8 Generating Data Definition Language |
|
|
701 | (2) |
|
13.9 DB2 Maintenance Utilities |
|
|
703 | (12) |
|
13.9.1 The RUNSTATS Utility |
|
|
703 | (2) |
|
13.9.2 The REORG and REORGCHK Utilities |
|
|
705 | (5) |
|
13.9.3 The REBIND Utility and the FLUSH PACKAGE CACHE Command |
|
|
710 | (1) |
|
13.9.4 Database Maintenance Process |
|
|
710 | (1) |
|
13.9.5 Automatic Database Maintenance |
|
|
711 | (4) |
|
|
|
715 | (2) |
|
|
|
717 | (1) |
|
|
|
717 | |
|
Chapter 14 Developing Database Backup and Recovery Solutions |
|
|
72 | (739) |
|
14.1 Database Recovery Concepts: The Big Picture |
|
|
721 | (4) |
|
14.1.1 Recovery Scenarios |
|
|
722 | (1) |
|
14.1.2 Recovery Strategies |
|
|
722 | (1) |
|
14.1.3 Unit of Work (Transaction) |
|
|
723 | (1) |
|
|
|
723 | (2) |
|
14.2 DB2 Transaction Logs |
|
|
725 | (1) |
|
142.1 Understanding the DB2 Transaction Logs |
|
|
725 | (12) |
|
14.2.2 Primary and Secondary Log Files |
|
|
727 | (3) |
|
|
|
730 | (1) |
|
|
|
731 | (6) |
|
14.2.5 Handling the DB2 Transaction Logs |
|
|
737 | (1) |
|
14.3 Recovery Terminology |
|
|
737 | (1) |
|
14.3.1 Logging Methods versus Recovery Methods |
|
|
737 | (1) |
|
14.3.2 Recoverable versus Nonrecoverable Databases |
|
|
737 | (1) |
|
14.4 Performing Database and Table Space Backups |
|
|
738 | (8) |
|
14.4.1 Online Access versus Offline Access |
|
|
738 | (1) |
|
|
|
738 | (4) |
|
14.4.3 Table Space Backup |
|
|
742 | (1) |
|
14.4.4 Incremental Backups |
|
|
743 | (1) |
|
14.4.5 Backing Up a Database with the Control Center |
|
|
744 | (1) |
|
|
|
745 | (1) |
|
14.5 Database and Table Space Recovery Using the RESTORE DATABASE Command |
|
|
746 | (8) |
|
|
|
746 | (2) |
|
14.5.2 Table Space Recovery |
|
|
748 | (1) |
|
14.5.3 Table Space Recovery Considerations |
|
|
749 | (1) |
|
14.5.4 Restoring a Database with the Control Center |
|
|
750 | (1) |
|
14.5.5 Redirected Restore |
|
|
750 | (4) |
|
14.6 Database and Table Space Roll Forward |
|
|
754 | (4) |
|
14.6.1 Database Roll Forward |
|
|
754 | (3) |
|
14.6.2 Table Space Roll Forward |
|
|
757 | (1) |
|
14.6.3 Table Space Roll Forward Considerations |
|
|
757 | (1) |
|
14.6.4 Roll Forward a Database Using the Control Center |
|
|
757 | (1) |
|
14.7 Recovering a Dropped Table |
|
|
758 | (2) |
|
14.8 The Recovery History File |
|
|
760 | (2) |
|
14.9 Database Recovery Using the RECOVER DATABASE Command |
|
|
762 | (2) |
|
14.10 Rebuild Database Option |
|
|
764 | (9) |
|
14.10.1 Rebuilding a Recoverable Database Using Table Space Backups |
|
|
764 | (4) |
|
14.10.2 Rebuilding a Recoverable Database Using Only a Subset of the Table Space Backups |
|
|
768 | (2) |
|
14.10.3 Rebuilding a Recoverable Database Using Online Backup Images That Contain Log Files |
|
|
770 | (1) |
|
14.10.4 Rebuilding a Recoverable Database Using Incremental Backup Images |
|
|
771 | (1) |
|
14.10.5 Rebuilding a Recoverable Database Using the Redirect Option |
|
|
771 | (1) |
|
14.10.6 Rebuilding a Nonrecoverable Database |
|
|
772 | (1) |
|
14.10.7 Database Rebuild Restrictions |
|
|
772 | (1) |
|
14.11 Backup Recovery through Online Split Mirroring and Suspended I/O Support |
|
|
773 | (1) |
|
14.11.1 Split Mirroring Key Concepts |
|
|
773 | (1) |
|
|
|
774 | (6) |
|
14.11.3 Cloning a Database Using the db2inidb Snapshot Option |
|
|
775 | (2) |
|
14.11.4 Creating a Standby Database Using the db2inidb Standby Option |
|
|
777 | (2) |
|
14.11.5 Creating a Backup Image of the Primary Database Using the db2inidb Mirror Option |
|
|
779 | (1) |
|
14.1 1.6 Split Mirroring in Partitioned Environments |
|
|
780 | (2) |
|
14.11.7 Integrated Flash Copy |
|
|
781 | (1) |
|
14.12 Maintaining High Availability with DB2 |
|
|
782 | (17) |
|
|
|
782 | (2) |
|
14.12.2 Overview of DB2 High Availability Disaster Recovery (HADR) |
|
|
784 | (15) |
|
|
|
799 | (2) |
|
14.13.1 The Fault Monitor Facility (Linux and UNIX Only) |
|
|
799 | (1) |
|
14.13.2 Fault Monitor Registry File |
|
|
799 | (1) |
|
14.13.3 Setting Up the DB2 Fault Monitor |
|
|
800 | (1) |
|
|
|
801 | (4) |
|
|
|
805 | (6) |
|
Chapter 15 The DB2 Process Model |
|
|
811 | (32) |
|
15.1 The DB2 Process Model: The Big Picture |
|
|
811 | (3) |
|
15.2 Threaded Engine Infrastructure |
|
|
814 | (2) |
|
|
|
814 | (2) |
|
15.3 The DB2 Engine Dispatchable Units |
|
|
816 | (15) |
|
15.3.1 The DB2 Instance-Level EDUs |
|
|
817 | (4) |
|
15.3.2 The DB2 Database-Level EDUs |
|
|
821 | (4) |
|
15.3.3 The Application-Level EDUs |
|
|
825 | (2) |
|
|
|
827 | (4) |
|
15.4 Tuning the Number of EDUs |
|
|
831 | (2) |
|
15.5 Monitoring and Tuning the DB2 Agents |
|
|
833 | (1) |
|
15.6 The Connection Concentrator |
|
|
834 | (1) |
|
15.7 Commonly Seen DB2 Executables |
|
|
835 | (1) |
|
15.8 Additional Services/Processes on Windows |
|
|
836 | (1) |
|
|
|
837 | (1) |
|
|
|
838 | (1) |
|
|
|
839 | (4) |
|
Chapter 16 The DB2 Memory Model |
|
|
843 | (22) |
|
16.1 DB2 Memory Allocation: The Big Picture |
|
|
843 | (2) |
|
16.2 Instance-Level Shared Memory |
|
|
845 | (1) |
|
16.3 Database-Level Shared Memory |
|
|
846 | (4) |
|
16.3.1 The Database Buffer Pools |
|
|
848 | (1) |
|
16.3.2 The Database Lock List |
|
|
848 | (1) |
|
16.3.3 The Database Shared Sort Heap Threshold |
|
|
848 | (1) |
|
|
|
848 | (1) |
|
16.3.5 The Utility Heap Size |
|
|
849 | (1) |
|
|
|
849 | (1) |
|
16.3.7 Database Logging Parameters |
|
|
849 | (1) |
|
|
|
849 | (1) |
|
16.4 Application-Level Shared Memory |
|
|
850 | (3) |
|
16.4.1 Application Shared Heap |
|
|
851 | (1) |
|
|
|
851 | (1) |
|
|
|
852 | (1) |
|
|
|
852 | (1) |
|
16.4.5 Application Memory |
|
|
852 | (1) |
|
16.5 Agent Private Memory |
|
|
853 | (2) |
|
16.5.1 The Sort Heap and Sort Heap Threshold |
|
|
854 | (1) |
|
|
|
855 | (1) |
|
16.5.3 Client I/O Block Size |
|
|
855 | (1) |
|
16.5.4 Java Interpreter Heap |
|
|
855 | (1) |
|
|
|
855 | (2) |
|
|
|
857 | (4) |
|
|
|
861 | (1) |
|
|
|
861 | (4) |
|
Chapter 17 Database Performance Considerations |
|
|
865 | (44) |
|
17.1 Relation Data Performance Fundamentals |
|
|
866 | (1) |
|
17.2 System/Server Configuration |
|
|
866 | (3) |
|
17.2.1 Ensuring There Is Enough Memory Available |
|
|
866 | (1) |
|
17.2.2 Ensuring There Are Enough Disks to Handle I/O |
|
|
867 | (2) |
|
17.2.3 Ensuring There Are Enough CPUs to Handle the Workload |
|
|
869 | (1) |
|
17.3 The DB2 Configuration Advisor |
|
|
869 | (8) |
|
17.3.1 Invoking the Configuration Advisor from the Command Line |
|
|
869 | (1) |
|
17.3.2 Invoking the Configuration Advisor from the Control Center |
|
|
870 | (7) |
|
17.4 Configuring the DB2 Instance |
|
|
877 | (2) |
|
17.4.1 Maximum Requester I/O Block Size |
|
|
878 | (1) |
|
17.4.2 Intra-Partition Parallelism |
|
|
878 | (1) |
|
17.4.3 Sort Heap Threshold |
|
|
878 | (1) |
|
17.4.4 The DB2 Agent Pool |
|
|
879 | (1) |
|
17.5 Configuring Your Databases |
|
|
879 | (5) |
|
17.5.1 Average Number of Active Applications |
|
|
880 | (1) |
|
|
|
881 | (1) |
|
|
|
881 | (1) |
|
|
|
882 | (1) |
|
17.5.5 Buffer Pool Prefetching and Cleaning |
|
|
883 | (1) |
|
17.6 Lack of Proper Maintenance |
|
|
884 | (4) |
|
17.7 Automatic Maintenance |
|
|
888 | (2) |
|
17.8 The Snapshot Monitor |
|
|
890 | (3) |
|
17.8.1 Setting the Monitor Switches |
|
|
891 | (1) |
|
17.8.2 Capturing Snapshot Information |
|
|
892 | (1) |
|
17.8.3 Resetting the Snapshot Monitor Switches |
|
|
892 | (1) |
|
|
|
893 | (3) |
|
|
|
896 | (1) |
|
17.11 The Explain Tool and Explain Tables |
|
|
897 | (1) |
|
17.12 Using Visual Explain to Examine Access Plans |
|
|
898 | (1) |
|
17.13 Workload Management |
|
|
899 | (3) |
|
17.13.1 Preemptive Workload Management |
|
|
900 | (1) |
|
17.13.2 Reactive Workload Management |
|
|
901 | (1) |
|
|
|
902 | (3) |
|
|
|
905 | (1) |
|
|
|
905 | (4) |
|
Chapter 18 Diagnosing Problems |
|
|
909 | (28) |
|
18.1 Problem Diagnosis: The Big Picture |
|
|
909 | (1) |
|
18.2 How DB2 Reports Issues |
|
|
909 | (2) |
|
18.3 DB2 Error Message Description |
|
|
911 | (2) |
|
18.4 DB2 First Failure Data Capture |
|
|
913 | (6) |
|
18.4.1 DB2 Instance-Level Configuration Parameters Related to FFDC |
|
|
915 | (2) |
|
18.4.2 db2diag.log Example |
|
|
917 | (1) |
|
18.4.3 Administration Notification Log Examples |
|
|
918 | (1) |
|
18.5 Receiving E-mail Notifications |
|
|
919 | (2) |
|
18.6 Tools for Troubleshooting |
|
|
921 | (9) |
|
18.6.1 The db2support tool |
|
|
921 | (1) |
|
18.6.2 The DB2 Trace Facility |
|
|
922 | (1) |
|
|
|
923 | (1) |
|
|
|
924 | (2) |
|
18.6.5 DB2COS (DB2 Call Out Script) |
|
|
926 | (1) |
|
|
|
927 | (2) |
|
18.6.7 First Occurrence Data Capture (FODC) |
|
|
929 | (1) |
|
18.7 Searching for Known Problems |
|
|
930 | (1) |
|
|
|
931 | (3) |
|
|
|
934 | (1) |
|
|
|
935 | (2) |
| Appendix A Solutions to the Review Questions |
|
937 | (24) |
| Appendix B Use of Uppercase versus Lowercase in DB2 |
|
961 | (4) |
| Appendix C IBM Servers |
|
965 | (2) |
| Appendix D Using the DB2 System Catalog Tables |
|
967 | (14) |
| Resources |
|
981 | (6) |
| Index |
|
987 | |