Database Management

SQL Sentry Rebuild Counters

This article will guide on how to resolve an error indicating that Performance counters need to rebuilt.

First published date

7/16/2021 4:39 PM

Last published date

7/16/2021 4:39 PM

Overview

If the client receives an error indicating that Performance counters need to be rebuilt they need to make sure that you are able to see the missing Perfmon and follow the steps below. If error still occurs even after reloading the SQL Server counters, it maybe missing Windows counters.

Product section

SQL Sentry (SQLS)

Cause

How to rebuilt Performance Counters.

Resolution

Step-by-step guide: If client receives error indicating that Performance counters need to be rebuilt

  1. Make sure that you’re able to see the missing counters in Perfmon (check locally and remotely from the server hosting the monitoring service)
     
  2. If they’re not there, check the following path in the Registry (regedit.exe) for the “Disable Performance Counter” value: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSSQLSERVER\PerformanceIf you are able to see and load the counters in Perfmon, a restart of the Remote Registry service may resolve the issue. If it doesn't, the counters could be corrupted and you may need to rebuild them
    • If this value is present and is set to 1, change it to 0
    • Restart the Remote Registry service on the target server
    • Restart the SQL Sentry Monitoring service
  3. Open cmd prompt (Run as Administrator) and Change path to the SQLSERVER Binn directory
     
  4. Run “unlodctr MSSQLSERVER” for SSAS use "unlodctr MSSQLServerOLAPService"
     
  5. Run “lodctr perf-MSSQLSERVERsqlctr.ini” (if named instance, use the relevant .ini file from the Binn) For SSAS use " lodctr perf-MSSQLServerOLAPServicemsmdctr.ini"
     
  6. Restart the Remote Registry service
     
  7. Restart the Performance Logs and Alerts service
     
  8. Restart SQL Sentry Monitoring service

If you continue to have issues even after reloading the SQL Server counters, particularly missing Windows counters, follow the below steps to troubleshoot and rebuild the entire performance counter library.

  1. Make sure that you’re able to see the missing counters in Perfmon (check locally and remotely from the server hosting the monitoring service)
  2. If they’re not there, and the SQL Sentry client mentions the Physical Disk counter specifically, check the following path in the Registry (regedit.exe) for the “Disable Performance Counter” value: HKEY_LOCAL_MACHINE/System/CurrentControlSet/Services/PerfDisk/PerformanceIf you are able to see and load the counters in Perfmon, a restart of the Remote Registry service may resolve the issue. If it doesn't, the counters could be corrupted and you may need to rebuild them using the following steps:
    • If this value is present and is set to 1, change it to 0
    • Restart the Remote Registry service on the target server
    • Restart the SQL Sentry Monitoring service
  3. Open cmd prompt (Run as Administrator)
  4. Change path to: \windows\system32
  5. Run command: lodctr /R
    • Once complete, restart the Remote Registry service and the SQL Sentry Monitoring Service