HiveBrain v1.2.0
Get Started
← Back to all entries
snippetsqlMinor

How to revive SQL Server 2008 R2 performance counters?

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
counters2008sqlreviveperformancehowserver

Problem

I'm running SQL Server 2008 R2 Developer on Windows 7 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 Server 2008 R2?

Solution

Read through this:

Link

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.

Code Snippets

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

Context

StackExchange Database Administrators Q#13733, answer score: 4

Revisions (0)

No revisions yet.