签到成功

知道了

CNDBA社区CNDBA社区

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

2024-05-08 08:46 514 0 原创 DB2
作者: hbhe0316

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

http://www.cndba.cn/hbhe0316/article/131545
http://www.cndba.cn/hbhe0316/article/131545
http://www.cndba.cn/hbhe0316/article/131545http://www.cndba.cn/hbhe0316/article/131545http://www.cndba.cn/hbhe0316/article/131545http://www.cndba.cn/hbhe0316/article/131545
http://www.cndba.cn/hbhe0316/article/131545
http://www.cndba.cn/hbhe0316/article/131545

#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.

#找到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
#这个时候再次查看备份连接就消失了

版权声明:本文为博主原创文章,未经博主允许不得转载。

DB2

用户评论
* 以下用户言论只代表其个人观点,不代表CNDBA社区的观点或立场
hbhe0316

hbhe0316

关注

1.只有承认无知,才能装下新的东西; 2.进步来自一点点滴滴的积累; 3.广博让你更优秀,而专业让你无法替代; 4.挫折和失败能够转换为一种财富。

  • 889
    原创
  • 1
    翻译
  • 13
    转载
  • 24
    评论
  • 访问:1128304次
  • 积分:1523
  • 等级:核心会员
  • 排名:第6名
精华文章
    最新问题
    查看更多+
    热门文章
      热门用户
      推荐用户
        Copyright © 2016 All Rights Reserved. Powered by CNDBA · 皖ICP备2022006297号-1·

        QQ交流群

        注册联系QQ