??????????????SQL Server???
???????????? ???????[ 2015/11/10 11:02:12 ] ?????????????
????????????????????????????”??????????????SQLServer?????????????????????“???????????????????Щ??????????????????????????
??????SQLServer??
????SQLServer????????????????????????????????????SQLServer?????DMV??DMF??洢??????????????????????????????????????????????DMV/DMF??????????????????????????
????????????????SQLServer?????????????DMV??sys.dm_exec_query_stats????????????????м????SQLServer?洢???????м???????????????????????SQLServer?????????????????CPU????I/O?????????????????SQLServer???й?????????????????????????DMV????
?????????????sys.dm_exec_query_stats??
?????????sys.dm_exec_query_stats???????????SELECT???????????к????е???????????????——?д????????????
????????????????????????????????????м????SQLServer???????ж??????????
????WorkerTime(columns…_?????????)
????PhysicalReads(columns…_?????)
????LogicalWrites(columns…_???д)
????LogicalReads(columns…_?????)
????SQLCLRTime(columns…_???????????????)
????ElapsedTime(columns…_???????)
????RowCount(columns…_????)
?????????????????????4??????????????У?
?????????Totalvalue??
??????????Lastvalue??
????С???Minvalue??
?????????Maxvalue??
??????????????Щ????????????????????????????????????????????????——CPU????I/O????????????????????CPU???????????????в????SQLServer????CPU?????г??5?????????????
????--WorstperformingCPUboundqueries
????SELECTTOP5
????st.text??
????qp.query_plan??
????qs.*
????FROMsys.dm_exec_query_statsqs
????CROSSAPPLYsys.dm_exec_sql_text(qs.plan_handle)st
????CROSSAPPLYsys.dm_exec_query_plan(qs.plan_handle)qp
????ORDERBYtotal_worker_timeDESC
????GO
??????????????????????????ORDERBYtotal_worker_timeDESC??????CPU?????????????????????sys.dm_exec_sql_text??sys.dm_exec_query_planDMF????SQL??????м??????????д?????????????I/O?????????????????????
????--WorstperformingI/Oboundqueries
????SELECTTOP5
????st.text??
????qp.query_plan??
????qs.*
????FROMsys.dm_exec_query_statsqs
????CROSSAPPLYsys.dm_exec_sql_text(qs.plan_handle)st
????CROSSAPPLYsys.dm_exec_query_plan(qs.plan_handle)qp
????ORDERBYtotal_logical_readsDESC
????GO
???????????????SQL??????м?????????????????????????????????CPU??I/O?????
????С??
????SQLServer??????????????????????????????????????????????????????????????????????????????????????DMVsys.dm_exec_query_stats???????????SQLServer??????????м???????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11