daolin2005
作者daolin2005·2012-09-11 15:55
数据库管理员·某城商行

2种办法快速找到占用临时表空间的app

字数 8144阅读 2736评论 11赞 0
2种办法快速找到占用临时表空间的app
1) db2pd -tcbstat -d xxx >tcbstat.log
search "TEMP", schemaname is the app handle.
查找 TEMP 相应的table schema Name 就是我们的app handle .
TCB Table Stats:
Address            TableName          SchemaNm Scans      UDI        RTSUDI               PgReorgs   NoChgUpdts Reads      FscrUpdates Inserts    Updates    Deletes    OvFlRead
s  OvFlCrtes  RowsComp   RowsUncomp CCLogReads StoreBytes BytesSaved
0x070000006F34F858 RUNINFO            EOD      15         2          2                    1          0          116        42          97         0          101        0
   0          0          0          0          -          -
0x070000007374D358 TEMP (00004,00003) <58558>< 1          236524     236524               0          0          74750033   0           236524     0          0          0
   0          0          0          0          16625870   0
0x070000006B3EA358 HMON_ATM_INFO      SYSTOOLS 739        13720      13720                2          109225     592613     3           1          154384     0          62585
   1          0          0          0          -          -
0x07000000674DF1D8 PBTUSAG            EOD      3          198        198                  0          0          3080634    18          1138       0          0          0
   0          0          0          0          -          -
0x070000006A042958 SECTMVPL           EOD      91         0          0                    18         0          40578      78          2363       0          2364       0
   0          0          0          0          -          -

2) snapshot

0) Turn On Session level monitor. db2 update monitor switches using BUFFERPOOL on lock on sort on statement on table on timestamp on uow on 
1) Get the snapshot for tables.       db2 get snapshot for tables on $DB >tab.snap.log
2) vi tab.snap.log , search "TEMP", table schema is the Application handle   

eg.
Table Schema        = <58558><BRIOADM >
 Table Name          = TEMP (00004,00003)

 Table Type          = Temporary
 Data Object Pages   = 4524
 Rows Read           = 1084585
 Rows Written        = 0
 Overflows           = 0
 Page Reorgs         = 0

3) db2 get snapshot for applications on $DB >app.snap.log
Vi app.snap.log Search App Handle "58558", you will got the executing sql.

eg.
Application handle                         = 58558
Application status                         = UOW Executing
Status change time                         = 09/11/2012 06:12:05.138363
Application code page                      = 1208
Application country/region code            = 0
DUOW correlation token                     = 9.57.167.17.43830.120911061206
Application name                           = db2jcc_application
Application ID                             = 9.57.167.17.43830.120911061206
Buffer pool temporary data logical reads   = 2763644
Dynamic SQL statement text:
delete from eod.ctrl_rsmyrpts where rpt_type_cd=12 and (cwa_id,RPT_ACCESS_ID) not in (select cwa_id,RPT_ACCESS_ID from eod.ctusrrpt)

都是一些简单的英文单词. 应该都看的懂哈.

如果觉得我的文章对您有用,请点赞。您的支持将鼓励我继续创作!

0

添加新评论11 条评论

王永科王永科数据库管理员天网软件
2012-12-05 12:36
very good
xujingle1988xujingle1988系统管理员上海
2012-12-01 22:00
很详细,学习了
shlei6067shlei6067联盟成员数据库管理员NJ
2012-10-24 18:02
我也试验下。
DB-TrendSetterDB-TrendSetter联盟成员数据库架构师公司
2012-10-04 12:28
well done!
duanzhihuiduanzhihui数据库管理员IBM成都GDC
2012-09-24 17:05
清晰明了,学习了
yritechyritech数据库管理员国信网联
2012-09-21 10:13
学习
daolin2005daolin2005数据库管理员某城商行
2012-09-20 10:35
weiruan85: 牛逼
db2dart 系统表乱码求指点啊.

http://www.db2china.net/club/thread-25937-1-1.html
weiruan85weiruan85数据库管理员ibm
2012-09-19 09:58
牛逼
nanjing_2013nanjing_2013系统架构师北京卓望
2012-09-12 10:06
ok,3Q,
daolin2005daolin2005数据库管理员某城商行
2012-09-12 10:04
nanjing_2013: Table Name          = TEMP (00004,00003)
这其中的00004,00003分别代表什么呢??
004是tablespace id , 003是临时表的tableid .
nanjing_2013nanjing_2013系统架构师北京卓望
2012-09-12 09:49
Table Name          = TEMP (00004,00003)
这其中的00004,00003分别代表什么呢??
Ctrl+Enter 发表

作者其他文章

相关文章

相关问题

X社区推广