欢迎访问 生活随笔!

生活随笔

当前位置: 首页 >

SQL Server,Could not obtain exclusive lock on database 'model'

发布时间:2025/7/14 50 豆豆
生活随笔 收集整理的这篇文章主要介绍了 SQL Server,Could not obtain exclusive lock on database 'model' 小编觉得挺不错的,现在分享给大家,帮大家做个参考.

创建SQL Server 数据库时出现错误“Could not obtain exclusive lock on database 'model'”

尝试以下方法:

1. to try reconnecting to the database.

2. Restarting the service.

3. killing the spid holding the lock.

 

执行以下SQL语句来查询:

select  d.name, resource_type,resource_database_id,request_mode,request_status,request_owner_type,request_type
from sys.databases d inner join sys.dm_tran_locks l
on d.database_id = l.resource_database_id
and l.resource_database_id = 3

 

 

select spid ,PROGRAM_NAME from master..sysprocesses
where DB_NAME(dbid) = 'model'

总结

以上是生活随笔为你收集整理的SQL Server,Could not obtain exclusive lock on database 'model'的全部内容,希望文章能够帮你解决所遇到的问题。

如果觉得生活随笔网站内容还不错,欢迎将生活随笔推荐给好友。