SQL Server Performance Counter are Missing

Published Mar 22 2021 07:53 PM 2,202 Views
Microsoft

If you find the SQL Server related performance counter objects are missing, you can try below steps to get it back

 

For example, my instance name is STD2016, and now open the command window with Administrator

 

1. Unload the counters. 

  a. Open Command Prompt

  b. Change directory (cd) to the \Binn folder of your instance, by default, the folder path should be

  C:\Program Files\Microsoft SQL Server\MSSQLXX.INSTANCENAME\MSSQL\Binn

  c. And then run unlodctr command, if you are using the default instance, just use:

 

unlodctr MSSQLSERVER

 

For me,  it is unlodctr MSSQL$STD2016, the format is MSSQL$INSTANCENAME

YueJ_7_0-1616467375739.png

 

2. Load the perfmon counters. 

  a. Under the \Binn folder you will see a file that begins with "perf-MSSQL$", the name format is perf-MSSQL$INSTANCENAMEsqlctr.ini.

  b. Run the following command to load the counters for a default SQL instance:

 

lodctr perf-MSSQLSERVERsqlctr.ini

 

In my case I was using a named instance:

 

lodctr perf-MSSQL$STD2016sqlctr.ini

 

YueJ_7_1-1616467605075.png

3. Restart the remote registry key service

 

NET STOP "Remote Registry" & NET START "Remote Registry"

 

YueJ_7_2-1616467694450.png

4. Close Performance Monitor and open it again, you will be able to see the counters:

 

YueJ_7_3-1616467735719.png

 

%3CLINGO-SUB%20id%3D%22lingo-sub-2228914%22%20slang%3D%22en-US%22%3ESQL%20Server%20Performance%20Counter%20are%20Missing%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2228914%22%20slang%3D%22en-US%22%3E%3CP%3EIf%20you%20find%20the%20SQL%20Server%20related%20performance%20counter%20objects%20are%20missing%2C%20you%20can%20try%20below%20steps%20to%20get%20it%20back%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EFor%20example%2C%20my%20instance%20name%20is%20STD2016%2C%20and%20now%20open%20the%20command%20window%20with%20Administrator%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E1.%20unload%20the%20counter.%26nbsp%3B%20cd%20to%20the%20Binn%20folder%20of%20your%20instance%2C%20by%20default%2C%20the%20folder%20path%20should%20be%3C%2FP%3E%0A%3CP%3EC%3A%5CProgram%20Files%5CMicrosoft%20SQL%20Server%5CMSSQL%3CSTRONG%3EXX%3C%2FSTRONG%3E.%3CSTRONG%3EINSTANCENAME%3C%2FSTRONG%3E%5CMSSQL%5CBinn%3C%2FP%3E%0A%3CP%3EAnd%20then%20run%20unlodctr%20command%2C%20if%20you%20are%20using%20the%20default%20instance%2C%20just%20use%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%230000FF%22%3Eunlodctr%20MSSQLSERVER%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3EFor%20me%2C%26nbsp%3B%20it%20is%20%3CFONT%20color%3D%22%230000FF%22%3Eunlodctr%20MSSQL%24STD2016%3C%2FFONT%3E%2C%20the%20format%20is%20MSSQL%24INSTANCENAME%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22YueJ_7_0-1616467375739.png%22%20style%3D%22width%3A%20415px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F266224i15DB48448B6C8352%2Fimage-dimensions%2F415x81%3Fv%3Dv2%22%20width%3D%22415%22%20height%3D%2281%22%20role%3D%22button%22%20title%3D%22YueJ_7_0-1616467375739.png%22%20alt%3D%22YueJ_7_0-1616467375739.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E2.%20Load%20the%20counter.%26nbsp%3B%20Under%20the%20Binn%20folder%20you%20will%20see%20a%20file%20begins%20with%20%22perf-MSSQL%24%22%2C%20the%20name%20format%20is%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%230000FF%22%3Eperf-MSSQL%24INSTANCENAMEsqlctr.ini.%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3EFor%20default%20instance%2C%20use%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%230000FF%22%3Elodctr%26nbsp%3Bperf-MSSQLSERVERsqlctr.ini%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3EFor%20mine%2C%20it%20is%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%230000FF%22%3Elodctr%20perf-MSSQL%24STD2016sqlctr.ini%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22YueJ_7_1-1616467605075.png%22%20style%3D%22width%3A%20462px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F266225i3E021397E35C3343%2Fimage-dimensions%2F462x15%3Fv%3Dv2%22%20width%3D%22462%22%20height%3D%2215%22%20role%3D%22button%22%20title%3D%22YueJ_7_1-1616467605075.png%22%20alt%3D%22YueJ_7_1-1616467605075.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E3.%20Restart%20the%20remote%20registry%20key%20service%3C%2FP%3E%0A%3CP%3E%3CFONT%20color%3D%22%230000FF%22%3ENET%20STOP%20%22Remote%20Registry%22%20%26amp%3B%20NET%20START%20%22Remote%20Registry%22%3C%2FFONT%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22YueJ_7_2-1616467694450.png%22%20style%3D%22width%3A%20441px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F266226i6B94CE06478EBE41%2Fimage-dimensions%2F441x54%3Fv%3Dv2%22%20width%3D%22441%22%20height%3D%2254%22%20role%3D%22button%22%20title%3D%22YueJ_7_2-1616467694450.png%22%20alt%3D%22YueJ_7_2-1616467694450.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E4.%20Close%20the%20performance%20counter%20and%20open%20it%20again%2C%20you%20will%20be%20able%20to%20see%20it%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22YueJ_7_3-1616467735719.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F266227i775F35EA5CAE951E%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22YueJ_7_3-1616467735719.png%22%20alt%3D%22YueJ_7_3-1616467735719.png%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E
Co-Authors
Version history
Last update:
‎Apr 15 2021 09:50 AM
Updated by: