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