DB=specdb
KIT_LOC=/opt/driver/SPECjEnterprise2010_v1.0

db2stop force
ipclean -a
db2start
echo DROPPING EXISTING ${DB} DATABASE
db2 drop db ${DB}
db2set DB2_APM_PERFORMANCE=
db2stop
db2start
echo "create DB   "
db2 create db ${DB} on /specdata1

echo "Update configuration  "
db2 connect to ${DB}
db2 update db cfg using newlogpath /speclog1
db2 update db cfg using logfilsiz 65535
db2stop force
db2start

echo "configure DB ant script  "
ant -buildfile ${KIT_LOC}/build.xml database.configure

echo "loading DB  ant script"
ant -buildfile ${KIT_LOC}/build.xml load.database

db2 connect to ${DB}
echo "PCTFREE ON ORDER TABLES   "
db2 alter table O_ORDERLINE pctfree 99
db2 alter table O_CUSTINVENTORY pctfree 99
db2 alter table O_ORDERS pctfree 99

echo "Reorgchk   "
db2 reorgchk update statistics
db2 disconnect all


echo "Done!   "
