db2锁表,如何查找阻塞进程的pid

时间:2013-11-29 11:13:10

标签: database db2

我对db2管理知之甚少,而且我无法弄清楚如何找到锁定选项卡表的进程的pid。

使用db2top(屏幕“U”),我有下表:

Agent        Application  Application    Object              Lock     Object     Lock       Lock  Is      Locked   Tablespace
Id(State)    Name         Status         Name                Mode     Type       Status     Count Blocker By       Name
------------ ------------ -------------- ------------------- -------- ---------- ---------- ----- ------- -------- -----------
     7060(l) xxxxxxxxxx   Lock Waiting   YYYY01.TABLEZZ      IS       Table      Granted        1      No     7974 USERSPACE1
     7060(l) xxxxxxxxxx   Lock Waiting   Internal Variation  S        Variation  Granted        1      No     7974 -
     7060(l) xxxxxxxxxx   Lock Waiting   YYYY01.TABLEZZ[0]   NS [X]   Row        -              -      No     7974 USERSPACE1
     7060(l) xxxxxxxxxx   Lock Waiting   Internal Plan       S        Plan       Granted        1      No     7974 -
     7974(l) xxxxxxxxxx   Lock Waiting   Internal Variation  S        Variation  Granted        1     Yes     8080 -
     7974(l) xxxxxxxxxx   Lock Waiting   YYYY01.TABLEZZ[0]   X [U]    Row        -              -     Yes     8080 USERSPACE1
     7974(l) xxxxxxxxxx   Lock Waiting   Internal Plan       S        Plan       Granted        1     Yes     8080 -
     7974(l) xxxxxxxxxx   Lock Waiting   YYYY01.TABLEZZ      IX       Table      Granted        1     Yes     8080 USERSPACE1

我已经发现Agent 7974是阻塞的。我想杀死它并修复/测试bug。 如何找出代理7974的pid,以便我可以附加一个gdb?

1 个答案:

答案 0 :(得分:1)

如果您只想杀死代理,则可以使用db2 force application (7974)执行此操作。客户端进程ID显示在会话屏幕上的db2top中(按l)。您也可以使用db2pd -db <your database> -agents app=7974

相关问题