IBM Support

监视DB2命令的进度

Technical Blog Post


Abstract

监视DB2命令的进度

Body

在DBA常用的命令中,有的命令需要的时间可能比较长。以下总结了常见的命令及监视方法。

DB2命令 监视方法
Crash Recovery

db2pd -rec -db <dbname>

db2pd -util

参照: http://www-01.ibm.com/support/docview.wss?uid=swg21655286

优化: UTIL_HEAP_SZ, adjust parallelism by  setting number of redo workers, eg, set to 5 below(the below number 6 = 5 workers + 1 redo master):
db2set DB2BPVARS=<path to buffer pool config file>
In the config file, put this line:
PREC_NUM_AGENTS=6

Rollforward

db2pd -rec -db <dbname>

db2 list utilities show detail or db2pd -util

优化: same as Crash Recovery

Backup and Restore

db2 list utilities show detail or db2pd -util

优化: UTIL_HEAP_SZ, parallelism, buffer

Reorg

db2pd -db <dbname> -reorg
db2pd -db <dbname> -reorg index

优化: Dropping unnecessary indexes, sortheap & sheapthres(>SORTHEAP*#of_processors), number of page cleaner(NUM_IOCLEANERS)

https://www.ibm.com/support/knowledgecenter/SSEPGG_11.1.0/com.ibm.db2.luw.admin.perf.doc/doc/c0024852.html

Rebalance

db2 list utilities show detail or db2pd -util
db2 get snapshot for tablespaces on <dbname>

MON_GET_REBALANCE_STATUS table function

Application rollback

db2pd -util

db2pd -load -alldbs

优化: Load parallelism and data buffer(>1/4*util_heap_sz), UTIL_HEAP_SZ

参照:

https://www.ibm.com/developerworks/community/blogs/IMSupport/entry/How_to_monitor_LOAD_progress_and_improve_its_performance?lang=en

Indexing 优化: UTIL_HEAP_SZ, SHEAPTHRES
Runstats

db2 list utilities show detail or db2pd -util

db2pd -db <dbname> -runstats

Partition Detach db2 list utilities show detail or db2pd -util
Load

db2pd -util

db2pd -load -alldbs

优化: Load parallelism and data buffer(>1/4*util_heap_sz), UTIL_HEAP_SZ

参照:

https://www.ibm.com/developerworks/community/blogs/IMSupport/entry/How_to_monitor_LOAD_progress_and_improve_its_performance?lang=en

 

[{"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Component":"","Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

UID

ibm13286575