Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I'm running SQL Server 2008R2 Developer on W7 x64, as the default instance. For some reason, SQL Server's performance counters seem to have disappeared. SELECT * FROM sys.dm_os_performance_counters returns zero rows.

I tried running lodctr /T:perf-MSSQLSERVERsqlctr.ini. Although it completed without errors, it didn't fix anything, even after restarting the Remote Registry service. In fact, the counters are now missing from perfmon. unlodctr MSSQLSERVER still says that the counters are not installed, but lodctr /Q:MSSQLSERVER says they're present and enabled. Regular Windows and .NET counters are working fine.

In the Windows Error log, I'm seeing Error 8317:

Cannot query value 'First Counter' associated with registry key 'HKLM\SYSTEM\CurrentControlSet\Services\MSSQLSERVER\Performance'. SQL Server performance counters are disabled.

I suspect the problem may have been triggered by an installation of SQL 2012 RC0 that failed. Any suggestions for how to recover, short of reinstalling SQL 2008R2?

share|improve this question

migrated from serverfault.com Feb 23 '12 at 8:09

This question came from our site for professional system and network administrators.

    
You mean "Visual Studio 11" (not "2011"?) –  gbn Feb 23 '12 at 7:58
    
Yes, VS 11. The problem with the question on serverfault is that none of the posted answers resolved the issue. I'm hoping DBA-oriented users might be able to provide more useful help. –  RickNZ Feb 23 '12 at 8:11
add comment

4 Answers 4

Have a try with lodctr /R, it will rebuild all performance counters from informations stored in registry.

share|improve this answer
    
In my case there were more counters missing, not only SQL Server's. lodctr /R did the trick and restored them all. Thank you very much for the trick. –  Endrju Sep 13 '13 at 18:44
add comment

Read through this:

http://blogs.msdn.com/b/psssql/archive/2009/03/03/troubleshooting-sql-server-2005-2008-performance-counter-collection-problems.aspx

The exact instructions are not 100% correct. You need to do this, assuming you are using the default instance:

unlodctr MSSQLSERVER
lodctr perf-MSSQLSERVERsqlperf.ini
lodctr /T:MSSQLSERVER

Then reboot.

share|improve this answer
add comment

Missing performance counters is recurring issue.

Some known solutions are listed here: http://blogs.msdn.com/b/varund/archive/2010/06/25/sql-server-missing-performance-counters-a-consolidated-list-of-known-issues.aspx

share|improve this answer
add comment

It looks like the Performance Counters for SQL Server are DISABLED or the registry entries for the performance counters are corrupted.

lodctr /E:MSSQLSERVER will reload the performance counter registry settings.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.