SQL Server 很慢很卡?
1、可以试着查找影响数据库性能的SQL语句
SELECT TOP 30 total_worker_time/1000 AS [CPU总耗时(ms)], execution_count [运行次数], qs.total_worker_time/qs.execution_count/1000 AS [CPU平均耗时(ms)], last_execution_time AS [最后执行时间], max_worker_time/1000 AS [最大执行耗时(ms)], SUBSTRING(qt.text,qs.statement_start_offset/2+1, (CASE WHEN qs.statement_end_offset = -1 THEN DATALENGTH(qt.text) ELSE qs.statement_end_offset END -qs.statement_start_offset)/2 + 1) AS [SQL语句] FROM sys.dm_exec_query_stats qs WITH(nolock) CROSS apply sys.dm_exec_sql_text(qs.sql_handle) AS qt WHERE execution_count > 1 ORDER BY max_worker_time DESC
https://blog.csdn.net/u011627218/article/details/127900110
SQL Server数据库阻塞,死锁,排查语句
本文来自博客园,作者:CelonY,转载请注明原文链接:https://www.cnblogs.com/CelonY/p/18408095