Sqlserver数据库用户访问属性(单用户模式)

来源:互联网 发布:bp网络和神经网络区别 编辑:程序博客网 时间:2024/05/01 00:14

 由于restore msdb的时候需要把原有的msdb的Restrict Access设置为SINGLE_USER。

今天在公司把msdb设置为SINGLE_USER后,发现不能查看服务器上的任何数据库。提示如下信息:s

 

把Restrict Access修改为MULTI_USER的时候也提示报错:

  

Msg 5064, Level 16, State 1, Line 1
Changes to the state or options of database ''msdb'' cannot be made at this time. The database is in single-user mode, and a user is currently connected to it.
Msg 5069, Level 16, State 1, Line 1
ALTER DATABASE statement failed.

 

根据提示信息运行如下命令查看MSDB上有哪些连接:

 

 如上图,发现有55号进程是连接到msdb的,于是把该进程Kill掉,然后再设置为MULTI_USER OK。可以显示数据库。

原创粉丝点击