解开SQL Server单数据库死锁

今天误触了使某个数据库离线的操作,导致事务在该数据库死锁。该数据库既不能返回在线状态,又无法访问。不想重启整个数据库引擎,于是搜得以下解决方法:

1、查看哪个进程SPID在连接改数据库
EXEC sp_who2

2、杀掉该SPID
Kill

3、将该数据库恢复在线状态

Advertisements

发表评论

Fill in your details below or click an icon to log in:

WordPress.com 徽标

You are commenting using your WordPress.com account. Log Out /  更改 )

Google+ photo

You are commenting using your Google+ account. Log Out /  更改 )

Twitter picture

You are commenting using your Twitter account. Log Out /  更改 )

Facebook photo

You are commenting using your Facebook account. Log Out /  更改 )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d 博主赞过: