32k腳本
編寫腳本fio.sh,內容:
#/bin/sh
fio -filename=/dev/sdl -direct=1 -iodepth 1 -thread -rw=read -ioengine=psync -bs=8k -size=200G -numjobs=30 -runtime=60 -group_reporting -name=mytest
sleep 60
fio -filename=/dev/sdb -direct=1 -iodepth 1 -thread -rw=write -ioengine=psync -bs=32k -size=200G -numjobs=30 -runtime=60 -group_reporting -name=mytest
sleep 60
fio -filename=/dev/sdb -direct=1 -iodepth 1 -thread -rw=read -ioengine=psync -bs=32k -size=200G -numjobs=1 -runtime=60 -group_reporting -name=mytest
sleep 60
fio -filename=/dev/sdb -direct=1 -iodepth 1 -thread -rw=write -ioengine=psync -bs=32k -size=200G -numjobs=1 -runtime=60 -group_reporting -name=mytest
執行腳本:
bash ./fio.sh >
fio.log 2>&1
⑵ 系統臨時表空間失效,該怎麼處理
系統臨時表空間失效
1、程序和資料庫都准備完成以後,首次執行程序,在進行數據檢索的時候出現如下錯誤信息:
com.ibm.db2.jcc.am.SqlException: DB2 SQL Error: SQLCODE=-1584, SQLSTATE=57055, SQLERRMC=8192, DRIVER=3.62.56
2、然後在資料庫中分別創建了 4K、8K、16K、32K 的 4 個臨時表空間,再次運行程序,問題解決。
3、停止程序和資料庫的運行,然後重新啟動資料庫和程序,再次出現第一步中出現的錯誤提示。
刪掉上次建立的系統臨時表空間,然後重建,再次運行程序,問題消失。
但是,每次只要重啟資料庫,就會重復出現這個問題,我使用了下述的命令分別建立臨時系統表空間,
問題都未得到解決。仍舊只是當次起作用,重啟就不管用了,重啟資料庫後,臨時表空間和緩沖池仍舊存在於資料庫
因為要用這個程序,我寫了個腳本。
附1:
//db2 "CREATE BUFFERPOOL "BUP4K" SIZE 10000 PAGESIZE 4096 "
//db2 "CREATE BUFFERPOOL "BUP8K" SIZE 10000 PAGESIZE 8192 "
//db2 "CREATE BUFFERPOOL "BUP16K" SIZE 10000 PAGESIZE 16384 "
//db2 "CREATE BUFFERPOOL "BUP32K" SIZE 10000 PAGESIZE 32768 "
=================================================================================
在使用以下兩種方案的時候,還分別使用了「NO FILE SYSTEM CACHING」和「FILE SYSTEM CACHING」兩個參數加在這兩個方案中,作為方案3和方案4測試。
方案1================================================================
//db2
"CREATE SYSTEM TEMPORARY TABLESPACE TS4K PAGESIZE 4096 MANAGED BY
SYSTEM USING ('/home/db2inst1/czfxdata/temptbs4/tmp_tbsp4') EXTENTSIZE
32 PREFETCHSIZE 32 BUFFERPOOL BUP4K"
//db2 "CREATE SYSTEM
TEMPORARY TABLESPACE TS8K PAGESIZE 8192 MANAGED BY SYSTEM USING
('/home/db2inst1/czfxdata/temptbs8/tmp_tbsp8') EXTENTSIZE 32
PREFETCHSIZE 32 BUFFERPOOL BUP8K"
//db2 "CREATE SYSTEM TEMPORARY
TABLESPACE TS16K PAGESIZE 16384 MANAGED BY SYSTEM USING
('/home/db2inst1/czfxdata/temptbs16/tmp_tbsp16') EXTENTSIZE 32
PREFETCHSIZE 32 BUFFERPOOL BUP16K"
//db2 "CREATE SYSTEM TEMPORARY
TABLESPACE TS32K PAGESIZE 32768 MANAGED BY SYSTEM USING
('/home/db2inst1/czfxdata/temptbs32/tmp_tbsp32') EXTENTSIZE 32
PREFETCHSIZE 32 BUFFERPOOL BUP32K"
方案2=================================================================
//db2
"CREATE SYSTEM TEMPORARY TABLESPACE TS4K PAGESIZE 4096 MANAGED BY
SYSTEM USING ('/home/db2inst1/czfxdata/temptbs4/tmp_tbsp4') BUFFERPOOL
BUP4K"
//db2 "CREATE SYSTEM TEMPORARY TABLESPACE TS8K PAGESIZE
8192 MANAGED BY SYSTEM USING
('/home/db2inst1/czfxdata/temptbs8/tmp_tbsp8') BUFFERPOOL BUP8K"
//db2
"CREATE SYSTEM TEMPORARY TABLESPACE TS16K PAGESIZE 16384 MANAGED BY
SYSTEM USING ('/home/db2inst1/czfxdata/temptbs16/tmp_tbsp16') BUFFERPOOL
BUP16K"
//db2 "CREATE SYSTEM TEMPORARY TABLESPACE TS32K PAGESIZE
32768 MANAGED BY SYSTEM USING
('/home/db2inst1/czfxdata/temptbs32/tmp_tbsp32') BUFFERPOOL BUP32K"
附2:
#!/bin/bash
db2start;
db2 connect to rordb99;
echo "================================================================================";
db2 "DROP TABLESPACE "TS16K"";
db2 "DROP TABLESPACE "TS32K"";
db2 "DROP TABLESPACE "TS4K"";
db2 "DROP TABLESPACE "TS8K"";
echo "================================================================================";
db2 "DROP BUFFERPOOL "IBMDEFAULT4K"";
db2 "DROP BUFFERPOOL "IBMDEFAULT8K"";
db2 "DROP BUFFERPOOL "IBMDEFAULT16K"";
db2 "DROP BUFFERPOOL "IBMDEFAULT32K"";
echo "================================================================================";
db2 "CREATE BUFFERPOOL "IBMDEFAULT4K" IMMEDIATE SIZE 10000 PAGESIZE 4096 ";
db2 "CREATE BUFFERPOOL "IBMDEFAULT8K" IMMEDIATE SIZE 10000 PAGESIZE 8192 ";
db2 "CREATE BUFFERPOOL "IBMDEFAULT16K" IMMEDIATE SIZE 10000 PAGESIZE 16384 ";
db2 "CREATE BUFFERPOOL "IBMDEFAULT32K" IMMEDIATE SIZE 10000 PAGESIZE 32768 ";