db2 -v update dbm cfg using UTIL_IMPACT_LIM    100
db2 -v update dbm cfg using diaglevel          0 
db2 -v update dbm cfg using SHEAPTHRES         33761
db2 -v update dbm cfg using INTRA_PARALLEL     OFF
db2 -v update dbm cfg using MAX_QUERYDEGREE    1
db2 -v update dbm cfg using MAXAGENTS          2000
db2 -v update dbm cfg using DFT_MON_LOCK       OFF
db2 -v update dbm cfg using DFT_MON_STMT       OFF
db2 -v update dbm cfg using DFT_MON_TABLE      OFF
db2 -v update dbm cfg using DFT_MON_UOW        OFF
db2 -v update dbm cfg using DFT_MON_TIMESTAMP OFF
db2 -v update dbm cfg using notifylevel 0
db2 -v update dbm cfg using query_heap_sz 52428
db2 -v update dbm cfg using rqrioblk 4096
db2 -v update dbm cfg using aslheapsz 2000
db2 -v update dbm cfg using svcename 50000
db2 -v update dbm cfg using num_initagents 250

db2 -v connect to specdb user spec using spec 
db2 -v update db cfg for specdb using dft_queryopt 0
db2 -v update db cfg for specdb using dbheap 128000
db2 -v update db cfg for specdb using locklist 4006
db2 -v update db cfg for specdb using logbufsz 256
db2 -v update db cfg for specdb using seqdetect NO
db2 -v update db cfg for specdb using num_ioservers 1
db2 -v update db cfg for specdb using logfilsiz 40000
db2 -v update db cfg for specdb using logprimary 80
db2 update db cfg for specdb using newlogpath /dev/rexp300lv4
db2 -v update db cfg for specdb using num_ioservers 1
db2 -v update db cfg for specdb using num_iocleaners 1
db2 -v update db cfg for specdb using softmax 8000
db2 -v update db cfg for specdb using dft_degree 1
db2 -v update db cfg for specdb using MAXAPPLS 4000
db2 -v update db cfg for specdb using MAXLOCKS 100
db2 -v update db cfg for specdb using CHNGPGS_THRESH  80
db2 -v update db cfg for specdb using LOGSECOND       0
db2 -v update db cfg for specdb using LOCKTIMEOUT     -1
db2 -v update db cfg for specdb using mincommit 3
db2 -v set event monitor db2detaildeadlock state 0
db2 -v drop event monitor db2detaildeadlock
db2 -v alter bufferpool ibmdefaultbp size 3145680

db2 -v alter table m_largeorder volatile
db2 -v reorgchk update statistics on table all
db2set DB2_APM_PERFORMANCE=1,3,4,5,6,7,9
db2 -v connect reset
db2 -v terminate

db2 -v connect to specdb user db2inst1 using K1ngB3ee 
###########################################
# Alter table locksize table
#
###########################################

db2 alter table o_item locksize table

###########################################
#
# alter table append on
###########################################

db2 alter table c_customer append on
db2 alter table o_customer append on
db2 alter table o_orders append on
db2 alter table o_orderline append on
db2 alter table m_workorder append on
db2 alter table m_largeorder append on
db2 alter table s_purchase_order append on
db2 alter table s_purchase_orderline append on

###########################################
#
# alter table pctfree
#
###########################################

db2 alter table c_parts pctfree 99
db2 alter table o_item pctfree 99
db2 alter table m_parts pctfree 99
db2 alter table m_bom pctfree 99
db2 alter table m_inventory pctfree 99
db2 alter table s_supplier pctfree 99
db2 alter table s_component pctfree 99
db2 alter table s_supp_component pctfree 99
db2 alter table u_sequences pctfree 99

############################################
#
# drop/recreate index
#
############################################

db2 drop index c_c_idx
db2 "CREATE UNIQUE INDEX C_c_idx ON C_customer (c_id) PCTFREE 20 LEVEL2 PCTFREE 20 PAGE SPLIT HIGH"

db2 drop index M_lo_idx 
db2 "CREATE UNIQUE INDEX M_lo_idx ON M_largeorder (lo_id) PCTFREE 20 LEVEL2 PCTFREE 20 PAGE SPLIT HIGH"

db2 drop index M_OL_O_idx
db2 "CREATE UNIQUE INDEX M_OL_O_idx ON M_largeorder (lo_o_id, lo_ol_id) PCTFREE 20 LEVEL2 PCTFREE 20 PAGE SPLIT HIGH"

db2 drop index O_c_idx
db2 "CREATE UNIQUE INDEX O_c_idx ON O_customer (c_id) PCTFREE 20 LEVEL2 PCTFREE 20 PAGE SPLIT HIGH"

db2 drop index O_ords_idx
db2 "CREATE UNIQUE INDEX O_ords_idx ON O_orders (o_id) PCTFREE 20 LEVEL2 PCTFREE 20 PAGE SPLIT HIGH"

db2 drop index O_oc_idx
db2 "CREATE INDEX O_oc_idx ON O_orders (o_c_id) PCTFREE 20 LEVEL2 PCTFREE 20 PAGE SPLIT HIGH"

db2 drop index O_ordl_idx
db2 "CREATE UNIQUE INDEX O_ordl_idx ON O_orderline (ol_o_id, ol_id) PCTFREE 20 LEVEL2 PCTFREE 20 PAGE SPLIT HIGH"

db2 drop index S_po_idx
db2 "CREATE UNIQUE INDEX S_po_idx ON S_purchase_order (po_number) PCTFREE 20 LEVEL2 PCTFREE 20 PAGE SPLIT HIGH"

db2 drop index S_pol_idx
db2 "CREATE UNIQUE INDEX S_pol_idx ON S_purchase_orderline (pol_po_id, pol_number) PCTFREE 20 LEVEL2 PCTFREE 20 PAGE SPLIT HIGH"

db2 drop index U_S_IDX
db2 "CREATE UNIQUE INDEX U_S_IDX on U_SEQUENCES (S_ID) PCTFREE 99"

############################################
#
# runstat
#
############################################

db2 -v reorgchk update statistics on table all

db2 -v connect reset
db2 -v terminate

