Post on 03-Feb-2021
■Symbols* (asterisk), XPath, 206@ (at) symbol, XPath, 205, (comma), stored procedures and, 144$ (dollar sign), XQuery, 201// (myself or any of my descendants)
placeholder, XPath, 207() (parentheses), stored procedures and, 144| (pipe symbol), XML, 199# (pound) character, Rails, 269? catalog command, 402? list command, 400? (question mark) command, 59? (question mark) placeholder, 148/ (slash character), XQuery, 199
■Aabs function, 115access approaches, 385access control, 163–164. See also
authenticationAccess Plan button (Command Editor), 216ACTIVATE DATABASE command, 365activating
monitor switches, 473Self-Tuning Memory Management,
469–470Active Directory (AD) domain features, 174ad hoc SQL statements, working with,
252–255Add Connection dialog box (Visual Studio),
285Add Database Wizard, 395Add New Item Wizard (Visual Studio),
287–288Add pureQuery Wizard, 316Add Registerable Tables dialog box, 451Add Storage dialog box (Control Center), 350Add Table dialog box (SQL Builder Wizard),
103Add User dialog box (Control Center),
187–188Administration Instance (DAS), 25Administration Server user configuration
screen, 25Administration Tools (DB2 Client), 391–392Advanced mode of DB2 Control Center
Basic mode compared to, 49
browsing object views, 50–52alias
description of, 201specifying, 339
Alias tab (Client Configuration Assistant), 398ALL privilege, 186allow write access concurrency control
option (import utility), 418allowing reverse scans of indexes, 219ALTER BUFFERPOOL command, 354ALTER DATABASE command, 349–350alter index statement, 219alter sequence command, 230–231alter table command, 133alter table statement, compress {yes | no}
clause, 457ALTER TABLESPACE command, 350–352altering sequences, 230–231analysis of use cases and data requirements,
432–433ANSI join syntax, 118Application Development Tools (DB2 Client),
392applications
See also Employee of the Year application;JDBC (Java Database Connectivity)applications
building .NET Web with Visual Studiobinding objects to controls, 296–297building and running projects, 298–299overview of, 295
building .NET Windows with Visual Studiobinding objects to controls, 291exploring connection’s related objects,
294overview of, 290running projects, 294specifying connection for, 292–293
Apply control tables, creating, 451Apply process, starting, 452ARCHIVE LOG FOR DATABASE command,
366archive logging, 362–365array-based policy components (LBAC), 190As User Data Source option (Client
Configuration Assistant), 398ascending indexes, 219ASCII format, 407ASN, 450
Index
491
asterisk (*) symbol (XPath), 206at (@) symbol (XPath), 205atomic keyword, 147attaching
to DB2 instance, 79–80instances, 66
attributeskey, 437moving to physical data model and, 436for sequences, 228–229xmlns namespace, 199
auth ID, nominated ID compared to, 96authentication
AUTHENTICATION instance parameter,164
authorization IDs and, 164choosing authentication types, 167CLIENT authentication type, 165–166DATA_ENCRYPT authentication type, 167DATA_ENCRYPT_CMP authentication
type, 167description of, 163–164group, 173–174GSSPLUGIN AND
GSS_SERVER_ENCRYPTauthentication types, 167
instance-level privileged groups, 168–169KERBEROS authentication type, 166KRB_SERVER_ENCRYPT authentication
type, 166parameters, changing
in CLP, 172–173in Control Center, 170–171overview of, 169
SERVER authentication type, 165SERVER_ENCRYPT authentication type,
165AUTHENTICATION instance parameter
changing, 169description of, 164
authoritiesdatabase-level
changing, 179–181overview of, 177–178viewing, 179
group behavior, 182–183preparing to use, 177roles, 184–185
authorization, authentication and, 163authorization IDs (authids), 164autocommit setting, 258autogenerating pureQuery Java mapping
classes, 318–320automated statistics generation, 481–483automatic database maintenance, 481automatic storage, adding with ALTER
DATABASE command, 349–350
automatic storage DMS tablespace, 343–344automatic table maintenance, 481automatic value generation for columns,
138–140autonomic computing daemon, 70autonomic database management, 73AUTORESIZE option for system tablespace,
346award category, modeling, 433award_result table, 217
■BBackup Wizard
compression option, 370invoking, 368options screen, 370performance options, 372selecting backup type, 368specifying backup destination, 370
backupsSee also Backup Wizard; logginganatomy of, 367–368command line for, 366command-line options
incremental and delta backups,373–374
online and offline backups, 373overview of, 372tablespace backups, 373
importance of, 359permissions for, 359practicing, 383restoring from, 375–376roll forward recovery from, 376–377simplest form of statement for, 367taking from Control Center, 368, 370, 372
Base Application Development Tools (DB2Client), 392
Base Client Support component (DB2Client), 390
Basic mode of DB2 Control Center, 49Beginning Database Design (Churcher), 427benchmarking exercise, 459BIGINT data type, 128binary data types, native, 129binary data, compressing, 458BINDADD authority, 178binding objects
to Web controls, 296–297to Windows controls, 291
BindingSource object (Visual Studio), 294BLOB data type, 129blocks, 348body statements for stored procedures, 147Boyce, Ray, 4browser, preinstallation requirements for, 15
■INDEX492
browser profile selection in DB2 First Steps,43
buffer poolsfor tablespaces, 347–348working with, 350–356
BUFFERPOOL parameter (tablespaces), 346building
.NET Web applications with Visual Studiobinding objects to controls, 296–297building and running projects, 298–299overview of, 295
.NET Windows applications with VisualStudio
binding objects to controls, 291exploring connection’s related objects,
294overview of, 290running projects, 294specifying connection for, 292–293
logical data model, 435–436physical model, 436–439project in Visual Studio, 289–290tables, nomination table example,
130–131Web projects, 298–299
bulk data movementdb2look and db2move utilities, 426exporting
Control Center, using, 412–414LOBs, 409–411overview of, 408simple export, performing, 409XML objects, 411–412
formats forASCII, 407delimited, 407Integration Exchange, 408Lotus 1-2-3 Worksheet, 408
importingcomplex imports, performing, 419–421Control Center, using, 421–422insert_update process compared to,
416–418mix of new and updated data, 418–419simple import, performing, 414–416
loading data with load utility, 423–426overview of, 407
■CC and C++, 333cache clause (sequences), 230cached classes, refreshing, 313CallableStatement class (JDBC), 307CALLED ON NULL INPUT modifier (SQL
PL), 145calling user-defined functions, 159–160candidate keys, 133
Capture control tables, creating, 450–451Capture process, starting, 452carriage return/line feed in CLP, 341case sensitivity of XML, 201catalog [admin] node command, 403–404catalog command, 402catalog tables, 112catalog tablespaces
allocating size for, 346description of, 342
catalog views, 113cataloging databases, 403category table example
identity columns for, 140logical model for, 134nomination table and, 134–135physical model for, 134
Celko, Joe, 427Chamberlin, Don, 4change dialog box for parameters (Control
Center), 77changing database authorities, 179–181CHAR data type, 128check constraint, 132, 136–137Choose Data Source dialog box (Visual
Studio), 284Churcher, Clare, 427circular logging, 361–362class model for Employee of the Year
application, 432classes
JavaDB2ex1, 303JDBC
CallableStatement, 307ConnMgr, 305–307PreparedStatement, 307ResultSet, 307Statement, 307
mapping, autogenerating pureQuery Java,318–320
refreshing cached, 313Zend Core framework, 262
CLASSPATH inclusions or imports, 304CLIENT authentication type, 165–166Client Configuration Assistant (DB2 Client),
394–399client libraries, Perl installation and, 324Client Support components
DB2 Client, 390DB2 Express-C edition installer, 386
CLOB data type, 129CLP (Command Line Processor)
authentication parameters, managing in,172–173
configuringdatabases from, 81–82instances from, 79–80
■INDEX 493
CLP (continued)connect and disconnect commands,
60–61granting
group privileges, 181object privileges, 188
launching, 58? command, 59–60select statement results in, 114statement terminator, 341terminate command, 61
clustering data in tables, 485clustering feature of indexes, 221COBOL, 333Codd, E. F. (Ted), 4code. See syntaxcode samples, accessing, 333–334codesets, 340coding best practice (PHP), 251collation option, 340column functions, 123columns
enumerating in SQL, 298including in indexes, 220for tables
automatic value generation, 138–140check constraints, 136–137disabling and deferring constraints, 137null data, working with, 132primary key constraints, 133–134referential constraints, 134–136
Columns tabExport Table dialog box, 413Import Table dialog box, 422
Command EditorAccess Plan button, 216description of, 55select statement results in, 113SQL Assist Wizard, 56–57XML and, 195–196
command lineSee also Command Line Processor (CLP)backup options
incremental and delta, 373–374online and offline, 373overview of, 372tablespace, 373
configuring DB2 Client fromcatalog command, 402–404discoverability parameters, 404examining current configuration,
400–402installation under Linux, 32–34recovery options
full restore tweaked for performance,382
full restore with redirection, 382
individual tablespace restore, 382–383overview of, 381
starting and stopping processes fromDAS instance, 67–69database instances, 69–70overview of, 66
Command Line Processor (CLP)authentication parameters, managing in,
172–173configuring
databases from, 81–82instances from, 79–80
connect and disconnect commands,60–61
grantinggroup privileges, 181object privileges, 188
launching, 58? command, 59–60select statement results in, 114statement terminator, 341terminate command, 61
command-line toolsdb2admin, 67–69db2fmcu, 72DB2ILIST and DASLIST, 83DB2LEVEL, 82DB2PD, 84–85DB2SET, 83
commands? catalog, 402? list, 400ACTIVATE DATABASE, 365ALTER BUFFERPOOL, 354ALTER DATABASE, 349–350alter sequence, 230–231alter table, 133ALTER TABLESPACE, 350–352ARCHIVE LOG FOR DATABASE, 366catalog, 402catalog [admin] node, 403–404to change database parameters, 81–82to change instance parameters, 80connect, 60–61CREATE BUFFERPOOL, 348create sequence, 228create table … like … command, 142CREATE TABLESPACE, 350Data Row Compression
inspect, 456reorg, 457
db2start and db2stop, 69–70describe table table-name, 114disconnect, 60–61DROP DATABASE, 356drop procedure, 152DROP TABLESPACE, 350
■INDEX494
export, 409F-L-W-O-R (XQuery), 199GET DBM CFG, 172GET SNAPSHOT, 479grant security label, 193list, 400LIST ACTIVE DATABASES, 365LIST DATABASE DIRECTORY, 401LIST NODE DIRECTORY, 401list of known CLP, 59LIST TABLESPACE CONTAINERS, 353LIST TABLESPACES, 352LIST TABLESPACES SHOW DETAIL, 353? catalog, 402? list, 400rake (Ruby), 271restore database, 375rollforward, 376RUNSTATS, 484–485set integrity, 425sql-query, 114terminate, 61UPDATE MONITOR SWITCHES, 473xhost, 41
commas, stored procedures and, 144Compact installation, 19COMPATIBILITY value (collation option),
340compiling Perl DBI from source code,
326–327Comprehensive Perl Archive Network
(CPAN), 324compress {yes | no} clause, 457compressing
binary data, 458tables, 457–458
compression dictionaries, 455concurrency, RUNSTATS and, 485Configuration Advisor
Connections dialog box, 462Isolation dialog box, 463–464Populated dialog box, 462Priority dialog box, 462Results dialog box, 466–467Server dialog box, 460Transactions dialog box, 461Workload dialog box, 461
Configuration Assistant tool (DB2 Client),391
Configure DB2 .NET Data Provider programfolder shortcut, 281
Configure Parameters option (ControlCenter), 75
Configure Settings dialog box (RUNSTATS),482
Configure The Select Statement dialog box(Visual Studio), 296
configuringdatabases
from CLP, 81–82from Control Center, 78overview of, 73
DB2 ClientClient Configuration Assistant, 394–399from command line, 400–404
instancesfrom CLP, 79–80from Control Center, 75–77overview of, 73
levels of, 74replication
Apply control tables, creating, 451Apply process, starting, 452Capture control tables, creating,
450–451Capture process, starting, 452launching Replication Center, 447–448Replication Center dialog box, 448–449source table, registering, 451subscription set, creating, 452
Zend Core framework, 258–259confirmation dialog box, 30confirmation screen (Client Configuration
Assistant), 399confirming
instance quiescence, 66instance shutdown, 64
CONNECT authority, 178connect command, 60–61connecting
to DB2 database, 81with Perl DBI and DBD::DB2 modules,
327–328with Python, 332Rails project to DB2, 268–269
connection for Windows C# project,specifying, 292–293
connection managementfor new project in Data Studio, 97–100PHP, 248–251Zend Core framework, 259–260
connection specification dialog box (DataStudio), 98
connection string, 282Connections dialog box (Configuration
Advisor), 462connectivity options, 405ConnMgr class (JDBC), 305–307constraints
disabling and deferring, 137“on change” rules for, 135
containersdescription of, 337DMS tablespaces and, 345
■INDEX 495
containers (continued)SMS tablespaces and, 344tablespace storage options, 344
CONTAINS SQL modifier (SQL PL), 145context menu when initiating pureQuery
support for Java project, 315Control Center
Add Storage dialog box, 350Add User dialog box, 187–188altering
buffer pools in, 356tablespace properties in, 355
authentication parameters, managing in,170–171
browsing object views, 50–52configuring
databases from, 78instances from, 75–77
Database Authorities dialog box, 179–180,183
description of, 47Document Viewer for XML and, 197exporting via, 412–414identifying procedures to drop using, 153importing via, 421–422launching Design Advisor from, 222listing
buffer pools in, 355tablespaces in, 354
quiescing and unquiescing instancesfrom, 66
recovery using, 377–381reorganization options in, 488selecting view, 49starting
from DB2 First Steps, 47from shortcuts, 48
starting and stopping processes from,64–66
taking backups from, 368–372using db2look utility from, 445–446XML Schema Repository (XSR), 210
CONTROL privilege, 186copy naming screen, 23count() function, SQL select statement, 158CPAN (Comprehensive Perl Archive
Network), 324crash recovery, 375Create a New Connection dialog box
(pureQuery), 316CREATE BUFFERPOOL command, 348create sequence command, 228create table … as select technique, 142create table … like … command, 142create table statement, 130–132, 457Create Table Wizard, using with SAMPLE
database, 52–55
CREATE TABLESPACE command, 350CreateNominationTable script, 101–102CREATETAB authority, 178CREATE_EXTERNAL_ROUTINE authority,
178CREATE_NOT_FENCED_ROUTINE
authority, 178creating databases. See database creationcreating tables, syntax for, 127credential management, 96current date, current time, and current
timestamp registers, 120–122Cursor Stability option (Configuration
Advisor), 466Custom installation, 19custom installation of DB2 Client, selecting,
388CUSTOMER table (SAMPLE database), XML
and, 196customizing DB2 Control Center view, 49
■DDAS (DB2 Administration Instance), 25DAS instance, starting and stopping, 67–69DASLIST (Instance Listing Utility), 83data. See exporting data; importing datadata definition language (DDL) of database
objects, extracting, 441data manipulation language (DML)
delete statements, 126insert statements, 124–125overview of, 111select statements
clauses, 114–117joins, 118overview of, 112subqueries, 119union operations, 119–120
update statements, 125Data Row Compression
benefits of, 454estimating savings, 456–457implementation of, 455limitation of, 458tables, compressing, 457
Data Source Configuration Wizard (VisualStudio), 292–296
Data Studio (IBM)Deploy option, 154Deploy Wizard, 155description of, 89downloading, 90–91installing
Eclipse-based IDE installations, 92–94IBM Installation Manager, 92installation dialog box, 91
launching, 94–95
■INDEX496
managing stored procedures, 154–155new project connection management,
97–100objects, adding to project
New SQL Statement Wizard, 100–104New Stored Procedure Wizard, 104–109
starting new project, 95–97welcome dialog box, 95
data typesmoving to physical data model and, 437native
binary, 129double-byte string, 129numeric, 128string, 128–129temporal, 129–130
overview of, 127, 130Data Warehouse edition, 5data-partitioning capabilities, 141database authorities
changing, 179–181overview of, 177–178viewing, 179
Database Authorities dialog box (ControlCenter), 179–180, 183
Database Configuration (DB), 74Database Configuration dialog box (Control
Center), 78database creation
See also tablespacesalias, specifying, 339ALTER DATABASE command, 349–350buffer pools, 347–348dropping databases, 356language and text handing, 340–341with many options, 349NODE0000 directory, 348overview of, 338tablespaces and buffer pools, working
with, 350–356Database Creation Wizard, 45–47Database Explorer option for generating
pureQuery code, 318Database Explorer view for pureQuery
projects, 318Database in Depth (Date), 428database instances, starting and stopping,
69–70database managed storage (DMS) tablespace
overview of, 343–344using, 345
Database Manager Configuration (DBM), 74Database Restore Wizard
backup image to restore, selecting, 378final screen, 380–381redirecting tablespace containers, 378roll forward recovery options, 380
starting, 377type of restore, selecting, 378
database-level configuration, 74database-partitioning feature, 348database.yml file, 268databases
See also database creationcataloging, 403configuring
from CLP, 81–82from Control Center, 78overview of, 73
SAMPLECreate Table Wizard, using, 52–55creating with DB2 First Steps, 45–47XML in, 195–199
TOOLSDB, 28traditional memory structure of, 468–469
DATABASE_MEMORY parameter, 469–470DATALINK data type, 130DataSet object (Visual Studio), 294DATA_ENCRYPT authentication type, 167DATA_ENCRYPT_CMP authentication type,
167DATE data type, 129Date, Chris, 428DB2
editions of, 5history of, 4obtaining, 6–8versions of, 9
DB2 9 Discovery Kit DVD, using, 12DB2 9 Fix Pack 2, 11DB2 9.5 Express-C download package,
contents of, 16DB2 Administration Server (DAS), 67DB2 Client
Administration Tools, 391–392Application Development Tools, 392Client Support components, 390configuring
Client Configuration Assistant, 394–399from command line, 400–404
description of, 385Getting Started components, 391installing
deciding which components to install,393–394
dedicated installers, using, 387–388, 393Express-C edition installer, using, 386overview of, 385
Server Support Tools, 392–393DB2 Command Editor. See Command EditorDB2 Control Center. See Control CenterDB2 Data Connection dialog box (Visual
Studio), 284DB2 environment, major components of, 64
■INDEX 497
DB2 Express Edition, 5, 18DB2 Fault Monitor Coordinator, 72–73DB2 First Steps
browser profile selection, 43DB2 Control Center, starting from, 47description of, 39interface, 44launching
under Linux, 41–43under Windows, 40–41
SAMPLE database, creating with, 45–47DB2 Governor, 71DB2 Instance Setup Wizard (DB2 Client), 392DB2 LDAP Support component (DB2 Client),
390DB2 License Server, 71DB2 Management Service, 71DB2 on Rails toolkit, 263–267DB2 Remote Command Server, 72DB2 Runtime Client, 405DB2 Security Server, 72db2acd process, 70db2admin command-line tool, 67–69db2admin user (Windows), 14db2_autocommit function, 258db2_bind_param function, 257db2ckpw process, 70db2_client_info function, 258db2_close function, 250db2_commit function, 258db2_connect function, 249–250db2_conn_errormsg function, 250db2evmon utility, 475db2_exec function, 252–253db2_execute function, 255–257db2_fetch_both function, 253–254db2_fetch_object function, 253db2_fetch_row function, 253db2_field_* functions, 258db2fmcu command-line tool, 72db2-fn:sqlquery function, 199–201db2-fn:xmlcolumn function, 199–201db2gds process, 70DB2_GRP_LOOKUP registry, 173DB2_GRP_LOOKUP registry setting, 182DB2ILIST (Instance Listing Utility), 83db2_install script, 32db2ipccm process, 70DB2LEVEL (Version Information Utility), 82db2licm utility, 35db2look utility
overview of, 426, 441–443using from Control Center, 445–446
db2move utility, 426, 441, 443–445db2nmpcfg.exe, 281db2nmpsetup.exe utility, 281
db2_pconnect function, 252DB2PD (Problem Determination tool), 84–85db2_prepare function, 255–257db2_procedures function, 258db2profile script, invoking, 42db2_result function, 253db2resyn process, 70db2_rollback function, 258DB2SECURITYLABEL data type, 192db2_server_info function, 258DB2SET (Registry Utility), 83db2start command, 69–70db2stop command, 69–70db2sysc process, 70db2_tables function, 258db2tcpcm process, 70db2usr1 (Linux), 14db2wdog process, 70DBADM authority, 177DBCLOB data type, 129DBD::DB2 modules
compiling from source code, 326–327connecting with, 327–328executing SQL statements, 328–330installing, 324–326
DBI->connect method, 328DDL (data definition language) of database
objects, extracting, 441Debug dialog box (JDBC), 306DECFLOAT data type, 128DECIMAL/NUMERIC data type, 128declarative referential integrity, 134declaring
primary keys, 133tablespaces at table creation, 140
deferring constraints, 137delete statements (SQL), 126deleting XML data, 213delimited format, 407delta backups, 373–374denying privileges, 178Deploy option (Data Studio), 154Deploy Options dialog box (New Stored
Procedure Wizard), 107Deploy Wizard (Data Studio), 155descending indexes, 219describe table table-name command, 114Design Advisor
feature selection in, 222index advisor facility, 221–227recommendation summary, 226scheduling workload for, 226Show button, 226space for recommendations in, 224Update Catalog Statistics dialog box, 224workflow specification in, 222–224
■INDEX498
design processanalysis of use cases and data
requirements, 432–433database layer of Employee of the Year
application, 427–428finding relationships in data, 433–434identification of users and use cases,
430–432logical data model, building, 435–436model review, 440physical model, building, 436–439roadmap for, 428–429statement of requirements, 429–430translating logical model to physical
model, 436designing tables in Rails, 269–271DETERMINISTIC modifier (SQL PL), 145developer tools. See Data Studio (IBM)development options
C and C++, 333COBOL, 333DB2 on Rails toolkit, 267Perl DBI
compiling from source code, 326–327connecting to DB2, 327–328executing SQL statements, 328–330installing, 324–326overview of, 323resources on, 330
Python, 330–332Rexx, 333Visual Basic and Visual Basic .NET, 334
DIAGLEVEL parameter, 80dictionaries, compression, 455Dimension Organization, 141directories, database creation and, 348disable query optimization keyword, 137disabling constraints, 137disallowing reverse scans of indexes, 220disconnect command, 60–61discoverability parameters, 404Discovery Kit, 7–8disk level of storage, 337DISK setting (archive logging), 363disk space, preinstallation requirements for, 13Distributed Relational Database Architecture
(DRDA), 165DLCHKTIME parameter, 81DMB (Instance) Configuration dialog box, 76DML (data manipulation language)
delete statements, 126insert statements, 124–125overview of, 111select statements
clauses, 114–117joins, 118overview of, 112
subqueries, 119union operations, 119–120
update statements, 125DMS (database managed storage) tablespace
overview of, 343–344using, 345
Document ViewerXML and, 196–198XML schema in, 211
dollar sign ($), alias and (XQuery), 201double-byte string data types, native, 129DOUBLE/FLOAT data type, 128download page, IBM DB2, 6downloading
Data Studio, 90–91DB2 on Rails toolkit, 263Zend, 241
DRDA (Distributed Relational DatabaseArchitecture), 165
driver types (JDBC), 302–303, 405DROP DATABASE command, 356drop restriction, 141DROP TABLESPACE command, 350DropNominationTable script, 103DROPPED TABLE RECOVERY parameter
(tablespaces), 348dropping
databases, 356stored procedures, 152–154user-defined functions, 161
durability framework, 360DYNAMIC keyword, 145DYNAMIC RESULT SETS n modifier
(SQL PL), 145
■E-e option (db2look utility), 442Eclipse framework, 92–94editions of DB2, 5elements in create table statement, 132emp_current_votes function, 158–159emp_current_votes_results function, 159emp_current_votes_row function, 158employee, modeling relationship between
nomination and, 434Employee of the Year application
analysis of use cases and datarequirements, 432–433
designing database layer of, 427–428finding relationships in data, 433–434identification of users and use cases, 430–432logical data model, building, 435–436model review, 440physical model, building, 436–439statement of requirements, 429–430translating logical model to physical
model, 436
■INDEX 499
employee tableadding new employee to, 122modeling, 432physical model for, 121
employee_vote procedurefirst example of, 146second example of, 149–150
emp_vote_standings procedure, 147enable query optimization keyword, 137enforced mode, constraints and, 137enforcing uniqueness with index, 217–218Enterprise Developer edition, 5Enterprise edition, 5enumerating columns in SQL, 298environment, major components of, 64error management, stored procedures and,
151–152error messages
SQL1043C, 346SQL1088W, 346SQL20189W, 348SQL2539W, 375
estimating compression savings, 456–457event monitors
description of, 472using, 473–478
Event Publishing, 446Everyplace 9 edition, 5evolving project schema with Ruby, 272examining pureQuery results, 321–322except operation, 120executing
migrations in Ruby, 271–272statements
with Perl DBI and DBD::DB2 modules,328–330
with Python, 332with Zend Core framework, 260–262
stored procedure via PHP, 255–257EXECUTIVE privilege, 186explicit schema, specifying, 144Export Table dialog box
Columns tab, 413Target tab, 412
exporting dataControl Center, using, 412–414LOBs, 409–411overview of, 408simple export, performing, 409XML objects, 411–412
Express edition, 5, 18Express-C edition, 5Express-C edition installer, using to install
DB2 Client, 386expressions (XPath), 205EXTENTSIZE parameter (tablespaces), 346EXTERNAL ACTION modifier (SQL PL), 146
external procedures, drawbacks to, 314–315extracting DDL of database objects, 441
■FFault Monitor Coordinator, 72–73feature selection screen (DB2 Express-C
edition installer), 22, 386Feuerstein, Steven, 427file extensions
.php, 244
.rsp, 21
.yml, 268file formats for bulk data movement
ASCII, 407delimited, 407Integration Exchange, 408Lotus 1-2-3 Worksheet, 408
File tab (Import Table dialog box), 421files
installation log, 34mirroring log, 366php.ini master configuration, 259 primary log, 361response, 20–21secondary log, 361
filesystem caching, 352finding relationships in data, 433–434First Steps component (DB2 Client), 391flow of data and logging during unit of work,
360F-L-W-O-R clauses (XQuery), 200for clause (XQuery), 201foreign key columns, indexes for, 218foreign key constraint, 134–136function keyword, 161functions
See also user-defined functions (UDFs)abs, 115column, 123db2_autocommit, 258db2_bind_param, 257db2_client_info, 258db2_close, 250db2_commit, 258db2_connect, 249–250db2_conn_errormsg, 250db2_exec, 252–253db2_execute, 255–257db2_fetch_both, 253–254db2_fetch_object, 253db2_fetch_row, 253db2_field_*, 258db2-fn:sqlquery, 199–201db2-fn:xmlcolumn, 199–201db2_pconnect, 252db2_prepare, 255–257db2_procedures, 258
■INDEX500
db2_result, 253db2_rollback, 258db2_server_info, 258db2_tables, 258object privileges, 186row, 123scalar, 123seclabel_by_name(), 193SNAP_GET_LOCK, 480table, 123text(), XQuery, 204upper(), 123XMLEXISTS, 213XMLPARSE, 212XMLTable, 207–208
■GGenerate DLL dialog box, 445Generate pureQuery Code For A Table
Wizard, 319–320generated modifier for columns, 138–140generating scaffolding (Ruby on Rails), 275get Connection method, 303GET DBM CFG command, 172GET SNAPSHOT command, 479Getting Started components (DB2 Client),
391“Getting Started with DB2 Installation and
Administration on Linux andWindows” (IBM), 31
global daemon spawner, 70global group authentication, configuring to
use, 173goto statement, 150Governor, 71grand security label command, 193granting
group privileges, 181object privileges, 187–190
GRAPHIC data type, 129graphical installation under Windows and
Linux, 15–30graphical tools
See also Control Center; DB2 First StepsCommand Editor, 55–57
group authentication, 173–174group behavior
looking for groups in Windows, 182–183PUBLIC group, 183roles compared to, 184–185
group by clause of select statement, 116Group tab (Database Authorities dialog box),
183GROUP_PLUGIN parameter, 182groups, preinstallation requirements for, 14GSSPLUGIN authentication type, 167
GSS_SERVER_ENCRYPT authentication type,167
■H-h option (db2look utility), 443having clause of select statement, 117help information for db2admin, 68historic profiling, event monitors for, 474history of DB2, 4home page, IBM DB2, 6
■IIBM, and history of DB2, 4IBM Data Server Client. See DB2 ClientIBM Data Server Data Studio V9.5 folder, 94IBM data server provider for .NET
registering, 281–282testing connectivity, 282–283
IBM Data Studio. See Data Studio (IBM)IBM Database Add-Ins for Microsoft Visual
Studioinstalling, 279–280, 283testing, 283–286
IBM DB2 home page, 6IBM DB2 permalink website, 143IBM Installation Manager, 92–94IBM Software Development Kit for Java
(DB2 Client), 392IBM_DB2 extensions
ad hoc SQL statements, working with,252–255
connection management functions,248–251
functions, 257–258managing connections, 252prepared statements and stored
procedures, working with, 255–257verifying installation of, 247–248
identification of users and use cases, 430–432identity technique, and columns, 138–140IDENTITY value (collation option), 340IDENTITY_16BIT value (collation option),
340implicit joining technique, 118IMPLICIT_SCHEMA authority, 178implied authorities, 178Import Table dialog box
Columns tab, 422File tab, 421Options tab, 422
import utilityload utility compared to, 423–425options, 416statistical summary, 415syntax, 414warning messages, 417–418XML parsing and validation options, 421
■INDEX 501
importing datacomplex imports, performing, 419–421Control Center, using, 421–422insert_update process compared to,
416–418mix of new and updated data, 418–419simple import, performing, 414–416
include clause, indexes and, 220including columns in indexes, 220incremental backups, 373–374indexes
clustering feature, 221creating, 215–216description of, 215Design Advisor and, 221–227for foreign key columns, 218included columns, 220ordering semantics, 219reorganization for, 488reverse scans, 219–220unique values, enforcing, 217–218
infinite logging, 365Information Center
configuration screen, 24launching, 68
INHERIT ISOLATION LEVEL {WITH |WITHOUT} LOCK REQUEST option(user-defined functions), 158
INHERIT SPECIAL REGISTERS modifier(SQL PL), 145
inline technique for declaring primary keys,133
inner joins, 118insert into ... select ... technique, 124insert statements (SQL), 124–125, 232inserting XML data, 208–210insert_update option (import utility), 420insert_update process, import utility
compared to, 416–418inspect command (Data Row Compression),
456Install A Product launch screen, 16installation log file, 34Installation Welcome screen, 16installing
command-line installation under Linux,32–34
Data StudioEclipse-based IDE installations, 92–94IBM Installation Manager, 92installation dialog box, 91
DB2 9 Discovery Kit DVD, using, 12DB2 Client
deciding which components to install,393–394
dedicated installers, using, 387–393Express-C edition installer, using, 386
overview of, 385DB2 on Rails toolkit, 263–267DBD::DB2 modules, 324–326graphical installation under Windows and
Linux, 15–30IBM Database Add-Ins for Microsoft
Visual Studio, 279–280, 283on Linux, 11Perl DBI, 324–326preinstallation requirements, checking,
13–15Python driver, 330–331resources on, 31reviewing installation, 35unpacking installation downloads, 12on Windows, 11Zend Core, 242–248
instance communication and startup screen,27–28
Instance Listing Utilities (DB2ILIST andDASLIST), 83
instance ownerdescription of, 64logging in as
under Linux, 42under Windows, 41
write permissions, and storage options, 46instance-level configuration, 74instance-level privileged groups, 168–169instances
attaching, 66configuring
from CLP, 79–80from Control Center, 75–77overview of, 73
DAS, 70–71DB2, 70–71quiescing and unquiescing, 66starting and stopping
from Control Center, 64–66DAS, 67–69database, 69–70
traditional memory structure of, 468–469instantaneous profiling, snapshot monitors
for, 478INTEGER data type, 128Integration Exchange Format (IXF), 408interface for DB2 First Steps, 44Interfaces component (DB2 Client), 390intersect operation, 120intersection table, physical design of, 438IPC communications manager, 70iSeries, DB2 for, 6Isolation dialog box (Configuration Advisor),
463–464isolation levels, 464
■INDEX502
issuing commandsto change database parameters, 81–82to change instance parameters, 80
IXF (Integration Exchange Format), 408ixscan access method, 217
■JJava
Software Development Kit for, 392writing stored procedures in, 105
Java developmentSee also JDBC (Java Database
Connectivity) applications environment for, 301pureQuery
autogenerating mapping classes,318–320
examining results, 321–322project, creating, 315–316
stored proceduresclass, deploying, 312class, writing, 311–312drawbacks to, 314–315testing, 314writing, 313–314
Java Support component (DB2 Client), 390JavaDB2ex1 class, 303JDBC (Java Database Connectivity)
applicationsdata, working with, 307–309driver types, 302–303features, working with, 309–311refactoring connection code, 305–307writing, 303–305
JDBC-ODBC Bridge Driver, 302joins, 118
■KKERBEROS authentication type, 166key attributes, 437keywords
atomic, 147disable query optimization, 137DYNAMIC, 145enable query optimization, 137enforced, 137function, 161not enforced, 137specific, 153xquery
XPath, 204XQuery, 200
killing processes, 67knowing system, performance tuning and,
459KRB_SERVER_ENCRYPT authentication
type, 166
■LLabel-Based Access Control (LBAC)
example of, 192–194label component, defining, 191label, defining, 192parts of, 190–191policy, defining, 191resources, 194
language handling, 340–341language selection screen, 22LANGUAGE SQL modifier (SQL PL), 146large tablespaces, 342launching
See also running; startingCommand Line Processor, 58Data Studio, 94–95DB2 Command Editor, 55DB2 Control Center
from First Steps, 47from shortcuts, 48
DB2 First Stepsunder Linux, 41–43under Windows, 40–41
Design Advisor, 222Information Center, 68Replication Center, 447–448
Launchpadfor DB2 Client, 388IBM DB2 Express-C installation screen,
16, 280LBAC (Label-Based Access Control)
example of, 192–194label component, defining, 191label, defining, 192parts of, 190–191policy, defining, 191resources, 194
Lempel Ziv algorithm, 455, 458let clause (XQuery), 202levels of abstraction
containers, 337disk, 338tablespaces, 337
License Agreement screen, 18License Server, 71Linux
command-line installation under, 32–34DB2 Administration Instance and, 26DB2 First Steps, launching under, 41–43db2admin tool under, 68graphical installation under, 15–30installing on, 11installing Zend Core under, 243reviewing installation under, 35Ruby, installing under, 266users and groups under, 14
■INDEX 503
LIST ACTIVE DATABASES command, 365list command, 400LIST DATABASE DIRECTORY command, 401LIST NODE DIRECTORY command, 401LIST TABLESPACE CONTAINERS command,
353LIST TABLESPACES command, 352LIST TABLESPACES SHOW DETAIL
command, 353LLS (LOB Location Specifier), 410LOAD authority, 178load utility, performance optimization
options, 423loading data with load utility, 423–426LOB Location Specifier (LLS), 410LOBs, exporting, 409–411local group authentication, configuring to
use, 173Local System account (Windows, 174lock snapshot monitor, 479–481lock types, 464–466locking features, optimistic, 466Log Buffer, role of, 361LOGBUFSZ parameter, 361LOGFILSIZ parameter, 361logging
archive, 362–365archiving log manually, 366circular, 361–362file types, 361history of, 364infinite, 365mirroring log files, 366principles of, 360–361
logging control, 141logic, three-valued, 438logical data model
building, 435–436for skills table, 52translating to physical model, 436
logical storage, 140–141, 342LOGPRIMARY parameter, 361LOGRETAIN setting (archive logging), 363LOGSECOND parameter, 361LONG VARCHAR data type, 129LONG VARGRAPHIC data type, 129looking for groups in Windows environment,
182–183Lotus 1-2-3 Worksheet format, 408
■M-m option (db2look utility), 443machine.config (.NET framework), 281Manage Passwords and Connectivity option
(Replication Center dialog box), 448Management Service, 71
managingauthentication parameters
in CLP, 172–173in Control Center, 170–171
connections, IBM_DB2 PHP, 252credentials, 96objects in Visual Studio
building project, 289–290creating new view object, 287–289Server Explorer, 286–287
roles, 184stored procedures, 154–155user-defined functions, 161
manually running RUNSTATS, 484–485mapping classes, autogenerating pureQuery
Java, 318–320mapping logical model to physical model, 436marker messages
SQL 3500W and SQL3515W, 425SQL 3519W and SQL3520W, 425
materialization features, 142MAX_LOG parameter, 365MDC (multidimensional clustering), 141memory
preinstallation requirements for, 13Self-Tuning Memory Management
(STMM), 347, 469–470traditional structures of instance and
database, 468–469Memory Usage Plot, 472Memory Visualizer, 471–472menus
context, when initiating pureQuerysupport for Java project, 315
DB2 Control Center, 50–52metadata, 112methods
DBI->connect, 328getConnection, 303ixscan, 217openConnection, 306tbscan, 216
Microsoft Visual Studio.NETSee also Windowsbuilding .NET Web applications
binding objects to controls, 296–297building and running projects, 298–299overview of, 295
building .NET Windows applicationsbinding objects to controls, 291exploring connection’s related objects,
294overview of, 290running projects, 294specifying connection for, 292–293
IBM data server provider for .NET,registering, 281–282
■INDEX504
IBM Database Add-Ins forinstalling, 279–280, 283testing, 283–286
integration with, 279managing objects
building project, 289–290creating new view object, 287–289Server Explorer, 286–287
testing DB2 .NET connectivity, 282–283migrations
description of, 269executing in Ruby, 271–272
mirroring log files, 366MIRRORLOGPATH parameter, 366modifiers
for stored procedures, 145–146for user-defined functions, 157–158
MODIFIES SQL DATA modifier (SQL PL), 145monitor switches, activating, 473monitors
event, using, 473–478overview of, 472snapshot, using, 478–481
moving data in bulk. See bulk datamovement
Mullins, Craig, 427multidimensional clustering (MDC), 141multirow insert statement, 125myself or any of my descendants placeholder
(//), XPath, 207
■Nnamed copy approach, 23namespace declaration, 199naming conventions
backups, 367event monitors, 474LOB export files, 410log files, 361tables, 131
native data typesbinary, 129double-byte string, 129numeric, 128overview of, 127, 130string, 128–129temporal, 129–130
.NET frameworkSee also Microsoft Visual Studio.NETIBM data server provider for .NET
registering, 281–282testing connectivity, 282–283
machine.config, 281Network Service account (Windows), 174New Data Development Project Wizard (Data
Studio), 98–100New Project dialog box (Visual Studio), 284
New SQL Statement Wizard (Data Studio),100–104
New Stored Procedure Wizard (Data Studio),104–109
nextval operator (sequences), 228, 231NLSCHAR value (collation option), 341no cache option (sequences), 230NO EXTERNAL ACTION modifier (SQL PL),
146NODE0000 directory, 348nominated ID, auth ID compared to, 96nominating index as clustering index for
table, 221nomination, adding to NOMINATION table,
105–109nomination table example
index for, 215–216modifying to incorporate CategoryID
field, 134performing default statistics collection
against, 484–485physical model for, 439reorganizing, 487–488table creation, 130–131
normalization, 433NOT DETERMINISTIC modifier (SQL PL),
145not enforced keyword, constraints and, 137not null constraint, 132notification configuration screen, 29notimeout option (import utility), 418null data, columns for tables and, 132Null value, 438NULLID schema, 144numeric data types, native, 128NUM_LOG_SPAN parameter, 365
■Oobject privileges
granting, 187–190working with, 185–186
objectsadding to project in Data Studio
New SQL Statement Wizard, 100–104New Stored Procedure Wizard, 104–109
bindingto Web controls, 296–297to Windows controls, 291
extracting DDL of, 441JDBC, Properties, 309, 311managing in Visual Studio
building project, 289–290creating new view object, 287–289Server Explorer, 286–287
obtaining DB2, 6–8ODBC (Open Data Base Connectivity)
standard, 398
■INDEX 505
OFF setting (archive logging), 363offline backups, 373{OLD | NEW} SAVEPOINT LEVEL modifier
(SQL PL), 146“on change” rules, 135on delete ... rules, 136on update ... rules, 136online backups, 373Open Data Base Connectivity (ODBC)
standard, 398Open Source Application Enablement Team
(Python), 330openConnection method, 306operating systems
See also Linux; Windowssecurity context of, 174–175
optimistic locking features, 466optimizer, select statement and, 114optional operating system security for DB2
objects screen, 30options
db2look utility, 443db2move utility, 445
options screen, DB2 First Steps, 45Options tab (Import Table dialog box), 422order by clause
select statement, 117XQuery, 204
order clause (sequences), 230Other Systems (Search The Network) option
(Client Configuration Assistant), 396outer joins, 118Output message pane (Visual Studio), 289OVERHEAD parameter (tablespaces), 346
■Ppackage groups, 93packaging for redeployment, 21parallelism, 372PARAMETER CCSID {ASCII | UNICODE}
modifier (SQL PL), 146parameters
authentication, changingin CLP, 172–173in Control Center, 170–171overview of, 169
changing through Control Center, 76–77database, issuing commands to change,
81–82discoverability, 404GROUP_PLUGIN, 182instance, issuing commands to change, 80memory, 468–469self-tuning memory, 469–470for stored procedures, 144–145for tablespaces, 346–347
parentheses, stored procedures and, 144
parsing capabilities of Document Viewer, 197partition groups, 348pdksh Korn Shell package, preinstallation
requirements for, 15performance. See indexesperformance tuning
approach to, 459–460Configuration Advisor
Connections dialog box, 462Isolation dialog box, 463–464Populated dialog box, 462Priority dialog box, 462Results dialog box, 466–467Server dialog box, 460Transactions dialog box, 461using, 460Workload dialog box, 461
as hot topic, 459Memory Visualizer, 471–472monitor switches, activating, 473monitors
event, using, 473–478overview of, 472snapshot, using, 478–481
physical data-storage issues and, 485REORG utility, using, 487–488REORGCHK utility, using, 485–487RUNSTATS
automated statistics generation,481–483
manually running, 484–485self-tuning memory, 468–469Self-Tuning Memory Management,
469–470Perl DBI (database interface module)
compiling from source code, 326–327connecting to DB2, 327–328executing SQL statements, 328–330installing, 324–326overview of, 323resources on, 330
Perl Package Manager (ppm, Windows),325–326
permissions for backups and recovery, 359Personal edition, 5PHP
coding best practice, 251IBM_DB2 extensions
ad hoc SQL statements, working with,252–255
connection management functions,248–251
functions, 257–258managing connections, 252overview of, 248prepared statements and stored
procedures, working with, 255–257
■INDEX506
overview of, 241Zend Core framework
classes, 262configuring, 258–259connection management, 259–260developing with, 258executing statements, 260–262installing, 242–247overview of, 241post-installation checks, 247–248
.php file extension, 244php.ini master configuration file, 259physical data-storage issues and
performance tuning, 485physical model
building, 436–439for employee table, 121for skills table, 52translating logical model to, 436
physical storage for tables, 140–141pipe symbol (|), XML, 199placeholders
myself or any of my descendants (//), 207question mark as, 148
policy (LBAC), defining, 191Populated dialog box (Configuration
Advisor), 462positional predicate (XPath), 206post-installation checks of Zend Core,
247–248ppm (Perl Package Manager, Windows),
325–326practicing backups and recovery, 383predicates (XPath), 205–206PREDICATES option (user-defined
functions), 158PREFETCHSIZE parameter (tablespaces),
346preinstallation requirements, checking,
13–15prepared statements, working with, 255–257PreparedStatement class (JDBC), 307preparing stored procedure via PHP, 255, 257prevval operator (sequences), 228, 231–232primary key constraint, 133–134primary log files, 361Priority dialog box (Configuration Advisor),
462privileged groups, instance-level, 168–169privileges
database-levelchanging, 179–181overview of, 177–178viewing, 179
group behavior, 182–183Label-Based Access Control
example of, 192–194
label component, defining, 191label, defining, 192parts of, 190–191policy, defining, 191
objectgranting, 187–190working with, 185–186
preparing to use, 177roles, 184–185
prize table examplemodeling, 432physical model for, 439
Problem Determination tool (DB2PD), 84–85procedures, object privileges, 186processes
killing, 67server components
DB2 Fault Monitor Coordinator, 72–73DB2 Governor, 71DB2 instances and DAS instance, 70–71DB2 License Server, 71DB2 Management Service, 71DB2 Remote Command Server, 72DB2 Security Server, 72
starting and stoppingfrom command line, 66–70from Control Center, 64–66
PRODUCT table (SAMPLE database), XMLand, 196
progress dialog box of Database CreationWizard, 47
projectsadding objects to, in Data Studio
New SQL Statement Wizard, 100–104New Stored Procedure Wizard, 104–109
building in Visual Studio, 289–290connection management in Data Studio,
97–100creating
with Rails, 267–268in Visual Studio, 284
evolving schema with Ruby, 272pureQuery-enabled, creating, 315–316Rails, connecting to DB2, 268–269reverting to earlier schema with Ruby, 274starting in Data Studio, 95–97Web, building and running, 298–299Windows C#, specifying connection for,
292–293Properties object (JDBC), 309–311PUBLIC group, 183pureQuery for Java
autogenerating mapping classes, 318–320examining results, 321–322project, creating, 315–316
■INDEX 507
pureXML technologyfeatures of, 207–208inserting XML data and, 209overview of, 4, 198Unicode and, 340XML storage and, 208XMLPARSE function, 212XPath and
overview of, 204–205predicates, 205–206wildcards, 206
XQuery and, 199–204Python
connecting with, 332driver, installing, 330–331executing SQL statements, 332resources, 332
■QQ Replication, 446query access plan
with index, 217without index, 216
query languagepureXML and, 198XPath
overview of, 204–205predicates, 205–206wildcards, 206
XQuery, 199–204query optimizer, tuning with RUNSTATS,
481–485question mark, as placeholder, 148question mark (?) command, 59QUIESCE_CONNECT authority, 178quiescing instances, 66
■RRails
connecting project to DB2, 268–269creating project with, 267–268DB2 on Rails toolkit, 263–267designing tables in, 269–271schema evolution feature, 267
rake command (Ruby), 271READS SQL DATA modifier (SQL PL), 145REAL data type, 128recovery
command-line optionsfull restore tweaked for performance,
382full restore with redirection, 382individual tablespace restore, 382–383overview of, 381
Control Center, using, 377–381for free, 375overview of, 375
permissions for, 359practicing, 383restoring from backups, 375–376roll forward, from backups, 376–377
redeployment, packaging for, 21refactoring connection code (JDBC), 305–307REFERENCES privilege, 185referential constraint, 132–136referential integrity, impact of, 218refreshing cached classes, 313registering
IBM data server provider for .NET,281–282
source table, 451XML schema, 211
Registers, using, 120–122Registry Utility (DB2SET), 83regular tablespaces, 342relational databases, XML and, 195, 198relationships, finding in data, 433–434Remote Command Server, 72reorg command (Data Row Compression),
457REORG (reorganization) utility, 487–488REORGCHK (reorganization check) utility,
485–487replication
See also Replication Centerconfiguring
Apply control tables, creating, 451Apply process, starting, 452Capture control tables, creating,
450–451Capture process, starting, 452launching Replication Center, 447–448Replication Center dialog box, 448–449source table, registering, 451subscription set, creating, 452
preparing for, 446–447testing, 452–454
Replication CenterApply control tables, creating, 451Apply process, starting, 452Capture control tables, creating, 450–451Capture process, starting, 452launching, 447–448source table, registering, 451subscription set, creating, 452
Replication Center dialog box, 448–449Replication Tools (DB2 Client), 391reserved words, 55resources
for design, 427installation topics, 31Label-Based Access Control, 194Perl DBI and DBD::DB2 modules, 330Python, 332
■INDEX508
stored procedures, 155response file, 20–21restart clause (alter sequence command),
231restartcount option (import utility), 419restore and recovery. See recoveryrestore database command, 375Results dialog box (Configuration Advisor),
466–467ResultSet class (JDBC), 307resync manager, 70return clause (XQuery), 201Return Status (Data Studio), 109RETURNS option (user-defined functions),
157reverse scans of indexes, 219–220reverting to earlier project schema with Ruby,
274reviewing installation, 35Rexx, 333roles, 184–185roll forward recovery from backups, 376–377rollforward command, 376root user, security context and, 174row functions, 123row-typed user-defined functions, 156rowcount option (import utility), 419.rsp extension, 21Ruby
DB2 on Rails toolkit, 263–267evolving schema with, 272executing migration in, 271–272reverting to earlier schema with, 274scaffolding feature
in action, 275–277generating scaffolding, 275overview of, 274
schema_info table for, 273Ruby, Rails, and DB2 Adapter installation
page, 264Run dialog box, starting DB2 First Steps
from, 40Run successful message (Data Studio), 102running
See also launching; startingData Development Projects, 102Web projects in Visual Studio, 298–299Windows project in Visual Studio, 294
RUNSTATSautomated statistics generation, 481–483manually running, 484–485
■SSAMPLE database
Create Table Wizard, using, 52–55creating with DB2 First Steps, 45–47XML in, 195–199
samples of code, accessing, 333–334scaffolding feature, Ruby on Rails
in action, 275–277generating scaffolding, 275overview of, 274
scalar functions, 123scalar user-defined functions, 156schema evolution feature (Rails), 267, 272–274schema registration, XML, 210–212schemas, 53, 144, 185schema_info table for Ruby, 273script option comments (Visual Studio), 290SECADM authority, 178seclabel_by_name() function, 193secondary log files, 361security context of operating system,
174–175security issues. See authorities; privilegesSecurity Server, 72select ... into ... approach, stored procedures
and, 147select clause of select statement, 114select statements (SQL)
clauses, 114–117count() function, 158creating tables based on, 142joins, 118overview of, 112sequences and, 231–232subqueries, 119union operations, 119–120
Selected menu (Control Center), 51self-tuning memory, 468–469Self-Tuning Memory Management (STMM),
347, 469–470SELF_TUNING_MEM parameter, 469separate clause technique for declaring
primary keys, 133sequences
altering, 230–231attributes for, 228–229cache clause, 230creating, 228description of, 215, 228example of, 230no cache option, 230order clause, 230using, 231–233
SERVER authentication type, 165server components
DB2 Fault Monitor Coordinator, 72–73DB2 Governor, 71DB2 instances and DAS instance, 70–71DB2 License Server, 71DB2 Management Service, 71DB2 Remote Command Server, 72DB2 Security Server, 72
■INDEX 509
Server dialog box (Configuration Advisor),460
Server Explorer (Visual Studio), 286–287Server Support Tools (DB2 Client), 392–393SERVER_ENCRYPT authentication type, 165set integrity command, 425set-based policy components (LBAC), 190Set-up Tools program folder, 40Show button (Design Advisor), 226Show SQL button, 356shredding XML, 208signup page, IBM DB2, 8silent installation, 21size of system tablespace, 346skipcount option (import utility), 419slash character (/), XQuery, 199SMALLINT data type, 128SMS (system managed storage) tablespace,
343–345snapshot monitors, 472, 478–481SNAP_GET_LOCK function, 480source table, registering, 451Spatial Extender Client component
(DB2 Client), 390specific keyword, 153SPECIFIC name modifier (SQL PL), 145specifying alias, 339SQL
See also statementsdata manipulation language (DML)
delete statements, 126insert statements, 124–125overview of, 111select statements, 112–120update statements, 125
DB2 Registers, using, 120–122enumerating columns in, 298statements, executing
with Perl DBI and DBD::DB2 modules,328–330
with Python, 332SQL Assist Wizard, 56–57SQL Builder Wizard (Data Studio)
Add Table dialog box, 103column selection, 104
SQL Persistent Modules (SQL PM), 143SQL PL (SQL Procedural Language)
description of, 143stored procedures
dropping, 152–154example of, 146–152managing, 154–155modifiers for, 145–146parameters for, 144–145resources, 155syntax for, 143
SQL PM (SQL Persistent Modules), 143
SQL Procedural Language. See SQL PLSQL Procedures component (DB2 Client),
390SQL Replication, 446SQL Replication Wizard, 447SQL Statements step of New Stored
Procedure Wizard, 106–107SQL0803N warning message, 418SQL1043C error message, 346SQL1088W error message, 346SQL20189W error message, 348SQL2539W error message, 375SQL27984W warning message, 411SQL3148W warning message, 418SQL3185W warning message, 418SQL3500W marker message, 425SQL3515W marker message, 425SQL3519W marker message, 425SQL3520W marker message, 425SQLCODE values, 67–68SQLJ.REFRESH_CLASSES() procedure, 313sql-query command, 114SQLSTATEs, 67–68square bracket notation in tablespace
assignment, 141ssh server and client, preinstallation
requirements for, 15Starter Toolkit for DB2 on Rails, 263–267starting
See also launching; running; stoppingevent monitors, 474new project in Data Studio, 95–97processes
from command line, 66–70from Control Center, 64–66
Statement class (JDBC), 307statement event monitor, 474–477statement of requirements, 429–430statement terminator in CLP, 341statements
See also select statements (SQL)alter index, 219alter table, compress {yes | no} clause, 457body, writing for stored procedures, 147create table, 130–132, 457delete, 126executing
with Perl DBI and DBD::DB2 modules,328–330
with Python, 332with Zend Core framework, 260–262
goto, 150insert, 124–125, 232prepared, working with, 255–257update, 125, 232
STATIC DISPATCH option (user-definedfunctions), 158
■INDEX510
statistical summary of import utility, 415statistics generation in Design Advisor, 224STMM (Self-Tuning Memory Management)
347, 469–470stopping
See also startingevent monitors, 475processes
from command line, 66–70from Control Center, 64–66
storageautomatic, adding with ALTER DATABASE
command, 349–350disk level of, 337logical, 140–141, 342overview of, 342for SAMPLE database, choosing options,
46for tables, specifying characteristics,
140–141tablespace use
DMS, 345overview of, 342–343parameters, 346–347SMS, 344–345type, choosing, 343–344
stored proceduresdropping, 152–154error management and, 151–152example of, 146–152Java
class, deploying, 312class, writing, 311–312drawbacks to, 314–315overview of, 311testing, 314writing, 313–314
managing, 154–155modifiers for, 145–146New Stored Procedure Wizard (Data
Studio), 104–109parameters for, 144–145resources, 155syntax for, 143user-defined functions compared to, 156working with, 255–257writing, 105
string data types, native, 128–129subqueries, 119subscription set, creating, 452subselect-to-join conversions, 119SUPPLIERS table (SAMPLE database), XML
and, 196surrogate key, adding, 437syntax
ANSI join, 118export utility, 408
declaring primary keys, 133foreign key clause, 135generated clause, 138import utility, 414index creation, 215sequence creation, 228stored procedures, 143table creation, 127tablespace storage characteristics of
tables, 141user-defined functions, 157view creation, 233
synthetic key, adding, 437SYSADM group, 168SYSADM_GROUP parameter, changing, 169SYSCATSPACE, 342SYSCTRL group, 168sysibm.sysdummy1 table, 121SYSMAINT group, 168SYSMON group, 168SYSMON_GROUP parameter, changing, 171system catalog tables, 112system catalog views, 113system managed storage (SMS) tablespace,
343–345system tablespaces
allocating size for, 346description of, 342
system temporary tablespaces, 342System Tray Tool, 82SYSTEM value (collation option), 340
■T-t option (db2 executable), 341table() function, 160table-typed user-defined functions, 156TableAdapter object (Visual Studio), 294tables
Apply control, creating, 451award_result, 217Capture control, creating, 450–451catalog, 112category
identity columns for, 140logical model for, 134nomination table and, 134–135physical model for, 134
clustering data in, 485columns for
automatic value generation, 138–140check constraints, 136–137disabling and deferring constraints, 137null data, working with, 132primary key constraints, 133–134referential constraints, 134–136
compressing, 457–458Create Table Wizard, using, 52–55
■INDEX 511
tables (continued)creating and managing
data types, 127–130nomination table example, 130–131
designing in Rails, 269–271employee
adding new employee to, 122modeling, 432physical model for, 121
features specific to, 141functions, 123intersection, physical design of, 438lock types supported for, 464–466naming, 131nominating index as clustering index for,
221nomination
index for, 215–216modifying to incorporate CategoryID
field, 134performing default statistics collection
against, 484–485physical model for, 439reorganizing, 487–488table creation, 130–131
object privileges, 185options for creating, 142prize
modeling, 432physical model for, 439
PRODUCT (SAMPLE database), 196reorganization for, 488schema_info, for Ruby, 273source, registering, 451storage characteristics, specifying,
140–141syntax for creating, 127sysibm.sysdummy1, 121system catalog, 112votes cast, 146–152
tablespace backups, 373tablespaces
buffer pools, 347–348declaring at table creation, 140description of, 337DMS, 343–345DROPPED TABLE RECOVERY parameter,
348parameters for, 346–347SMS, 344–345type, choosing, 343–344use of, 342–343working with, 350–356
Target tab (Export Table dialog box), 412tbscan access method, 216-tc option (db2move utility), 444TCP communications manager, 70
TCP port 523, DAS and, 25-td option (db2 executable), 341temporal data types, native, 129–130TEMPSPACE, 342terminate command, 61territory values, 340Test Connection button (Visual Studio), 286testconn20.exe utility, 282–283testing
connection problem, 250DB2 .NET connectivity, 282–283to determine correctness of XML, 209IBM Database Add-Ins for Microsoft
Visual Studio, 283–286Java stored procedures, 314replication, 452–454user privileges, 181
text() function, XQuery, 204text handling, 340–341Thin Client Code Server (DB2 Client), 392third-party connectivity options, 405three-valued logic, 438TIME data type, 129TIMESTAMP data type, 130Timing tab (RUNSTATS), 482tools
See also command-line tools; ControlCenter; Data Studio (IBM); DB2 FirstSteps; utilities
Configuration Assistant, 391DB2 Client, 391–393DB2 Command Editor, 55–57DB2 on Rails toolkit, 263–267System Tray Tool, 82
tools catalog configuration screen, 28TOOLSDB database, 28Transactions dialog box (Configuration
Advisor), 461TRANSFERRATE parameter (tablespaces),
347translating logical model to physical model,
436tree-based policy components (LBAC), 190TRUST_ALLCLNTS modifier, 165TRUST_CLNTAUTH modifier, 165TSM setting (archive logging), 363Type 4 JDBC driver, 405Typical installation, 19
■UUCA400_NO, UCA400_LSK, and
UCA400_LTH values (collationoption), 340
UDFs. See user-defined functions (UDFs)Unicode, 340Unified Modeling Language (UML), 430uninstalling DB2, 34
■INDEX512
union operations, 119–120unique values, enforcing with index, 217–218unpacking installation downloads, 12unquiescing instances, 66Update Catalog Statistics dialog box (Design
Advisor), 224UPDATE MONITOR SWITCHES command, 473update statements (SQL), 125, 232updating
views, 235XML data, 212–213
upper() function, 123URL, JDBC connection, 304–305use cases for Employee of the Year
applicationanalysis of, 432–433basic, 430identification of, 432owner, 431powerful personal activities, 430
user nomination for DB2 AdministrationInstance, 26
user temporary tablespaces, 343user-defined functions (UDFs)
calling, 159–160example of, 158–159managing, 161modifiers for, 157–158syntax for, 157types of, 156
USEREXIT setting (archive logging), 363users
See also authentication adding, express technique for, 180granting object privileges to, 187–190preinstallation requirements for, 14
USERSPACE1, 342utilities
db2evmon, 475DB2LEVEL (Version Information), 82db2licm, 35db2look, 441–443, 445–446db2move, 441, 443–445DB2PD (Problem Determination), 84–85DB2SET (Registry Utility), 83import
load utility compared to, 423–425options, 416statistical summary, 415syntax, 414warning messages, 417–418XML parsing and validation options, 421
load, 423–426REORG, 487–488REORGCHK, 485–487testconn20.exe, 282–283vsai.exe, 283
■Vvalidation of XML, 209van Rossum, Guido, 330VARCHAR data type, 129VARGRAPHIC data type, 129VENDOR setting (archive logging), 363Venn diagrams, 119Version Information Utility (DB2LEVEL), 82versions of DB2, 9view template (Visual Studio), 287–288viewing database authorities, 179views
catalog, 113creating, 233–235description of, 215, 233, 237object privileges, 185options for, 235–237selecting for Control Center, 49system catalog, 113
virtual machines, download package for, 6Vista (Windows) support, 11Visual Basic and Visual Basic .NET, 334Visual Studio Add-In installer (vsai.exe), 283Visual Studio.NET (Microsoft)
building .NET Web applicationsbinding objects to controls, 296–297building and running projects, 298–299overview of, 295
building .NET Windows applicationsbinding objects to controls, 291exploring connection’s related objects,
294overview of, 290running projects, 294specifying connection for, 292–293
IBM data server provider for .NET,registering, 281–282
IBM Database Add-Ins forinstalling, 279–280, 283testing, 283–286
integration with, 279managing objects
building project, 289–290creating new view object, 287–289Server Explorer, 286–287
testing DB2 .NET connectivity, 282–283votes cast table example, 146–152vsai.exe (Visual Studio Add-In installer), 283
■INDEX 513
■WWall, Larry, 323warning messages
import utility, 417–418import utility output, 415SQL27984W, 411
warningcount n option (import utility), 418watchdog process, 70WEBrick web server (Ruby)
starting, 275Welcome Aboard page, 276
websitesDB2 on Rails toolkit, 263IBM DB2 home page, 6IBM DB2 permalink, 143Information Center, 68Python Package Index repository, 330Zend, 241
welcome dialog box (Data Studio), 95well-formed test of XML, 209where clause
select statement, 115–116XQuery, 203
wildcards (XPath), 206Windows
AD domain features, 174building .NET applications for with Visual
Studiobinding objects to controls, 291exploring connection’s related objects,
294overview of, 290running projects, 294specifying connection for, 292–293
DB2 Administration Instance and, 26DB2 First Steps, launching under, 40–41graphical installation under, 15–30installing DB2 on, 11installing Zend Core under, 242Local System and Network Service
accounts, 174looking for groups in, 182–183reviewing installation under, 35Ruby, installing under, 266users and groups under, 14
with check option (views), 235Workgroup edition, 5workload, 223Workload dialog box (Configuration Advisor),
461write-ahead logging, 360writing
body statements for stored procedures,147
Java stored procedures, 313–314JDBC applications
connection URL, 304–305data, working with, 307–309features, working with, 309–311overview of, 303–304refactoring connection code, 305–307required CLASSPATH inclusions or
imports, 304stored procedures, 105
■XX server
preinstallation requirements for, 15security settings, and DB2 First Steps, 41
xhost command, 41XML
See also pureXML technologycase sensitivity of, 201delete statement, 213insert statement, 208–210predictions about, 195in SAMPLE database, 195–199schema registration, 210–212Unicode and, 340update statement, 212–213XPath queries for, 204–206XQuery for, 199–204
XML data type, 130XML Extender component (DB2 Client), 390XML Extender Samples component (DB2
Client), 391XML objects, exporting, 411–412XML Schema Repository (XSR), 210XMLEXISTS function, 213xmlns namespace attribute, 199XMLPARSE function, 212xmlparse preserve whitespace option
(import utility), 421XMLTable function, 207–208XPath queries for XML
overview of, 204–205predicates, 205–206wildcards, 206
XQueryfor XML, 199–204XPath compared to, 205
xquery keywordXPath, 204XQuery, 200
XSR (XML Schema Repository), 210xs:string notation, 202
■INDEX514
■Y.yml file extension, 268
■Zz/OS, DB2 for, 6Zend Core framework
administrative login interface, 246administrative summary dialog box, 247administrator password dialog box, 246classes, 262configuring, 258–259connection management, 259–260custom component selection, 244developing with, 258executing statements, 260–262file extension specification dialog box, 244installing, 242–247overview of, 241post-installation checks, 247–248summary dialog box, 246web server selection, 244
■INDEX 515