Microsoft SQL Server 2005 经常CPU100%吃紧解决(GG出来的)

本文记录了一次解决SQL Server 2005在没有外部连接的情况下占用100% CPU的问题经历。通过排查发现是Service Broker导致的问题,并提供了具体的解决步骤。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

原文连接:Oringial hyperlink Texture page:
http://geekswithblogs.net/kobush/archive/2008/09/16/125204.aspx

 

转载:
Some time ago I got very strange situation on my development SQL Server 2005. Immediately after starting the process it went up to 100% CPU and stayed there for hours. There were no external connections, and I couldn't figure out what was causing this so I asked for help our best SQL geek Paweł Potasiński. With his help we were able to figure out that this was caused by service broker running on one of the databases although we didn't find the root cause for this.

Fast forward few months, and last week I got into the same trouble after upgrading the database. Of course I didn't recall how exactly we fixed it last time. So today I had to gave up and ask for Paweł's help again. I wrote this post mostly because I don't want to bother him again on this.

So first you use this to see which databases have service broker enabled:

SELECT * FROM sys.databases WHERE is_broker_enabled = 1
Then you can use ALTER TABLE ... SET DISABLE_BROKER but this would only work

when database is not locked. Therefore the best way to do this is like this:

ALTER DATABASE ... SET SINGLE_USER WITH ROLLLBACK IMMEDIATE
GO
ALTER DATABASE ... SET DISABLE_BROKER
GO
ALTER DATABASE ... SET MULTI_USER
GO

Note that this will kick off all users connected to this database.

Thanks for help Paweł - I owe you one more time :-)

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值