简体   繁体   English

使用ADODB的SQL Server和DMO

[英]SQL Server and DMO using ADODB

I'm maintaining a legacy server app that generate DMO files from SQL Server views. 我正在维护一个从SQL Server视图生成DMO文件的旧版服务器应用程序。

Sometimes the server crashes because SQL Server consumes all cpu resources. 有时服务器崩溃是因为SQL Server消耗了所有cpu资源。

Using the SQL Server monitor I see that the problem is in SQLDMO connections that are consuming all cpu time and blocking the server. 使用SQL Server监视器,我发现问题出在SQLDMO连接上,这些连接正在消耗所有cpu时间并阻塞了服务器。

I don't understand the reason of that because the dmo connection is with TRANSACTION LEVEL READ UNCOMMITTED and these SQLs never finish, during weeks. 我不明白其原因,因为dmo连接与TRANSACTION LEVEL READ UNCOMMITTED一起使用,并且这些SQL在数周内从未完成。 The only solution is to shutdown the server. 唯一的解决方案是关闭服务器。

I would suggest looking into the code why these connections are not closed. 我建议调查一下为什么不关闭这些连接的代码。 I'm guessing there's no proper closing at the end or something along those lines. 我猜最后没有适当的结束或类似的内容。

If that is not an option, you could consider running a scheduled job that kills off these specific jobs every so often if they ran for longer than say, 24 hours. 如果不是这种选择,那么您可以考虑运行排定的作业,如果这些特定作业的运行时间超过24小时,那么这些作业就会被频繁地杀死。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM