About the Author |
|
xix | |
About the Technical Reviewer |
|
xxi | |
Acknowledgments |
|
xxiii | |
Introduction |
|
xxv | |
|
|
|
What Is DB2 and Where Can I Get It? |
|
|
3 | (8) |
|
Who Should REad This Book? |
|
|
3 | (1) |
|
|
4 | (1) |
|
DB2 Has History on Its Side |
|
|
4 | (1) |
|
DB2 Is at the Forefront of Database Technology Today |
|
|
4 | (1) |
|
DB2 Will Be Even Bigger in the Future |
|
|
4 | (1) |
|
Choosing the Right DB2 Edition For You |
|
|
5 | (1) |
|
Obtaining DB2: A World of Choice |
|
|
6 | (3) |
|
|
9 | (2) |
|
Installing DB2 for Linux and Windows |
|
|
11 | (28) |
|
|
11 | (1) |
|
|
11 | (1) |
|
Unpacking Installation Downloads |
|
|
12 | (1) |
|
Using the DB2 9 Discovery Kit DVD |
|
|
12 | (1) |
|
Checking Preinstallation Requirements |
|
|
13 | (2) |
|
|
13 | (1) |
|
|
13 | (1) |
|
|
14 | (1) |
|
Other Configuration Prerequisites |
|
|
15 | (1) |
|
Proceeding with the Installation |
|
|
15 | (17) |
|
Graphical Installation Under Windows and Linux |
|
|
15 | (17) |
|
Command-Line Installation Under Linux |
|
|
32 | (2) |
|
|
34 | (1) |
|
Reviewing Your DB2 Installation |
|
|
35 | (1) |
|
|
35 | (4) |
|
PART 2 Beginning Administration with DB2 Express Edition |
|
|
|
DB2 Wizards: The Fast Path to Working with Your New Database |
|
|
39 | (24) |
|
|
39 | (6) |
|
Launching DB2 First Steps Under Windows |
|
|
40 | (1) |
|
Launching DB2 First Steps Under Linux |
|
|
41 | (2) |
|
Working with DB2 First Steps |
|
|
43 | (2) |
|
Creating the SAMPLE Database |
|
|
45 | (2) |
|
|
47 | (8) |
|
Starting the DB2 Control Center from First Steps |
|
|
47 | (1) |
|
Starting the DB2 Control Center in Other Ways |
|
|
48 | (1) |
|
Selecting Your Preferred DB2 Control Center View |
|
|
49 | (1) |
|
Browsing the DB2 Control Center Object Views |
|
|
50 | (2) |
|
Invoking the Create Table Control Center Wizard |
|
|
52 | (3) |
|
Using the DB2 Command Editor |
|
|
55 | (3) |
|
Command-Line Control of Your DB2 Environment |
|
|
58 | (3) |
|
Powering Up the Command Line Processor |
|
|
58 | (1) |
|
Learning About the Commands |
|
|
59 | (1) |
|
Connecting and Disconnecting |
|
|
60 | (1) |
|
|
61 | (2) |
|
Controlling Your Environment with DB2 Control Center and Command-Line Tools |
|
|
63 | (26) |
|
Getting Started as the Right User |
|
|
63 | (1) |
|
Starting and Stopping DB2 processes |
|
|
64 | (6) |
|
|
64 | (2) |
|
|
66 | (4) |
|
|
70 | (3) |
|
DB2 Instances and the DAS Instance |
|
|
70 | (1) |
|
|
71 | (1) |
|
|
71 | (1) |
|
The DB2 Management Service |
|
|
71 | (1) |
|
The DB2 Remote Command Server |
|
|
72 | (1) |
|
|
72 | (1) |
|
The DB2 Fault Monitor Coordinator |
|
|
72 | (1) |
|
Configuring and Changing your DB2 Instances and Databases |
|
|
73 | (9) |
|
Two Different Levels of Configuration |
|
|
74 | (1) |
|
Configuring Your DB2 Instances from the Control Center |
|
|
75 | (3) |
|
Configuring a DB2 Database from the Control Center |
|
|
78 | (1) |
|
Configuring and Changing Your DB2 Instances from the CLP |
|
|
79 | (2) |
|
Configuring and Changing a DB2 Database from the CLP |
|
|
81 | (1) |
|
More GUI Tools to Help You Manage DB2 |
|
|
82 | (1) |
|
More Tools Available form the Command Line |
|
|
82 | (3) |
|
The Version Information Utility: DB2LEVEL |
|
|
82 | (1) |
|
The DB2 Registry Utility: DB2SET |
|
|
83 | (1) |
|
The Instance Listing Utilities: DB2ILIST and DASLIST |
|
|
83 | (1) |
|
The DB2 Problem Determination Tool: DB2PD |
|
|
84 | (1) |
|
|
85 | (4) |
|
PART 3 Database Fundamentals with DB2 Express Edition |
|
|
|
|
89 | (22) |
|
|
90 | (1) |
|
|
91 | (3) |
|
Multiple Installers for Data Studio |
|
|
91 | (1) |
|
The Power of Eclipse-Based IDE Installations |
|
|
92 | (2) |
|
|
94 | (6) |
|
Starting a New Data project |
|
|
95 | (2) |
|
New Project Connection Management |
|
|
97 | (3) |
|
Adding Objects to Your Project |
|
|
100 | (9) |
|
|
100 | (4) |
|
New Stored Procedure Wizard |
|
|
104 | (5) |
|
|
109 | (2) |
|
|
111 | (16) |
|
Manipulating Data with SQL |
|
|
111 | (15) |
|
|
112 | (12) |
|
|
124 | (1) |
|
|
125 | (1) |
|
|
126 | (1) |
|
|
126 | (1) |
|
|
127 | (16) |
|
Creating and Managing DB2 Tables |
|
|
127 | (4) |
|
|
127 | (3) |
|
|
130 | (1) |
|
|
131 | (1) |
|
Specifying Column Details and Constraints |
|
|
132 | (6) |
|
|
132 | (1) |
|
|
133 | (1) |
|
|
134 | (2) |
|
|
136 | (1) |
|
Disabling Constraints and Constraint Deferral |
|
|
137 | (1) |
|
Automatic Value Generation for Columns |
|
|
138 | (2) |
|
Specifying Table Storage Characteristics |
|
|
140 | (1) |
|
Other Table Characteristics |
|
|
141 | (1) |
|
Other Techniques for Table Creation |
|
|
142 | (1) |
|
|
142 | (1) |
|
Developing Functions and Stored Procedures in DB2 |
|
|
143 | (20) |
|
|
143 | (13) |
|
Creating Stored Procedures in DB2 |
|
|
143 | (9) |
|
|
152 | (2) |
|
|
154 | (1) |
|
Further Reading on DB2 Stored Procedures |
|
|
155 | (1) |
|
User-Defined Functions in DB2 |
|
|
156 | (5) |
|
Types of User-Defined Functions in DB2 |
|
|
156 | (1) |
|
Creating User-Defined Functions in DB2 |
|
|
157 | (2) |
|
Calling User-Defined Functions in DB2 |
|
|
159 | (2) |
|
Managing and Deleting User-Defined Functions |
|
|
161 | (1) |
|
|
161 | (2) |
|
Controlling Access to DB2 |
|
|
163 | (14) |
|
DB2 Building Blocks for Authentication |
|
|
164 | (4) |
|
Configuring Where and When DB2 Authenticates Users |
|
|
164 | (3) |
|
Choosing Your Authentication Option |
|
|
167 | (1) |
|
DB2 Instance-Level Privileged Groups |
|
|
168 | (1) |
|
Changing Your DB2 Authentication Parameters |
|
|
169 | (4) |
|
Using Control center to Manage Authentication Parameters |
|
|
170 | (2) |
|
Using DB2 CLP to Manage Authentication Parameters |
|
|
172 | (1) |
|
Group Authentication Issues |
|
|
173 | (1) |
|
Configuring DB2 to Use Local or Global Groups |
|
|
173 | (1) |
|
|
174 | (1) |
|
Support for Windows AD Domain Features |
|
|
174 | (1) |
|
Security Context of the DB2 Server |
|
|
174 | (1) |
|
|
175 | (2) |
|
|
177 | (18) |
|
Managing Authorities and Privileges in DB2 |
|
|
177 | (8) |
|
Preparing to Use Authorities and Privileges |
|
|
177 | (1) |
|
Database-Level Authorities |
|
|
177 | (5) |
|
|
182 | (2) |
|
|
184 | (1) |
|
Managing Object Privileges in DB2 |
|
|
185 | (9) |
|
Working with Privileges on DB2 Objects |
|
|
185 | (2) |
|
Granting Object Privileges to Users |
|
|
187 | (3) |
|
Label-Based Access Control in DB2 |
|
|
190 | (2) |
|
|
192 | (2) |
|
|
194 | (1) |
|
|
195 | (20) |
|
Exploring XML in the Sample Database |
|
|
195 | (3) |
|
|
198 | (10) |
|
|
199 | (5) |
|
Using XPath Queries for XML |
|
|
204 | (3) |
|
More pure XML Features for Querying Data |
|
|
207 | (1) |
|
|
208 | (6) |
|
|
208 | (2) |
|
XML Schema Registration in DB2 |
|
|
210 | (2) |
|
|
212 | (1) |
|
|
213 | (1) |
|
|
214 | (1) |
|
Indexes, Sequences, and Views |
|
|
215 | (26) |
|
|
215 | (13) |
|
|
215 | (2) |
|
|
217 | (1) |
|
The Important Case of Foreign Keys |
|
|
218 | (1) |
|
Understanding Other Index Features |
|
|
219 | (2) |
|
|
221 | (6) |
|
|
227 | (1) |
|
|
228 | (5) |
|
|
228 | (2) |
|
|
230 | (1) |
|
|
231 | (2) |
|
|
233 | (1) |
|
|
233 | (4) |
|
|
233 | (2) |
|
|
235 | (2) |
|
|
237 | (1) |
|
|
237 | (4) |
|
PART 4 Programming with DB2 Express Edition |
|
|
|
|
241 | (22) |
|
PHP and Zend Core for DB2 |
|
|
241 | (7) |
|
Starting an Install of Zend Core |
|
|
242 | (2) |
|
Continuing the Installation |
|
|
244 | (3) |
|
|
247 | (1) |
|
Developing with the IBM_DB2 PHP Extensions |
|
|
248 | (10) |
|
|
248 | (4) |
|
Managing IBM_DB2 PHP Connections |
|
|
252 | (1) |
|
Working with Ad Hoc SQL Statements |
|
|
252 | (3) |
|
Working with Prepared Statements and Stored Procedures |
|
|
255 | (2) |
|
Other IBM_DB2 PHP Functions |
|
|
257 | (1) |
|
Developing with the Zend Framework |
|
|
258 | (4) |
|
Configuring the Zend Framework |
|
|
258 | (1) |
|
Managing Connections with the Zend Framework |
|
|
259 | (1) |
|
Executing Statements Using the Zend Core Framework |
|
|
260 | (2) |
|
Other Major Classes in the Zend Core Framework |
|
|
262 | (1) |
|
|
262 | (1) |
|
|
263 | (16) |
|
Installing Ruby and Rails |
|
|
263 | (4) |
|
Developing with Ruby, Rails, and DB2 |
|
|
267 | (7) |
|
Creating a Project with Rails |
|
|
267 | (1) |
|
Connecting a Rails Project to DB2 |
|
|
268 | (1) |
|
Designing DB2 Tables in Rails |
|
|
269 | (2) |
|
Executing a Migration in Ruby for DB2 |
|
|
271 | (1) |
|
Evolving Your DB2 Schema with Ruby on Rails |
|
|
272 | (1) |
|
The Schema_Info Table for Ruby on Rails |
|
|
273 | (1) |
|
Reverting to Earlier Schema Incarnations |
|
|
274 | (1) |
|
Ruby on Rails Scaffolding for DB2 |
|
|
274 | (3) |
|
Generating the Scaffolding |
|
|
275 | (1) |
|
Ruby on Rails Scaffolding in Action with DB2 |
|
|
275 | (2) |
|
|
277 | (2) |
|
DB2 Development with Microsoft Visual Studio.NET |
|
|
279 | (22) |
|
Installing IBM Database Add-Ins |
|
|
279 | (7) |
|
Registering the IBM Data Server Provider for NET |
|
|
281 | (1) |
|
Testing DB2 .NET Connectivity |
|
|
282 | (1) |
|
Completing the Installation |
|
|
283 | (1) |
|
Testing the Database Add-Ins |
|
|
283 | (3) |
|
|
286 | (4) |
|
Creating a New DB2 View Object |
|
|
287 | (2) |
|
Building the DB2 Database Project |
|
|
289 | (1) |
|
Building .NET Windows Applications with DB2 |
|
|
290 | (5) |
|
Binding DB2 Objects to Windows Controls |
|
|
291 | (1) |
|
Specifying a DB2 Connection for a Windows C# Project |
|
|
292 | (2) |
|
Exploring a Connection's Related Objects |
|
|
294 | (1) |
|
Building and Running the Windows Project |
|
|
294 | (1) |
|
Building .NET Web Applications with DB2 |
|
|
295 | (4) |
|
Binding DB2 Objects to Web Controls |
|
|
296 | (2) |
|
Building and Running the Web Project |
|
|
298 | (1) |
|
|
299 | (2) |
|
Developing Java Applications with DB2 |
|
|
301 | (22) |
|
Writing JDBC Applications for DB2 |
|
|
302 | (9) |
|
|
302 | (1) |
|
Writing the First Java DB2 Application |
|
|
303 | (2) |
|
Refactoring the Connection Code |
|
|
305 | (2) |
|
|
307 | (2) |
|
Working with DB2 JDBC Features |
|
|
309 | (2) |
|
Developing Java Stored Procedures |
|
|
311 | (4) |
|
Writing the Stored Procedure Java Class |
|
|
311 | (1) |
|
Deploying the Java Stored Procedure Class |
|
|
312 | (1) |
|
Writing the Stored Procedure |
|
|
313 | (1) |
|
Testing the Java DB2 Stored Procedure |
|
|
314 | (1) |
|
Getting Started with DB2 pureQuery for Java |
|
|
315 | (7) |
|
Creating a pureQuery-Enabled Project |
|
|
315 | (3) |
|
Autogenerating pureQuery Java Mapping Classes |
|
|
318 | (3) |
|
Examining pureQuery Results |
|
|
321 | (1) |
|
|
322 | (1) |
|
Exploring More DB2 Development Options |
|
|
323 | (14) |
|
|
323 | (7) |
|
Installing the Perl DBI and DBD::DB2 Modules |
|
|
324 | (3) |
|
|
327 | (1) |
|
|
328 | (2) |
|
Going Further with Perl and DB2 |
|
|
330 | (1) |
|
|
330 | (3) |
|
Installing the Python DB2 Driver |
|
|
330 | (2) |
|
|
332 | (1) |
|
|
332 | (1) |
|
Going Further with Python and DB2 |
|
|
332 | (1) |
|
|
333 | (1) |
|
|
333 | (1) |
|
|
333 | (1) |
|
|
333 | (1) |
|
Visual Basic and Visual Basic.NET |
|
|
334 | (1) |
|
|
334 | (1) |
|
|
334 | (3) |
|
PART 5 Ongoing Database Administration with DB2 |
|
|
|
Database Creation and Configuration |
|
|
337 | (22) |
|
Building Blocks of DB2 Databases |
|
|
337 | (1) |
|
|
338 | (4) |
|
|
339 | (1) |
|
Handling Languages and Text in DB2 Databases |
|
|
340 | (2) |
|
Managing Storage for the DB2 Database |
|
|
342 | (6) |
|
Understanding Tablespace Use in DB2 |
|
|
342 | (1) |
|
Choosing the Right Tablespace Storage Management Type |
|
|
343 | (1) |
|
Using System Managed Storage Tablespaces |
|
|
344 | (1) |
|
Using Database Managed Storage Tablespaces |
|
|
345 | (1) |
|
Tuning Initial Tablespace Parameters |
|
|
346 | (1) |
|
|
347 | (1) |
|
Moving Beyond Database, Tablespace, and Buffer Pool Basics |
|
|
348 | (9) |
|
Creating Databases with Many Options |
|
|
349 | (1) |
|
|
349 | (1) |
|
Working with Tablespaces and Buffer Pools |
|
|
350 | (6) |
|
|
356 | (1) |
|
|
357 | (2) |
|
|
359 | (26) |
|
|
359 | (1) |
|
Permissions for Backup and Recovery |
|
|
359 | (1) |
|
Understanding DB2 Logging |
|
|
360 | (6) |
|
General Logging Principles |
|
|
360 | (1) |
|
|
361 | (1) |
|
|
361 | (1) |
|
|
362 | (3) |
|
|
365 | (1) |
|
|
366 | (1) |
|
|
366 | (9) |
|
|
367 | (1) |
|
Taking Backups from the Control Center |
|
|
368 | (4) |
|
Advanced Backup Options from the Command Line |
|
|
372 | (3) |
|
Database Recovery with DB2 |
|
|
375 | (8) |
|
Database Recovery for Free |
|
|
375 | (1) |
|
Restoring a Database from Backup |
|
|
375 | (1) |
|
Roll Forward Recovery from a Backup |
|
|
376 | (1) |
|
Database Recovery Using the Control Center |
|
|
377 | (4) |
|
Advanced Recovery Options from the Command Line |
|
|
381 | (2) |
|
|
383 | (2) |
|
Sharing Your DB2 Environment |
|
|
385 | (22) |
|
DB2 Clients on Linux and Windows |
|
|
385 | (9) |
|
Using the DB2 Express-C Edition Installer |
|
|
386 | (1) |
|
Using the Dedicated DB2 Client Installers |
|
|
387 | (6) |
|
Deciding Which Components to Install |
|
|
393 | (1) |
|
Configuring the DB2 Client for Your Database |
|
|
394 | (11) |
|
The DB2 Client Configuration Assistant |
|
|
394 | (6) |
|
Command-Line DB2 Client Configuration |
|
|
400 | (5) |
|
Other Connectivity Options |
|
|
405 | (1) |
|
|
405 | (1) |
|
|
405 | (1) |
|
Third-Party Connectivity Options |
|
|
405 | (1) |
|
|
406 | (1) |
|
Moving Data in Bulk with DB2 |
|
|
407 | (20) |
|
File Formats for Moving Data |
|
|
407 | (1) |
|
|
407 | (1) |
|
|
407 | (1) |
|
Lotus 1-2-3 Worksheet Format |
|
|
408 | (1) |
|
Integration Exchange Format |
|
|
408 | (1) |
|
|
408 | (6) |
|
Performing a Simple Export |
|
|
409 | (1) |
|
|
409 | (2) |
|
|
411 | (1) |
|
Exporting via the Control Center |
|
|
412 | (2) |
|
|
414 | (9) |
|
Performing a Simple Import |
|
|
414 | (2) |
|
Dealing with Import Warnings and Errors |
|
|
416 | (2) |
|
Importing a Mix of New and Updated Data |
|
|
418 | (1) |
|
Performing More-Complex Imports |
|
|
419 | (2) |
|
Graphical Import Using the Control Center |
|
|
421 | (2) |
|
Loading Data with the Load Utility |
|
|
423 | (3) |
|
Other Data-Movement Tools |
|
|
426 | (1) |
|
|
426 | (1) |
|
|
427 | (14) |
|
|
428 | (1) |
|
Statement of Requirements |
|
|
429 | (1) |
|
Identification of Users and Use Cases |
|
|
430 | (2) |
|
Analysis of Use Cases and Data Requirements |
|
|
432 | (1) |
|
Finding Relationships in the Data |
|
|
433 | (2) |
|
Building the Logical Data Model |
|
|
435 | (1) |
|
Translating a Logical Model to a Physical Model |
|
|
436 | (4) |
|
Building the Physical Model in DB2 |
|
|
436 | (4) |
|
|
440 | (1) |
|
|
440 | (1) |
|
Moving Up to More Advanced DB2 |
|
|
441 | (18) |
|
Using the db2look and db2move Utilities |
|
|
441 | (5) |
|
|
441 | (2) |
|
|
443 | (2) |
|
Using db2look from the Control Center |
|
|
445 | (1) |
|
|
446 | (8) |
|
Preparing for Replication |
|
|
446 | (1) |
|
Configuring Replication via the Replication Center |
|
|
447 | (5) |
|
Testing Replication in Action |
|
|
452 | (2) |
|
|
454 | (4) |
|
Data Row Compression Design |
|
|
455 | (1) |
|
Estimating Compression Savings |
|
|
456 | (1) |
|
|
457 | (1) |
|
|
458 | (1) |
|
|
458 | (1) |
|
Monitoring and Tuning DB2 Performance |
|
|
459 | (32) |
|
Starting with a Sensible Approach to Tuning |
|
|
459 | (1) |
|
Proactive Tuning with the Configuration Advisor |
|
|
460 | (8) |
|
Understanding Isolation Levels in DB2 |
|
|
464 | (1) |
|
Understanding Locking in DB2 |
|
|
464 | (2) |
|
Using DB2's Optimistic Locking Features |
|
|
466 | (1) |
|
Continuing with the Configuration Advisor |
|
|
466 | (2) |
|
Understanding Self-Tuning Memory in DB2 |
|
|
468 | (4) |
|
Traditional DB2 Memory Management Model |
|
|
468 | (1) |
|
|
469 | (1) |
|
Self-Tuning Memory Management Mechanics |
|
|
470 | (1) |
|
Using the Memory Visualizer |
|
|
471 | (1) |
|
Monitoring and Tuning Database Activity |
|
|
472 | (9) |
|
Activating Monitor Switches |
|
|
473 | (1) |
|
|
473 | (5) |
|
Using DB2 Snapshot Monitors |
|
|
478 | (3) |
|
Tuning the DB2 Optimizer with RUNSTATS |
|
|
481 | (4) |
|
Automated RUNSTATS in DB2 |
|
|
481 | (3) |
|
Manually Running the RUNSTATS Command |
|
|
484 | (1) |
|
Using the REORGCHK and REORG Utilities |
|
|
485 | (4) |
|
|
485 | (2) |
|
|
487 | (2) |
|
|
489 | (2) |
Index |
|
491 | |