performance counters in SQL Server

Miiimy7 41 Reputation points
2021-03-31T15:18:08.577+00:00

Hello!

i want to monitor SQL Server in SQL Server (without using Perfmon), so i'll be using sys.dm_os_performance_counters. There's a lot of counters returned by this DMV.

First problem is i don't know which one are important.
Second problem is i don't know if it is enough to monitor SQL Server (SQL Server system included: CPU, Network, System,Disk,Memory,etc.) or do i need other DMVs
Third problem is : by listing counters in one CTE, i don't know what values to put on instance name.

Can you guys help me?
Thanks

Azure SQL Database
Developer technologies Transact-SQL
SQL Server Other
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Tom Phillips 17,771 Reputation points
    2021-03-31T16:03:36.267+00:00

  2. Olaf Helper 47,436 Reputation points
    2021-04-01T05:40:42.257+00:00

    But i want to add other counters ... I also want to monitor SQL Server OS... Process, processor, system, logicaldisk, network from SQL Server.

    SQL Server knows only it's own performance counter, not others.
    How could be SQL Server aware of e.g. Exchange Server performance counter?

    Use PerfMon or other tools to monitor performance counter.


  3. CathyJi-MSFT 22,396 Reputation points Microsoft External Staff
    2021-04-01T06:25:26.503+00:00

    Hi @Miiimy7 ,

    You can use sys.dm_os_performance_counters DMV collect counter information that you would receive from PerfMon for the various SQL Server counters. Let me stress that: this is for the various SQL Server counters. You will not be able to receive counter information from outside the SQL Server stack from this DMV. However for a quick and simple query to return information about your SQL Server instance's performance this is a great tool.

    Refer to the blog SQL Server Performance Counter DMV sys.dm_os_performance_counters to get more information.

    As Olaf mentioned, performance monitor is a better tool for your requirement.


    If the response is helpful, please click "Accept Answer" and upvote it, thank you.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.