372 Implementing a Tivoli Solution for Central Management of Large Distributed Environments
EC=$?
if [ $EC -eq 0 ] ; then
echo “Instance object for EP $ep_label succesfully created” >> $LOG_FILE
else
TMR_NAME=$(idlattr -tgv ‘wlookup ServerManagedNode‘ label string |sed -e
“s/\”//g”)
policy_region=‘wlookup -ar PolicyRegion |grep $TMR|grep $TMR_NAME| grep
“DB2 Database Servers”| awk ‘{print $1 “ “ $2 “ “ $3}’‘
wcdb2inst -l “db2inst1@$ep_label” \
-e $ep_label \
-i db2inst1 \
-p “$policy_region” >> $LOG_FILE
RC=$?
if [ $RC -eq 0 ]; then
echo “Instance object for EP $ep_label succesfully created” >>
$LOG_FILE
else
echo “Failed to create Instance object for EP $ep_label” >> $LOG_FILE
exit 1
fi
fi
A.4.2 create_db2_database_objects.sh
This script in Example A-19 creates DB2DatabaseManager objects related to a
new endpoint.
In the APM plan for deployment, a task using this script is executed immediately
after installation of the DB2 Server software package.
Example: A-19 create_db2_database_objects.sh
#!/bin/sh
# This script creates an IBM for Databases for DB2 database resource.
# We started from these assumptions:
#
# instance name is the default one installed with DB2, “db2inst1”
# database name is “STORE”, and each machine that will be installed as EP must
have this DB created under the “db2inst1” instance. The STORE database is used
by
# the TimeCard pllication
# We created the “DB2 Database Servers” Policy Region on both the TMR hub and
the TMR spoke(s)
ep_label=$1
ep=$(echo $ep_label|cut -d “-” -f1)
SCRIPTS_LOC=”/mnt/code/tivoli/scripts”