免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 10636 | 回复: 4
打印 上一主题 下一主题

用户已经断开,锁没释放。 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2013-12-27 19:27 |只看该作者 |倒序浏览
1> sp_lock
2> go
The class column will display the cursor name for locks associated with a cursor for the current user and the cursor id for other users.
fid    spid   loid        locktype                     table_id    page        row    dbname          class                          context                     
------ ------ ----------- ---------------------------- ----------- ----------- ------ --------------- ------------------------------ ----------------------------
      0    603        1206 Ex_table                      1422367838           0      0 tempdb          Non Cursor Lock                                             
      0    618        1236 Ex_table                      1084530899           0      0 tempdb          Non Cursor Lock                                             
      0   1072        2144 Sh_intent                       32000114           0      0 master          Non Cursor Lock                                             
      0   1674        3348 Ex_table                       922890061           0      0 tempdb          Non Cursor Lock                                             
      0   1751        3502 Ex_table                       394888180           0      0 tempdb          Non Cursor Lock   


=====

1> sp_who '603'
2> go
fid    spid   status       loginame     origname     hostname   blk_spid dbname     cmd              block_xloid
------ ------ ------------ ------------ ------------ ---------- -------- ---------- ---------------- -----------

(0 rows affected)
(return status = 0)
1> kill 603
2> go
Msg 6106, Level 16, State 1:
Server 'mkt39', Line 1:
Process '603' is not an active process number.
1> kill 618
2> go
Msg 6106, Level 16, State 1:
Server 'mkt39', Line 1:
Process '618' is not an active process number.
1> kill 1674
2> go
Msg 6106, Level 16, State 1:
Server 'mkt39', Line 1:
Process '1674' is not an active process number.
1> kill 1751
2> go
Msg 6106, Level 16, State 1:
Server 'mkt39', Line 1:
Process '1751' is not an active process number.
1> sp_who '1751'
2> go
fid    spid   status       loginame     origname     hostname   blk_spid dbname     cmd              block_xloid
------ ------ ------------ ------------ ------------ ---------- -------- ---------- ---------------- -----------

(0 rows affected)
(return status = 0)
1>

AIX53,ASE12.5。用户已经不存在,但是锁资源没释放??
除了重启,有什么办法可以释放掉锁??

论坛徽章:
0
2 [报告]
发表于 2013-12-29 16:51 |只看该作者
只能重启

论坛徽章:
0
3 [报告]
发表于 2013-12-31 09:37 |只看该作者
可以試試:dbcc cacheremove

论坛徽章:
0
4 [报告]
发表于 2013-12-31 17:36 |只看该作者
dbcc cacheremove ( db_id | db_name, object_id | object_name )
Deallocates the object descriptor (DES) for the specified table.

之前生产上因为存储链路问题,导致这个情况。现在好像没办法模拟出来。

论坛徽章:
7
数据库技术版块每日发帖之星
日期:2015-08-09 06:20:00数据库技术版块每日发帖之星
日期:2015-11-03 06:20:00数据库技术版块每日发帖之星
日期:2016-02-20 06:20:00数据库技术版块每日发帖之星
日期:2016-07-13 06:20:00数据库技术版块每日发帖之星
日期:2016-07-31 06:20:00数据库技术版块每日发帖之星
日期:2016-08-01 06:20:00数据库技术版块每日发帖之星
日期:2016-08-18 06:20:00
5 [报告]
发表于 2014-01-01 10:38 |只看该作者
在确定不会产生data integrity issue的时候,可以试试---
dbcc lock_release(spid,level,type,dbid,objid,[page[,row][,'force']])

一定慎用
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP