Siebel Server Installation Guide for UNIX > Sample Database Creation Scripts >

DB2 UDB Sample Script


Although you may edit the sample DB2 UDB creation script in any way to suit your site requirements, you must retain the command within the script that specifies your codeset, territory, and collating sequence or the language characteristics of your database will not be set up.

NOTE:  Siebel Systems supports only binary collating sequence. Therefore, make sure that you include this value when you add the command for setting the language characteristics of your instance, as described in Creating the DB2 Universal Database for Windows and UNIX to the sample.

Sample Database Instance Creation Script (sampledbcfg.ksh)

Edit the sampledbcfg.ksh script to fit your site requirements and run it to create a DB2 database instance.

CAUTION:  This database instance creation script specifies LOGRETAIN RECOVERY. This requires that you first do a database backup. If you do not first back up the database, the script fails.

The following file can be found in the directory $DBSRVR_ROOT/db2udb under UNIX.

# ----------------------------------------------------------------------

#

# Copyright (C) 2001, Siebel Systems, Inc., All rights reserved.

#

# File: sampledbcfg.ksh

# Date: 9/10/01

# Purpose: Sample script demonstrates how to configure DB2 and set up a database

# for Siebel applications

#

# Edit the parameters below to reflect the default DB installation

# To run this script from c-shell or k-shell type . ./sampledbcfg

# Make sure db2 installation is in system path

# Make sure that directories exist prior to db creation

# Make sure directories have read/write privileges

# -----------------------------------------------------------------------

DBNAME=SIEBEL

DBPATH=/home/DBPATH

TEMPSPACE4K=/home/temp_4k

TEMPSPACE16k=/home/temp_16k

TEMPSPACE32k=/home/temp_32k

TBS4KPATH1=/home/tbs_4k_1

TBS4KPATH2=/home/tbs_4k_2

TBS4KPATH3=/home/tbs_4k_3

TBS16KPATH1=/home/tbs_16k_1

TBS16KPATH2=/home/tbs_16k_2

TBS16KPATH3=/home/tbs_16k_3

TBS32KPATH1=/home/tbs_32k_1

TBS32KPATH2=/home/tbs_32k_2

TBS32KPATH3=/home/tbs_32k_3

##########Set the DB2 registry variables##########

db2set DB2_HASH_JOIN=NO

db2set DB2_RR_TO_RS=YES

db2set DB2_MMAP_WRITE=OFF

db2set DB2_MMAP_READ=OFF

db2set DB2_CORRELATED_PREDICATES=ON

db2set DB2_INDEX_2BYTEVARLEN=ON

db2set DB2_PIPELINED_PLANS=ON

db2set DB2_INTERESTING_KEYS=ON

db2set DB2_PARALLEL_IO=*

db2set DB2_STRIPED_CONTAINERS=ON

db2set DB2MEMMAXFREE=3000000

db2set DB2MEMDISCLAIM=YES

##########Set the database manager configuration parameters##########

db2 "update dbm cfg using SHEAPTHRES 100000"

db2 "update dbm cfg using DIR_CACHE YES"

db2 "update dbm cfg using QUERY_HEAP_SZ 16384"

db2 "update dbm cfg using ASLHEAPSZ 1024"

db2 "update dbm cfg using RQRIOBLK 65535"

db2 "update dbm cfg using MON_HEAP_SZ 128"

db2 "update dbm cfg using KEEPDARI YES"

db2 "update dbm cfg using MAXAGENTS 1000"

db2 "update dbm cfg using NUM_INITAGENTS 0"

db2 "update dbm cfg using MAX_COORDAGENTS 1000"

db2 "update dbm cfg using INDEXREC RESTART"

db2 "update dbm cfg using MAX_QUERYDEGREE 1"

db2 "update dbm cfg using INTRA_PARALLEL NO"

##########Bounce the server to pick up the configuration changes##########

db2stop force

db2start

##########Create the database##########

db2 "create database %DBNAME% USING CODESET 1252 TERRITORY US COLLATE USING IDENTITY"

##########Set the database configuration parameters##########

db2 "update db cfg for $DBNAME using DFT_DEGREE 1"

db2 "update db cfg for $DBNAME using DFT_QUERYOPT 3"

db2 "update db cfg for $DBNAME using DBHEAP 7429"

db2 "update db cfg for $DBNAME using CATALOGCACHE_SZ 5558"

db2 "update db cfg for $DBNAME using LOGBUFSZ 512"

db2 "update db cfg for $DBNAME using UTIL_HEAP_SZ 5000"

db2 "update db cfg for $DBNAME using LOCKLIST 5000"

db2 "update db cfg for $DBNAME using APP_CTL_HEAP_SZ 300"

db2 "update db cfg for $DBNAME using SORTHEAP 1000"

db2 "update db cfg for $DBNAME using STMTHEAP 8192"

db2 "update db cfg for $DBNAME using PCKCACHESZ 2048"

db2 "update db cfg for $DBNAME using STAT_HEAP_SZ 8000"

db2 "update db cfg for $DBNAME using MAXLOCKS 20"

db2 "update db cfg for $DBNAME using LOCKTIMEOUT 300"

db2 "update db cfg for $DBNAME using CHNGPGS_THRESH 30"

db2 "update db cfg for $DBNAME using INDEXSORT YES"

db2 "update db cfg for $DBNAME using SEQDETECT YES"

db2 "update db cfg for $DBNAME using DFT_PREFETCH_SZ 128"

db2 "update db cfg for $DBNAME using LOGRETAIN RECOVERY"

db2 "update db cfg for $DBNAME using MAXAPPLS 40"

db2 "update db cfg for $DBNAME using AVG_APPLS 20"

db2 "update db cfg for $DBNAME using MAXFILOP 500"

db2 "update db cfg for $DBNAME using LOGFILSIZ 8000"

db2 "update db cfg for $DBNAME using LOGPRIMARY 25"

db2 "update db cfg for $DBNAME using LOGSECOND 100"

db2 "update db cfg for $DBNAME using SOFTMAX 80"

db2 "update db cfg for $DBNAME using APPLHEAPSZ 2500"

db2 "update db cfg for $DBNAME using NUM_IOCLEANERS 4"

db2 "update db cfg for $DBNAME using NUM_IOSERVERS 20"

##########Connect to the database, increase the default bufferpool##########

##########Create the 16K and 32 bufferpools , grant permissions##########

db2 "connect to $DBNAME"

db2 "create bufferpool buf16k size 500 pagesize 16k"

db2 "create bufferpool buf32k size 500 pagesize 32k"

db2 "grant dbadm on database to $DBNAME"

db2 "grant connect on database to sse_role"

db2 "alter bufferpool ibmdefaultbp size 2000"

##########Bounce the server to activate new parameters and bufferpools##########

db2 "connect reset"

db2stop force

db2start

##########Create temporary tablespaces with 16K and 32K pagesizes##########

db2 "connect to $DBNAME"

db2 "create temporary tablespace temp16k pagesize 16 K managed by system using ('$TEMPSPACE16k') bufferpool BUF16K"

db2 "create temporary tablespace temp32k pagesize 32 K managed by system using ('$TEMPSPACE32k') bufferpool BUF32k"

##########Create regular tablespaces with 4K, 16K and 32K pagesizes##########

##########Each tablespace in this example uses database managed storage##########

db2 "create tablespace tbs_4k pagesize 4 K managed by database using \

(file '$TBS4KPATH1' 10000, file '$TBS4KPATH2' 10000, file '$TBS4KPATH3' 10000) bufferpool ibmdefaultbp"

db2 "create tablespace tbs_16k pagesize 16 K managed by database using \

(file '$TBS16KPATH1' 10000, file '$TBS16KPATH2' 10000, file '$TBS16KPATH3' 10000 ) bufferpool buf16k"

db2 "create tablespace tbs_32k pagesize 32 K managed by database using \

(file '$TBS32KPATH1' 10000, file '$TBS32KPATH2' 10000, file '$TBS32KPATH3' 10000) bufferpool buf32k"

db2 terminate


 Siebel Server Installation Guide for UNIX 
 Published: 24 June 2003