sqlserver实例无法加锁或者多于一个的连接时处理方法

sqlserver实例无法加锁或者多于一个的连接时处理方法,第1张

概述问题: use master; go alter database qcvalues set single_user with rollback immediate; alter database qcvalues set multi_user; go I am getting these errors: Msg 5061, Level 16, State 1, Line 1 ALTER DATA

问题:
use master; go alter database qcvalues set single_user with rollback immediate; set multi_user; go

I am getting these errors:

Msg 5061, Level 16, State 1, line 1 ALTER DATABASE Failed because a lock Could not be placed on database 'qcvalues'. Try again later. Msg 5069,139)">DATABASE statement Failed. Msg 4 DATABASE statement Failed.

解决方案:

After you get the error,run

EXEC sp_who2

Look for the database in the List. It's possible that a connection was not terminated. If you find any connections to the database,139)">KILL <SPID>

where <SPID> is the SPID for the sessions that are connected to the database.

Try your script after all connections to the database are removed.

Unfortunately,I don't have a reason why you're seeing the problem,but here is a link that shows that the problem has occurred elsewhere.

http://www.geakeit.co.uk/2010/12/11/sql-take-offline-fails-alter-database-failed-because-a-lock-could-not-error-5061/

总结

以上是内存溢出为你收集整理的sqlserver实例无法加锁或者多于一个的连接时处理方法全部内容,希望文章能够帮你解决sqlserver实例无法加锁或者多于一个的连接时处理方法所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/sjk/1173811.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-06-02
下一篇 2022-06-02

发表评论

登录后才能评论

评论列表(0条)

保存