SqlServer性能监控指标(部分)

更新时间:2023-07-26 20:19:11 阅读: 评论:0

SqlServer性能监控指标(部分)
以下内容,有些细节字段后续再丰富,⽬前只是供⾃⼰整理
1.SqlServer已获得的页⾯数(缓冲池)
SELECT
cntr_value
FROM
sys.dm_os_performance_counters
WHERE
object_name = 'SQLServer:Buffer Manager'
AND counter_name = 'Databa pages'
2.SqlServer缓冲池必须的理想页⾯数
SELECT
cntr_value
FROM
sys.dm_os_performance_counters
WHERE
object_name = 'SQLServer:Buffer Manager'
AND counter_name = 'Target pages'
3.数据页在缓冲池中驻留的时间,这个时间⼀般会⼤于 300 单位 s
如何与同学相处SELECT
cntr_value
FROM
sys.dm_os_performance_counters
WHERE
object_name = 'SQLServer:Buffer Manager'
AND counter_name = 'Page life expectancy'
4.数据库缓冲池⾼速缓冲命中率,被请求的数据在缓冲池中被找到的概率,⼀般会⼤于  98%  才算正常,否则可能是缓冲池容量太⼩
SELECT
cntr_value
FROM
sys.dm_os_performance_counters
WHERE
object_name = 'SQLServer:Buffer Manager'
AND counter_name = 'Buffer cache hit ratio'
5.检查点每秒写⼊磁盘的脏页个数,如果数据过⾼,证明缺少内存容量
SELECT
cntr_value
FROM
sys.dm_os_performance_counters
WHERE
object_name = 'SQLServer:Buffer Manager'
AND counter_name = 'Checkpoint pages/c'
6.缓存池中每秒读写的页数
cntr_value
FROM
sys.dm_os_performance_counters
WHERE
object_name = 'SQLServer:Buffer Manager'
AND counter_name = 'Page reads/c';
SELECT
cntr_value
FROM
sys.dm_os_performance_counters
WHERE
object_name = 'SQLServer:Buffer Manager'
AND counter_name = 'Page writes/c'
7.每秒全表扫描次数
SELECT
*
FROM
sys.dm_os_performance_counters
WHERE
object_name = 'SQLServer:Access Methods'
大头陈AND counter_name = 'Full Scans/c'
8.每秒页⾯拆分次数
SELECT
*
FROM
sys.dm_os_performance_counters
WHERE
object_name = 'SQLServer:Access Methods'
AND counter_name = 'Page Splits/c'
9.等待内存授权的进程队列
SELECT
*
FROM
sys.dm_os_performance_counters
WHERE
object_name = 'SQLServer:Memory Manager'
AND counter_name = 'Memory Grants Pending' 10.每秒创建临时表和临时变量的数量
SELECT
*
FROM
sys.dm_os_performance_counters
WHERE
object_name = 'SQLServer:General Statistics'
AND counter_name = 'Temp Tables Creation Rate' 11.正在等待销毁的临时表的数量
*
象棋棋盘图
FROM
sys.dm_os_performance_counters
骑士精神歌词
WHERE
object_name = 'SQLServer:General Statistics'
AND counter_name = 'Temp Tables For Destruction' 12.每秒批处理请求次数
SELECT
*
FROM
sys.dm_os_performance_counters
WHERE
object_name = 'SQLServer:SQL Statistics'
AND counter_name = 'Batch Requests/c'
13.每秒锁等待数⽬
SELECT
cntr_value
FROM
sys.dm_os_performance_counters
WHERE
object_name = 'SQLServer:Locks'
AND instance_name = '_Total'
AND counter_name = 'Lock Waits/Sec'
14.缓存池中的页寿命
SELECT
cntr_value
FROM
sys.dm_os_performance_counters
WHERE
object_name = 'SQLServer:Buffer Manager'
AND counter_name = 'Page life expectancy'
15.数据库剩余空间
小学运动会入场解说词
SELECT
*
FROM
master.sys.sysperfinfo
WHERE
object_name = 'SQLServer:Memory Manager'
AND counter_name = 'Free Memory (KB)'
重复抵押16.当前已连接的会话数
cntr_value
FROM
sys.dm_os_performance_counters
WHERE
object_name = 'SQLServer:General Statistics'
AND counter_name = 'Ur Connections'
17.数据库服务启动的时间
SELECT
sqlrver_start_time AS start_time
FROM
sys.dm_os_sys_info
18.每秒编译执⾏数量
SELECT
cntr_value
FROM
sys.dm_os_performance_counters
WHERE
object_name = 'SQLServer:SQL Statistics'
AND counter_name = 'SQL Compilations/Sec'
19.服务总内存
SELECT
*,
九死还魂草的功效
CAST (
cntr_value / 1024.0 AS DECIMAL ( 20, 1 )) MemoryMB FROM
master.sys.sysperfinfo
WHERE
counter_name = 'Total Server Memory (KB)'
20.每秒重编译数量
SELECT
cntr_value
FROM
sys.dm_os_performance_counters
WHERE
object_name = 'SQLServer:SQL Statistics'
AND counter_name = 'SQL Re-Compilations/Sec'
21.缓冲池中每秒懒写⼊的个数
SELECT
cntr_value
FROM
sys.dm_os_performance_counters
WHERE
object_name = 'SQLServer:Buffer Manager'
AND counter_name = 'Lazy writes/c';
22.锁平均等待时间
SELECT
*
FROM
sys.dm_os_performance_counters
WHERE
object_name = 'SQLServer:Wait Statistics'
23.进程在队列中等待内存锁花费的时间
SELECT
*
FROM
sys.dm_os_performance_counters
WHERE
object_name = 'SQLServer:Wait Statistics' and
counter_name = 'Memory grant queue waits'
and instance_name = 'Average wait time (ms)'
24.计划缓冲区中不同缓冲池的命中率
SELECT
instance_name,
形容漂亮的成语round(
CAST ( SUM ( CASE WHEN counter_name = 'Cache Hit Ratio' THEN cntr_value ELSE 0 END ) AS DECIMAL ( 38, 16 ) ) / SUM ( CASE WHEN counter_name = 'C  2
) AS b
FROM
sys.dm_os_performance_counters
WHERE
object_name = 'SQLServer:Plan Cache'
GROUP BY
instance_name
HAVING
SUM ( CASE WHEN counter_name = 'Cache Hit Ratio Ba' THEN cntr_value ELSE 0 END ) <>0
25.当前数据库⾼消耗的SQL

本文发布于:2023-07-26 20:19:11,感谢您对本站的认可!

本文链接:https://www.wtabcd.cn/fanwen/fan/89/1097809.html

版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。

标签:缓冲   时间   数据库   内存   次数   数据   请求
相关文章
留言与评论(共有 0 条评论)
   
验证码:
推荐文章
排行榜
Copyright ©2019-2022 Comsenz Inc.Powered by © 专利检索| 网站地图