我正在运行sybase ASE Adaptive Server Enterprise/15.0.3/EBF 17690 ESD#1.1 RELSE/P/Solaris AMD64/OS 5.10/ase1503/2681/64-bit/FBO/Thu Aug 20 15:37:40 2009
并面临一个奇怪的问题。
当删除不存在的索引时,我会无限期地挂起:
1> sp_helpindex TABLE#DATA#DEALIRD_DBF
2> go
Object has the following indexes
index_name index_keys index_description index_max_rows_per_page index_fillfactor index_reservepagegap index_created index_local
----------- ---------- -------------------- ----------------------- ---------------- -------------------- ------------------- ------------
DEALIRD_ND0 M_NB nonclustered, unique 0 0 0 Oct 1 2012 10:20AM Global Index
(1 row affected)
index_ptn_name index_ptn_seg
---------------------- -------------
DEALIRD_ND0_2038047761 default
(1 row affected, return status = 0)
1> drop index TABLE#DATA#DEALIRD_DBF.WHATEVER
2> go
此后无限期挂起。
从另一个会话中,我查看正在运行的内容:
sqsh-2.1.3 Copyright (C) 1995-2001 Scott C. Gray
Portions Copyright (C) 2004 Michael Peppler
This is free software with ABSOLUTELY NO WARRANTY
For more information type '\warranty'
1> sp_who
2> go | grep ENV0001182_14391729
0 13 recv sleep LIMITS LIMITS mx1530vm 0 ENV0001182_14391729_1 tempdb AWAITING COMMAND 0
0 19 recv sleep INSTAL INSTAL mx1534vm 0 ENV0001182_14391729 tempdb AWAITING COMMAND 0
0 21 recv sleep INSTAL INSTAL mx1534vm 0 ENV0001182_14391729 tempdb AWAITING COMMAND 0
0 25 recv sleep LIMITS LIMITS mx1530vm 0 ENV0001182_14391729_1 tempdb AWAITING COMMAND 0
0 112 recv sleep LIMITS LIMITS mx1530vm 0 ENV0001182_14391729_1 tempdb AWAITING COMMAND 0
0 114 recv sleep LIMITS LIMITS mx1530vm 0 ENV0001182_14391729_1 tempdb AWAITING COMMAND 0
0 221 recv sleep INSTAL INSTAL mx1530vm 0 ENV0001182_14391729 tempdb AWAITING COMMAND 0
0 270 lock sleep INSTAL INSTAL NULL 0 ENV0001182_14391729 tempdb DROP INDEX 6953
0 271 running sa sa NULL 0 ENV0001182_14391729 tempdb INSERT 0
0 325 recv sleep LIMITS LIMITS mx1530vm 0 ENV0001182_14391729_1 tempdb AWAITING COMMAND 0
1> dbcc traceon(3604)
2> go
DBCC execution completed. If DBCC printed error messages, contact a user with System Administrator (SA) role.
1> dbcc sqltext(270)
2> go
SQL Text: drop index TABLE#DATA#DEALIRD_DBF.WHATEVER
DBCC execution completed. If DBCC printed error messages, contact a user with System Administrator (SA) role.
我已经给了这个查询一整天的时间,而我只是为了确保它不会结束而只是在那里工作。
请注意,我无法使用新表重现它:
1> create table OMX(SOMETHING NUMERIC(2,2))
2> go
1> sp_helpindex OMX
2> go
Object does not have any indexes.
(return status = 1)
1> drop index OMX.WHATEVER
2> go
Msg 3701, Level 11, State 3
Server 'MX1530VM', Line 1
Cannot drop the index 'OMX.WHATEVER', because it doesn't exist in the system catalogs.
有谁知道如何继续我的分析?我检查了sysindexes但没有找到它的条目。我更新了桌面上的所有统计数据,但这没有帮助。
非常感谢!
答案 0 :(得分:2)
您的会话(spid 270)处于“锁定睡眠”状态。这意味着它被另一个会话阻止了。您需要找出导致阻塞的项目被锁定,阻塞会话是什么以及它正在做什么以及它为什么不释放其锁定。它看起来像spid 6953导致阻塞。 以“sp_lock @ verbose = 1”开头,查看哪个锁导致阻塞。