A server has just lost all the SQL Server PerfMon counters. They’ve all disappeared into thin air. It plays havoc with our monitoring tool! We’ve had a couple of instances of this lately. I haven’t found the cause and it’s starting to get on my nerves. Luckily the answer is fairly simple once you know. NB: This involves restarting the SQL Server service so you might want to do it out of hours.
The steps are:
- Run cmd.exe as Administrator.
- Go to the Binn directory. On my SQL 2014 instance this was
cd C:\Program Files\Microsoft SQL Server\MSSQL12.MSSQLSERVER\MSSQL\Binn.
unlodctr MSSQLSERVER$INSTANCENAMEfor a named instance).
lodctr perf-MSSQLSERVER$INSTANCENAMEsqlctr.inifor a named instance).
- Restart the Remote Registry service if running.
- Restart the Performance Logs & Alerts service if running.
- Restart the SQL Server service.
There are some other strange things that can happen: Remote Registry service stopped, all PerfMon counters – or just SQL counters – disabled in the Registry.