您当前的位置:首页 > sqlserver数据库 > 文章详情

SQL SERVER查看CPU,磁盘IO,内存占用大的SQL语句

2020-02-085481人围观
1.SQL SERVER查看CPU,磁盘IO,内存占用大的SQL语句

select spid,cmd,cpu,physical_io,memusage,(select top 1 [text] from ::fn_get_sql(sql_handle)) sql_text from master..sysprocesses order by cpu desc,physical_io desc




2.查看缓存重用次数少,内存占用大的SQL语句
SELECT TOP 100 usecounts, objtype, p.size_in_bytes,[sql].[text] FROM sys.dm_exec_cached_plans p OUTER APPLY sys.dm_exec_sql_text (p.plan_handle) sql ORDER BY usecounts,p.size_in_bytes  desc

文章评论

热门评论
暂无评论