beautypg.com

Chapter 2. db2 server deployment, Figure 2-7 logic of the mass deployment script, Example 2-18 source code of db2srv_install – IBM Data Server DB2 User Manual

Page 79

background image

Chapter 2. DB2 server deployment

65

Figure 2-7 Logic of the mass deployment script

Example 2-18 shows our sample deployment script db2srv_install.

Example 2-18 Source code of db2srv_install

#!/usr/bin/ksh
##############################################################
#
# Mass deployment script for DB2 for UNIX/Linux
#
##############################################################
#
# db2srv_install -D|-R -N -H hostA,hostB,...,hostN
# -r response_file -b install_path -f NOTSAMP
# -p productShortName -c NLPACK_location -n
# -L language -l logfile -t tracefile"
#
##############################################################
#setopts=-x
setopts="${setopts:-+x}"
set ${setopts?}

# clean variables
unset CMDOPTS MOD

Script Start

Parse command line options

Do basic synatx check on options

chksyntax ()

Mount NFS on remote machine

mountnfs ()

Try ssh connection

Perform response file deployment

resp_dply ()

Perform db2_install deployment

db2install_dply ()

Unmount NFS on remote machine

umountnfs ()

Read next hostname

Script End

Empty

Failure