今天早上,一对数据库在单用户模式下运行时出错.由于以下错误,我无法做任何事情:(
Msg 1205,Level 13,State 68,Line 1 Transaction (Process ID 62) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
ALTER DATABASE dbname SET MULTI_USER; GO
为了它,我尝试重新启动sql Server,我尝试杀死任何进程,我甚至尝试自己重置单个用户:
ALTER DATABASE dbname SET SINGLE_USER WITH ROLLBACK IMMEDIATE; GO
正在运行的作业旨在复制数据库并立即将其置于单用户模式以尝试使其更快.
无论如何我可以删除锁?
解决方法
有同样的问题.这对我有用:
set deadlock_priority high; -- could also try "10" instead of "high" (5) alter database dbname set multi_user; -- can also add "with rollback immediate"
从想法/解释:
http://myadventuresincoding.wordpress.com/2014/03/06…
http://www.sqlservercentral.com/blogs/pearlknows/2014/04/07/…