DB2 Deployment Guide
Page
SG24-7653-00
DB2 Deployment Guide
First Edition October
Contents
Iv DB2 Deployment Guide
Ruby
NET
Contents
Vi DB2 Deployment Guide
C/C++ PHP Ruby Python Perl
Copyright License
Vii
Informix Redbooks logo Cloudscape InfoSphere
Trademarks
OS/400 WebSphere EServer
General Parallel File System PSeries
Team that wrote this book
Preface
IBM Toronto Laboratory, Canada
Acknowledgements
Jian, John, and Carsten
DB2 Deployment Guide
Comments welcome
Become a published author
IBM Austria
Preface
Xii DB2 Deployment Guide
Introduction to DB2 deployment
DB2 deployment overview
1 DB2 Server products
DB2 9.5 for UNIX, Linux, and Windows products
DB2 Express-C and DB2 Express-C FTL Edition
DB2 Express Edition
DB2 Workgroup Server Edition
2 DB2 clients and drivers
DB2 Enterprise Server Edition
IBM Data Server Runtime Client
IBM Data Server Driver for Jdbc and Sqlj
IBM Data Server Driver for ODBC, CLI, and .NET
DB2 Products and components Download
Downloadable DB2 products and components
3 DB2 standalone and connect products
IBM Database Enterprise Developer Edition Dede
Other DB2 products
DB2 product availability
InfoSphere Warehouse as
10 DB2 Deployment Guide
Deployment considerations
Introduction to DB2 deployment
Supported client /server matrix
Nature of the client and application
12 DB2 Deployment Guide
Hardware and software considerations
Client/server relationship
Hardware requirements for Version
14 DB2 Deployment Guide
Software requirement for DB2
Introduction to DB2 deployment
16 DB2 Deployment Guide
2 DB2 version considerations
3 DB2 product considerations
DB2 for LUW Server product listing Features and functions
18 DB2 Deployment Guide
DB2 9.5 server product overview
Authorized User license
License considerations
20 DB2 Deployment Guide
Processor Value Units per core
Processor Value Unit license
22 DB2 Deployment Guide
Authorization considerations
Requirements
Requirements and limitations on Linux and Unix platforms
Limitations
24 DB2 Deployment Guide
Requirements and limitations in Windows platforms
Key differences
Hkeycurrentuser
Other considerations
Configuration considerations
26 DB2 Deployment Guide
Installation method Windows Linux or Unix
Installation methods
28 DB2 Deployment Guide
DB2 server deployment
System requirement
Server deployment planning
User and group required in deployment
30 DB2 Deployment Guide
Instance owner user
DB2 Users and groups on Linux and Unix
Fenced user
DB2 server deployment
Non-root installation on UNIX/Linux
Non-root/non-Administrator installation
Administration server user
Windows security
Elevated privileges installation on Windows
34 DB2 Deployment Guide
4 DB2 configuration profile and database profile
DB2 Configuration Assistant
36 DB2 Deployment Guide
Example 2-1 File generated by DB2 configuration Assistant
Options for db2cfexp
Db2cfexp and db2cfimp
Information
This local instance
Db2look command options
Database configuration
Specify database name
Standard output
Example 2-2 db2look output
Considerations for a partitioned database
40 DB2 Deployment Guide
Licensing for a partitioned database
Users and groups in a partitioned database environment
Remote shell
DB2 server deployment methods
Communication settings
Example 2-3 TCP/IP ports
42 DB2 Deployment Guide
1 DB2 Setup wizard
44 DB2 Deployment Guide
DB2setup launchpad
Set user information
46 DB2 Deployment Guide
2 db2install
Example 2-4 The output of command db2install
48 DB2 Deployment Guide
Response file
Example 2-5 Format of a response file
50 DB2 Deployment Guide
Creating a response file using the DB2 Setup wizard
Instance
Example 2-6 Using db2rspgn
52 DB2 Deployment Guide
Creating a response file from the sample response file
Example 2-7 The response file generated from sample
Instance
54 DB2 Deployment Guide
Deploying DB2 server with application
56 DB2 Deployment Guide
Example 2-8 The value of keyword Interactive is changed
Will be transformed to this format
Payload file deployment for Linux and Unix
58 DB2 Deployment Guide
Mass deployment of DB2 server using a script
Installing SSH on managed machines
Setup of SSH and NFS
Example 2-9 NFS file sets on AIX
60 DB2 Deployment Guide
Enabling SSH automatic login for root user
Example 2-14 Files generated by above commands
62 DB2 Deployment Guide
Example 2-16 Public key is kept in authorizedkeys on Baltic
Example 2-17 Verify NFS configuration from command line
NFS configuration
2 DB2 license
64 DB2 Deployment Guide
Creating the deployment script
Logic of the mass deployment script
Example 2-18 Source code of db2srvinstall
66 DB2 Deployment Guide
DB2 server deployment
68 DB2 Deployment Guide
Following command line syntax is used for db2srvinstall
Command line options
Example 2-20 Copy response file to NFS path
Example 2-19 NFS path where db2 image has been extracted
70 DB2 Deployment Guide
Running a mass deployment
Example 2-21 Mass deployment using db2install
72 DB2 Deployment Guide
Example 2-22 Mass deployment using response file
Windows deployment scripts
Example 2-24 Install path conflicts with existing DB2 copy
Example 2-23 DB2 copies existing on baltic
74 DB2 Deployment Guide
Example 2-26 Sample Windows deployment script output
Fix pack deployment
76 DB2 Deployment Guide
Fix pack overview
Stopping all DB2 processes before deployment
Deployment method
Mass deployment of DB2 fix pack with a script
Tasks after fix pack deployment
Environment
Network topology of mass fix pack deployment
Script logic and command line options
80 DB2 Deployment Guide
Logics of DB2 fix pack mass deployment script
Example 2-27 Source code of fix pack mass deployment script
Sample deployment script
82 DB2 Deployment Guide
DB2 server deployment
84 DB2 Deployment Guide
Starting fixpack deployment on machine %s using %s...\n
86 DB2 Deployment Guide
Example 2-28 Performing the mass deployment of DB2 fix pack
Example 2-29 List the installed DB2 copies
88 DB2 Deployment Guide
DB2 client deployment
Select the right client type
Client deployment planning
Option a IBM Data Server Driver
Option B IBM DB2 clients
Footprint
Reducing the size of the install image
DB2 client deployment
Configuration profile
Configuration and customization
Db2cli.ini initialization file
92 DB2 Deployment Guide
Multiple instance compatibility
Compatibility
Client /Server compatibility
Licensing
How to deploy the DB2 client
94 DB2 Deployment Guide
IBM data server client installation methods
Db2install script
DB2 Setup wizard
Response file install
96 DB2 Deployment Guide
Db2iprune command line utility
Reducing the installation image
Client instance on the DB2 server
98 DB2 Deployment Guide
Example 3-1 Entries in the .prn file
Considerations for a pruned DB2 installation
IBM data server client deployment on Windows
Mass deployment of IBM data server client product
100 DB2 Deployment Guide
SMS Administration Console
Administrator Console
Package Definition window
Welcome screen
Selecting DB2 package definition
Specify source directory for selected package
Source Files window
Completing the Create Package from Definition Wizard
106 DB2 Deployment Guide
11 Start software distribution
12 Welcome to the Distribute Software Wizard
15 Advertise a Program window
14 Selecting distribution points
16 Select a Program to Advertise window
19 Advertise to Subcollections window
18 Advertisement Name window
20 Advertisement Schedule window
112 DB2 Deployment Guide
22 Completing the Distribute Software Wizard window
23 Configuration Manager Console
114 DB2 Deployment Guide
25 Create Package from Definition Wizard window
27 Create Package from Definition Wizard window
116 DB2 Deployment Guide
28 Source Files window
29Source Directory window
118 DB2 Deployment Guide
30 Completing the Create Package from Definition Wizard
31 Create Package from Definition Wizard window
Distributing DB2 install packages using the Microsoft Sccm
33 Welcome to the Distribute Software Wizard window
32 Starting software distribution
34 Packages window
122 DB2 Deployment Guide
36 Advertise a Program window
37 Select a Program to Advertise window
124 DB2 Deployment Guide
38 Advertisement Target window
39 Advertisement Name window
126 DB2 Deployment Guide
40 Advertise to Subcollections window
41 Advertisement Schedule window
128 DB2 Deployment Guide
42 Assign Program window
43 Distribute Package Wizard window
Example 3-2 Push deployment script
IBM data server client deployment on Linux and Unix
130 DB2 Deployment Guide
Thin Client deployment
132 DB2 Deployment Guide
45 Select the features to install
46 Sharing the code server directory
Creating a thin client response file
134 DB2 Deployment Guide
Setting up thin clients using the thnsetup command
Network drive. This parameter is mandatory on Windows XP
136 DB2 Deployment Guide
137
Deploying applications with DB2
IBM Data Server Driver for Jdbc and Sqlj
Introduction to application deployment package
Prerequisites
138 DB2 Deployment Guide
Deploying applications with DB2
LOS/400 PTFs for Unicode UTF-8 support
IBM Data Server Driver for Jdbc and Sqlj files
Installation procedure
140 DB2 Deployment Guide
Library file names for different platforms
Database server configuration setup
142 DB2 Deployment Guide
Bm.db2.luw.apdv.java.doc/doc/t0024156.html
144 DB2 Deployment Guide
Deploying applications with DB2
Installing IBM Data Server Driver for ODBC, CLI, and .NET
Installing IBM Data Server Driver for Odbc and CLI
146 DB2 Deployment Guide
DB2 registry variables supported as environment variables
Configuring IBM Data Server Driver for Odbc and CLI
Miscellaneous variables
Diagnostic variables
Connection variables
148 DB2 Deployment Guide
Set PATH=clidriverpath\binclidriverpath\lib%PATH%
License requirements
Java
150 DB2 Deployment Guide
Prerequisites
Example 4-2 Deployment structure for our Java application
Deployment procedure for a Java application
152 DB2 Deployment Guide
Example 4-4 Successful test of our deployed application
CLI and Odbc
Deploying C/C++ applications
154 DB2 Deployment Guide
Odbc vs. CLI
Comparison of CLI and Odbc
Isolation level mapping between Odbc and DB2
Sample application
Logic of sample application
Considerations for deployment of CLI and Odbc applications
Connecting to database
Redistributable driver files
158 DB2 Deployment Guide
Deploying a CLI application along with Odbc CLI driver
Example 4-5 Content of redist.txt
Preparing the redistributable driver files
160 DB2 Deployment Guide
Example 4-6 Script file bldpkg
Deploying applications with DB2
Preparing the application executable file
Example 4-8 Verify package content
162 DB2 Deployment Guide
Compile and link the application in one step
Example 4-9 a successful connection using itsocliapp
Example 4-11 The complete contents of installimage
Example 4-10 a failed connect test using itsocliapp
Preparing the deployment package
Example 4-12 Source codes of script appinstall
166 DB2 Deployment Guide
Deploying the application package to the target system
168 DB2 Deployment Guide
Example 4-14 Deploy application using scrip appinstallt
PHP
Embedded SQL and Administrative API
Example 4-15 Verify the connection after deployment
Pdoibm
Installation of IBM PHP drivers
IBMDB2
170 DB2 Deployment Guide
4 PHP
Installation procedure on Linux and Unix
Prerequisites
IBM Data Server Driver for CLI support
Example 4-17 Output of php -m
Example 4-16 Lines to added to php.ini file
172 DB2 Deployment Guide
Installation procedure on Windows
174 DB2 Deployment Guide
Example 4-19 Failed connection using itsophpapp.php
Example 4-18 a successful connection using itsophpapp.php
Deploying a PHP application with the DB2 drivers
Preparing the PHP application package
Example 4-20 Deployment script phpappinstall
176 DB2 Deployment Guide
Deploying applications with DB2
178 DB2 Deployment Guide
Example 4-22 Package generation for phpdeploy
Example 4-21 Contents of phpdeploy directory
Deploying the DB2 PHP application
Example 4-23 Deploying using script phpappinstall
Example 4-24 Verifying deployed PHP application
180 DB2 Deployment Guide
Ruby
Installation of Ibmdb gem
IBM Ibmdb gem
182 DB2 Deployment Guide
Installation procedure for Linux, UNIX, and Windows
Example 4-26 Failed connection using itsorubyapp.rb
Example 4-25 Successful connection using itsorubyapp.rb
Creating a sample Ruby application
Deploying a Ruby application with the DB2 drivers
Preparing the Ruby application package
Example 4-27 Code of script rubyappinstall
184 DB2 Deployment Guide
Deploying applications with DB2
186 DB2 Deployment Guide
Deploying the DB2 Ruby application
Example 4-28 Contents of rubydeployment directory
Example 4-29 Package generation for rubydeploy
Example 4-31 Testing deployed Ruby application
Example 4-30 Deploying using script rubyappinstall
Help and support
188 DB2 Deployment Guide
Ibmdb driver
Python
Ibmdbdbi wrapper
Ibmdbsa adaptor
Installation of IBM Python drivers
190 DB2 Deployment Guide
Installation procedure
Creating a sample Python application
Example 4-32 Successful connection using itsopyapp.py
192 DB2 Deployment Guide
Deploying a Python application with the DB2 drivers
Example 4-33 Failed connection using itsopyapp.py
Preparing the Python application package
Example 4-34 Code of script pyappinstall
194 DB2 Deployment Guide
Deploying applications with DB2
196 DB2 Deployment Guide
Deploying the sample Python application
Example 4-35 Contents of pythondeploy directory
Example 4-36 Package generation for pythondeploy
198 DB2 Deployment Guide
Example 4-37 Deploying using script pyappinstall
DBDDB2
Perl
Example 4-38 Verifying deployed Python application
Prerequisites to installing DBDDB2
Installation of IBM Perl driver
Example 4-39 Installing DBI on Linux and Unix
200 DB2 Deployment Guide
Example 4-41 Installation commands for installing DBDDB2
Installation procedure for Linux and Unix
Example 4-42 a successful connection using itsoperlapp.pl
Installation procedure for Windows
Creating a sample Perl application
202 DB2 Deployment Guide
Deploying a Perl application with the DB2 drivers
Example 4-43 Failed connection using itsoperlapp.pl
Preparing Perl driver and redistributable DB2 driver files
Preparing the Perl application package
Example 4-44 Code of script perlappinstall
204 DB2 Deployment Guide
Deploying applications with DB2
Example 4-46 Package generation for perldeploy
Example 4-45 Contents of perldeploy directory
Deploying the DB2 Perl application
Example 4-47 Deployment using script perlappinstall
Example 4-48 Verifying deployed Perl application
NET
208 DB2 Deployment Guide
Deployment procedure for a .NET application
Example 4-50 Silent install of the IBM Data Server Driver
Example 4-49 Response file content
210 DB2 Deployment Guide
Example 4-51 Call to testconn20 and the resulting output
212 DB2 Deployment Guide
213
Deploying pre-configured databases
Introduction
Using a backup image
214 DB2 Deployment Guide
Deploying pre-configured databases
Using scripts
Sample database
215
216 DB2 Deployment Guide
Deploying a database using scripts
Database creation
Collecting information about the database
Database layout
217
218 DB2 Deployment Guide
Example 5-2 Itsodb layout buffer pool and table spaces
219
Database objects
Example 5-4 DDL statement for creating the Department table
Db2look
Example 5-5 Using db2look to get DDL statements
Dependencies between database objects
Creating a database with the output from db2look
Example 5-6 Check and set integrity on our sample database
221
Command line processor options
Using a shell script
222 DB2 Deployment Guide
223
CLP return codes
CLP return codes and the impact of the -s option
224 DB2 Deployment Guide
Unix script
Example a
Windows script
Example B
Example C
226 DB2 Deployment Guide
227
Complete Windows example
Step
Using an application
228 DB2 Deployment Guide
229
Creating the database from Java
Example 5-10 Executing a script from within Java
230 DB2 Deployment Guide
Creating database layout and database objects from Java
Java sample applications
Deploying a database using a backup image
231
Populating the database
Using SQL statements
232 DB2 Deployment Guide
233
Using a shell script
Example 5-13 Run the Java sample applications
Using an application
234 DB2 Deployment Guide
Exporting data
Using DB2 utilities
Import utility
Importing data
Different import modes
237
Load utility
238 DB2 Deployment Guide
Db2move utility
Importing data with db2move
Exporting data with db2move
Loading data with db2move
239
240 DB2 Deployment Guide
Updating an existing installation
241
Updating non-table objects
Preparing data
Updating table objects
Altering the table
242 DB2 Deployment Guide
Example 5-20 Using altobj to change the table itso.staff
Using the stored procedure altobj
243
244 DB2 Deployment Guide
Using a custom script
Example 5-21 Custom script to change itso.staff
245
246 DB2 Deployment Guide
DB2 metadata for database layout
Where to find the dependent objects for a table
Java sample application Automating update
247
DB2 metadata for some of the database objects
Building the dependency map
Comparing two database configurations
248 DB2 Deployment Guide
249
Big picture of the application
250 DB2 Deployment Guide
Overview of the Java application
Alternatives DB2 tools
Samples overview
251
Shell scripts
Scripts
Scripts containing DDL and SQL statements
Supportive shell scripts
253
Argument. Example cexe createdb.cmd
Shell scripts
Log file importdb.log
Log file export.log
Log file loaddb.log
Log filepopulatedb.log
255
Java applications
Java applications
Compare two database configurations and list new tables
Print out both database configurations to stdout
Database given as argument to meet the configuration
Configuration of the ITSO2 database
10 Shell scripts to start Java applications
257
Target environment. Example
Modified to reflect the target environment. Example
258 DB2 Deployment Guide
259
C/C++
Example A-1 Sample CLI application
260 DB2 Deployment Guide
Appendix A. Sample applications
262 DB2 Deployment Guide
Example A-2 Sample PHP application
Example A-3 Sample Ruby application
264 DB2 Deployment Guide
Example A-4 Sample Python application
Example A-5 Sample Perl application
266 DB2 Deployment Guide
267
Locating the Web material
How to use the Web material
Using the Web material
System requirements for downloading the Web material
Other publications
IBM Redbooks
IBM DB2
269
270 DB2 Deployment Guide
Related publications
Linux Other
Online resources
272 DB2 Deployment Guide
Help from IBM
How to get Redbooks
274 DB2 Deployment Guide
Numerics
Symbols
275
Prn extension
147 Db2cfexp
Db2setup Db2sorcvbuf 147
Db2cfimp Db2chgpath Db2cli.ini 167 103
148
Page
Msdtc
Page
Page
DB2 Deployment Guide
Page
Page
DB2 Deployment Guide