【DB2】監控臨時表空間使用
阿新 • • 發佈:2019-01-01
log 執行 mon 應用程序 數據庫 font one 監視 nbsp
在我們使用數據庫的時候,我們都知道應用程序在DB2上運行時,會產生臨時表空間,我們想要監測這些臨時表空間的使用情況,可以使用以下步驟:
(1)打開monitor switches 中的table監視器:
db2inst1@Linux:/qinys> db2 update monitor switches using table on
DB20000I The UPDATE MONITOR SWITCHES command completed successfully.
(2)對數據庫抓取table快照
db2inst1@Linux:~> db2 get snapshot for tables on qindb>>snap_tables.out
(3)在快照信息中輸出定位系統臨時表信息(通過執行2的語句即可獲得)
db2inst1@Linux:~> cat -n snap_tables.out | grep "TEMP"
14 Table Name = TEMP (00003,00002)
(4)在系統臨時表中定位對應的agent ID
上圖表記的1105即為臨時表空間使用的agent ID
(5)通過快照ID,我們就可以使用應用程序快照或者db2pd工具找到對應的應用
db2inst1@Linux:~> db2 get snapshot for application agentid 1105 | grep "Application name"
Application name = db2jcc_application
【DB2】監控臨時表空間使用