Svenson's  Bulletin Board Forum Index Svenson's Bulletin Board
Bulletin Board for boat building and model airplane building enthusiasts.
 
AlbumAlbum   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

gen create tablespace statement, distribute across spindles

 
Post new topic   Reply to topic    Svenson's Bulletin Board Forum Index -> DB2
View previous topic :: View next topic  
Author Message
craig
Site Admin


Joined: 19 Feb 2006
Posts: 40

PostPosted: Mon Oct 23, 2006 1:52 pm    Post subject: gen create tablespace statement, distribute across spindles Reply with quote

Usage()
{
echo 'usage: ctsp <dbname> <numpages> <tablespacename> <numcontainers> <pagesize>' >&2
exit 1
}

Spindles()
{
df -k | \
grep dasd | \
egrep -v 'log|100%|9[0-9]%' | \
sort +3 -n | \
awk '{ print $7 }' >/tmp/dasd.list
}

[ $# -ne 5 ] && Usage

Spindles

export DB=$( echo $1 | tr '[a-z]' '[A-Z]' )
export PAGES=$2
export NAME=$( echo $3 | tr '[a-z]' '[A-Z]' )
export CONTS=$4
export PS=$5

let PAGESPER=$(echo $PAGES $CONTS / p | dc)
let ADD=$(( 32 - $(( $PAGESPER % 32 ))))
let PAGESPER+=$ADD

{

echo "create tablespace $NAME
in database partition group ibmdefaultgroup
pagesize "$PS"K
managed by database
using ("

export NC=","
let c=0
while [ c -lt $CONTS ] ; do

let g=$(( $c + 1 ))

PTH=$(cat /tmp/dasd.list | head -$g | tail -1)

[ $g -eq $CONTS ] && NC=""
echo " File '$PTH/$DB.$NAME.container.$c' $PAGESPER$NC"

let c+=1
done

echo ")
extentsize 32
prefetchsize 32
bufferpool BP"$PS"K01
dropped table recovery on;"

} >$HOME/tsp/$NAME.ddl
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    Svenson's Bulletin Board Forum Index -> DB2 All times are GMT - 8 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group