IBM DB2 Universal database 重重 Administration Guide: Implementation Version 8 Sc09482000
IBM® DB2 Universal Database™ Administration Guide: Implementation Version 8 SC09-4820-00
IBM DB2 Universal database 重重 Administration Guide: Implementation Version 8 Sc09482000
IBM® DB2 Universal Database™ Administration Guide: Implementation Version 8 SC09-4820-00
efore using this information and the product it supports, be sure to read the general information under Notices This document contains proprietary information of IBM. It is provided under a license agreement and is protected by copyright law. The information contained in this publication does not include any product warranties, and any statements provided in this manual should not be interpreted as such. You can order IBM publications online or through your local IBM representative. ToorderpublicationsonlinegototheIbMPublicationsCenteratwww.ibm.com/shop/publications/order To find your local IBM representative, go to the IBM Directory of Worldwide Contacts at To order DB2 publications from DB2 Marketing and Sales in the United States or Canada, call 1-800-IBM-YOU (426-4968) When you send information to IBM, you grant IBM a nonexclusive right to use or distribute the information in any way it believes appropriate without incur ny obligation to you o Copyright International Business Machines Corporation 1993-2002. All rights reserved. US Government Users Restricted Rights- Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp
Before using this information and the product it supports, be sure to read the general information under Notices. This document contains proprietary information of IBM. It is provided under a license agreement and is protected by copyright law. The information contained in this publication does not include any product warranties, and any statements provided in this manual should not be interpreted as such. You can order IBM publications online or through your local IBM representative. v To order publications online, go to the IBM Publications Center at www.ibm.com/shop/publications/order v To find your local IBM representative, go to the IBM Directory of Worldwide Contacts at www.ibm.com/planetwide To order DB2 publications from DB2 Marketing and Sales in the United States or Canada, call 1-800-IBM-4YOU (426-4968). When you send information to IBM, you grant IBM a nonexclusive right to use or distribute the information in any way it believes appropriate without incurring any obligation to you. © Copyright International Business Machines Corporation 1993 - 2002. All rights reserved. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp
Contents About this book eclaring registry and environment Who should use this book variables How this book is structured Setting environment variables on Windows 34 a brief overview of the other Administration Setting environment variables on UNIX Guide volumes systems Administration Guide: Planning Creating a node configuration file Administration Guide: Performance Creating the database configuration file Fast communications manager(FCM) Part 1. Implementing Your Design ommunications DB2 Administration Server(DAs) 392244 Chapter 1. Before Creating a Database DB2 Administration Server Create a db2 Administration Server Prerequisites for Creating a Database Starting DB2 UDB on UNIX Starting and stopping the DAS Starting DB2 UDB on Windows Listing the DAS Multiple Instances of the Database Manager 6 Configuring the DAS Attaching to another instance of the Tools catalog database and DAS scheduler database manager etup and configuration Grouping objects by schema Notification and contact list setup and Parallelism Stopping a DB2 instance on UNIX DAS Java virtual machine setup Stopping a DB2 instance on Windows Security considerations for the DAS on Preparing to Create a Database Windows Designing Logical and Physical Database dating the DAS on UNⅨ Characteristics Removing the das Instance creation Setting up DAS with Enterprise Server Setting the DB2 environment automatically Edition(ESE)systems on unix DAS configuration on Enterprise Server Edition(ESE) systems Setting the DB2 Environment Manually on UNIX Control Center communications with das: Multiple instances on a UNIX operating service ports Internode administrative communications. Multiple instances on a windows Windows DB2 ESE operating system Discovery of administration servers, Creating additional instances 24 instances, and databases UNIX Details When Creating Instances 25 Hiding server instances and database Windows Details When Creating Instances 26 from discovery 64 Add an Instance Setting discovery parameters uIse the Listing instances Setting up the das to Setting the current instance Configuration Assistant and the Control Center Auto-starting instances Running multiple instances concurrent Update the DAS configuration for License management discovery DB2 administration server first failure data c Copyright IBM Corp. 1993-2002
Contents About this book . . . . . . . . . . ix Who should use this book. . . . . . . .x How this book is structured . . . . . . .x A brief overview of the other Administration Guide volumes . . . . . . . . . . . xii Administration Guide: Planning . . . . xii Administration Guide: Performance . . . xii Part 1. Implementing Your Design . 1 Chapter 1. Before Creating a Database . . 3 Prerequisites for Creating a Database . . . .4 Starting DB2 UDB on UNIX . . . . . .4 Starting DB2 UDB on Windows . . . . .5 Multiple Instances of the Database Manager 6 Attaching to another instance of the database manager . . . . . . . . .7 Grouping objects by schema . . . . . .8 Parallelism . . . . . . . . . . . .9 Stopping a DB2 instance on UNIX . . . 15 Stopping a DB2 instance on Windows . . 16 Preparing to Create a Database. . . . . . 17 Designing Logical and Physical Database Characteristics . . . . . . . . . . 18 Instance creation . . . . . . . . . 18 Setting the DB2 environment automatically on UNIX . . . . . . . . . . . . 20 Setting the DB2 Environment Manually on UNIX . . . . . . . . . . . . . 21 Multiple instances on a UNIX operating system . . . . . . . . . . . . . 22 Multiple instances on a Windows operating system . . . . . . . . . 23 Creating additional instances . . . . . 24 UNIX Details When Creating Instances . . 25 Windows Details When Creating Instances 26 Add an Instance . . . . . . . . . 27 Listing instances . . . . . . . . . 28 Setting the current instance . . . . . . 28 Auto-starting instances . . . . . . . 29 Running multiple instances concurrently 29 License management . . . . . . . . 30 Environment Variables and the Profile Registry . . . . . . . . . . . . 30 Declaring registry and environment variables . . . . . . . . . . . . 32 Setting environment variables on Windows 34 Setting environment variables on UNIX systems . . . . . . . . . . . . 37 Creating a node configuration file. . . . 39 Creating the database configuration file . . 42 Fast communications manager (FCM) communications. . . . . . . . . . 42 DB2 Administration Server (DAS). . . . . 44 DB2 Administration Server . . . . . . 44 Create a DB2 Administration Server . . . 47 Starting and stopping the DAS. . . . . 48 Listing the DAS . . . . . . . . . . 49 Configuring the DAS . . . . . . . . 49 Tools catalog database and DAS scheduler setup and configuration . . . . . . . 50 Notification and contact list setup and configuration. . . . . . . . . . . 55 DAS Java virtual machine setup . . . . 56 Security considerations for the DAS on Windows . . . . . . . . . . . . 57 Updating the DAS on UNIX . . . . . 57 Removing the DAS . . . . . . . . 58 Setting up DAS with Enterprise Server Edition (ESE) systems . . . . . . . . 59 DAS configuration on Enterprise Server Edition (ESE) systems . . . . . . . . 61 Control Center communications with DAS: service ports . . . . . . . . . . . 62 Internode administrative communications: Windows DB2 ESE . . . . . . . . . 62 Discovery of administration servers, instances, and databases . . . . . . . 62 Hiding server instances and databases from discovery . . . . . . . . . . 64 Setting discovery parameters . . . . . 65 Setting up the DAS to use the Configuration Assistant and the Control Center . . . . . . . . . . . . . 66 Update the DAS configuration for discovery . . . . . . . . . . . . 67 DB2 administration server first failure data capture. . . . . . . . . . . . . 67 © Copyright IBM Corp. 1993 - 2002 iii
Chapter 2. Creating a database 71 Populating a typed table Creating a database Hierarchy table Definition of initial database partition groups Creating a table in multiple table spaces 119 Defining initial table spaces Creating a table in a partitioned database 120 Definition of system catalog tables Creating a trigg Definition of database directories 123566 Trigger dependencies ocal database directory Using triggers to update view content System database directory 76 Creating a user-defined function(UDF)or Viewing the local or system database method 77 Details on creating a user-defined function 77 (UDF)or methe Lightweight Directory Access Protocol Creating a function mapping (LDAP) Directory Service Creating a function template Creating database partition groups User-defined type (UDT) (nodegroups) Details on creating a user-defined typ Binding utilities to the database 6 Definition of Database recove Creating a user-defined distinct type Cataloging a database Creating a user-defined structured type 132 Updating the directories with information Creating a type mapping about remote database server machines Creating a view Creating a table space Details on creating a view 137 Creating specific types of table spaces Creating a typed view Creating a system temporary table space 87 Creating a materialized query table 13 Creating a user temporary table space 88 Creating a staging table 141 Creating table spaces in database partition Creating group ndex, index extension, or index specification 145 Specifying raw I/O Details on creating an index, index Setting up raw I/O on Linux 90 extension, or index specification 148 Creating a schema 92 Creating an index Details on the creation of schemas Setting a schema sing the CREATE INDEX statement.. 150 Details on creating and populating a table..98 Details on creating a user-defined extendeo154 Creating and populating a table Creating a user-defined extended index ty Introduction to space compression for index type 155 tables Details on index maintenance Space compression for new tables Details on index searching Large object(LOB)column considerations 99 Defining Constraints A scenario for defining an index Defining a table check constraint extension Defining an informational constraint . 108 Invoking the Performance Configuration Defining a generated column on a new Wizard through the command line processor. 161 table Creating a user-defined temporary table 110 Chapter 3. Altering a Database 163 Defining an identity column on a new Before Altering a Database Changing logical and physical design Creating a sequence characteristics Comparing IDENTITY columns and Changing the license information Changing instances(UNIX only Defining dimensions on a table 115 Details on changing instances Creating a typed table 117 Changing the node configuration file 169 IV Administration Guide: Implementatio
Chapter 2. Creating a Database . . . . . 71 Creating a database . . . . . . . . . 71 Definition of initial database partition groups 72 Defining initial table spaces . . . . . . . 73 Definition of system catalog tables . . . . 75 Definition of Database Directories . . . . . 76 Local database directory . . . . . . . 76 System database directory . . . . . . 76 Viewing the local or system database directory files . . . . . . . . . . 77 Node directory . . . . . . . . . . 77 Lightweight Directory Access Protocol (LDAP) Directory Service . . . . . . . 78 Creating database partition groups (nodegroups). . . . . . . . . . . . 79 Definition of Database Recovery Log. . . . 80 Binding utilities to the database . . . . . 81 Cataloging a database. . . . . . . . . 81 Updating the directories with information about remote database server machines . . . 83 Creating a table space. . . . . . . . . 84 Creating specific types of table spaces . . . 87 Creating a system temporary table space 87 Creating a user temporary table space . . 88 Creating table spaces in database partition groups . . . . . . . . . . . . . 89 Specifying raw I/O . . . . . . . . 89 Setting up raw I/O on Linux . . . . . 90 Creating a schema . . . . . . . . . . 92 Details on the creation of schemas . . . . 94 Setting a schema . . . . . . . . . 94 Creating and populating a table . . . . . 95 Details on creating and populating a table . . 98 Introduction to space compression for tables . . . . . . . . . . . . . 98 Space compression for new tables . . . . 99 Large object (LOB) column considerations 99 Defining Constraints . . . . . . . . 101 Defining a table check constraint. . . . 107 Defining an informational constraint . . 108 Defining a generated column on a new table . . . . . . . . . . . . . 108 Creating a user-defined temporary table 110 Defining an identity column on a new table . . . . . . . . . . . . . 111 Creating a sequence . . . . . . . . 112 Comparing IDENTITY columns and sequences . . . . . . . . . . . 114 Defining dimensions on a table . . . . 115 Creating a typed table . . . . . . . 117 Populating a typed table . . . . . . 118 Hierarchy table . . . . . . . . . 118 Creating a table in multiple table spaces 119 Creating a table in a partitioned database 120 Creating a trigger . . . . . . . . . . 122 Trigger dependencies . . . . . . . . 124 Using triggers to update view contents . . 125 Creating a user-defined function (UDF) or method . . . . . . . . . . . . . 126 Details on creating a user-defined function (UDF) or method . . . . . . . . . . 127 Creating a function mapping . . . . . 128 Creating a function template . . . . . 129 User-defined type (UDT) . . . . . . . 130 Details on creating a user-defined type (UDT). . . . . . . . . . . . . . 131 Creating a user-defined distinct type . . 131 Creating a user-defined structured type 132 Creating a type mapping . . . . . . 133 Creating a view . . . . . . . . . . 133 Details on creating a view . . . . . . . 137 Creating a typed view . . . . . . . 137 Creating a materialized query table . . . . 137 Creating a staging table . . . . . . . . 141 Creating an alias . . . . . . . . . . 143 Index, index extension, or index specification 145 Details on creating an index, index extension, or index specification . . . . . 148 Creating an index . . . . . . . . . 148 Using an index. . . . . . . . . . 150 Using the CREATE INDEX statement . . 150 Creating a user-defined extended index type 154 Details on creating a user-defined extended index type . . . . . . . . . . . . 155 Details on index maintenance . . . . . 155 Details on index searching . . . . . . 156 Details on index exploitation . . . . . 157 A scenario for defining an index extension . . . . . . . . . . . 158 Invoking the Performance Configuration Wizard through the command line processor. 161 Chapter 3. Altering a Database . . . . 163 Before Altering a Database . . . . . . . 163 Changing logical and physical design characteristics . . . . . . . . . . 163 Changing the license information . . . 163 Changing instances (UNIX only) . . . . 164 Details on changing instances . . . . . 164 Changing the node configuration file . . 169 iv Administration Guide: Implementation