db2无法force掉备份连接的处理办法

在数据库在线备份的时候会与Load和ALTER TABLE <表名> ACTIVATE NOT LOGGED INITIALLY WITH EMPTY TABLE发生冲突导致这两种操作被挂起,而在MIS系统中数据库往往比较大(TB级别很常见),备份时候经常花费几个小时,甚至1天以上的时间。当我们急需上述两种操作的时候,就需要kill掉备份,一般步骤如下:

#1 找到备份连接
[db2inst1@limt bin]$ db2 list applications show detail|grep -i back
#2 force掉备份连接
[db2inst1@limt bin]$ db2 "force application(26)"
DB20000I  The FORCE APPLICATION command completed successfully.
DB21024I  This command is asynchronous and may not be effective immediately.

然后有时我们连续执行了几次备份依然不能kill掉,我们可以用另一种手段:

#找到Process ID of client application 
[db2inst1@limt bin]$ db2 get snapshot for application agentid 55|less

            Application Snapshot

Application handle                         = 55
Application status                         = Connect Completed
Status change time                         = Not Collected
Application code page                      = 1208
Application country/region code            = 0
DUOW correlation token                     = *LOCAL.db2inst1.150104134326
Application name                           = db2bp
Application ID                             = *LOCAL.db2inst1.150104134326
Sequence number                            = 00001
TP Monitor client user ID                  =
TP Monitor client workstation name         =
TP Monitor client application name         =
TP Monitor client accounting string        =

Connection request start timestamp         = 2015-01-04 21:43:26.408291
Connect request completion timestamp       = 2015-01-04 21:43:28.310947
Application idle time                      = Not Collected
CONNECT Authorization ID                   = DB2INST1
Client login ID                            = db2inst1
Configuration NNAME of client              = limt
Client database manager product ID         = SQL10010
Process ID of client application           = 4153  # 此处为要找到的BP进程号
Platform of client application             = LINUXAMD64  
Communication protocol of client           = Local Client

#此进程为db2bp
[db2inst1@limt bin]$ ps -ef|grep 4153
db2inst1   4153      1  0 21:28 pts/0    00:00:00 /home/db2inst1/sqllib/bin/db2bp 3796A502 5 A
db2inst1   4961   3796  0 21:46 pts/0    00:00:00 grep 4153 
[db2inst1@limt bin]$ kill -9 4153
#这个时候再次查看备份连接就消失了

 

这个办法一般也适合force C程序的嵌入式SQL程序

转载于:https://www.cnblogs.com/limt/p/4206797.html

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值