Creating a custom Data Collector Set with SQL x86 counters on an x64 OS

In one of our recent CSS cases, we noticed a strange difference between the Windows Small Business Server (SBS) 2008 x64 and Windows Server 2008 x64. One could create a Data Collector Set (DCS) with SQL Server x86 counters, collect and view the samples just fine on the SBS 2008 x64, out of the box. However, on Windows Server 2008 x64 this proved to be not possible.

This workaround will be provided “as-is” , with no support whatsoever or liability from Microsoft. For use in a productive environment, we recommend you to install the x64 version of SQL Server especially when running on a x64 OS.

First let’s take a look at the two scenarios:

Windows SBS 2008 x64 with SQL Server 2005 SP2 x86 installed by default

- You can see that by default, there are two SQL Server processes running, one 64bit the other 32bit.
clip_image002

- The x64 Process is running from this directory:
clip_image004

- The x86 process is running from here:
clip_image006

- You can see here the two Services associated with the two SQL Processes:
clip_image008
The x86 service is MSSQL$SBSMONITORING and the x64 service is MSSQL$MICROSOFT##SSEE

- The SQL Performance counters are stored in a DLL called sqlctr90.dll.
Here you see that on a SBS 2008 server, there are two DLLs installed by default: one 32bit in c:\windows\syswow64 and 64bit in c:\windows\system32
clip_image010

Windows Server 2008 SP2 x64 with SQL Server 2005 SP3 x86

- You see that there is only one 32bit SQL Server process running (no 64bit process running like on SBS 2008)
clip_image012

- We see here the file location of the running process:
clip_image014

- We see only one SQL Service running, named after the test instance I created on the virtual machine (TEST32)
clip_image016

- If we search now for the sqlctr90.dll, we only see one file: the 32bit version in c:\windows\syswow64

The workaround is to simply copy the 64bit version of “sqlctr90.dll” from another machine running a x64 SQL instance, to the “c:\windows\system32” directory of the Server 2008 x64 OS machine running SQL Server 2005 x86. We recommend using the DLL from similar SP levels of SQL Server (SP3 since SP2 is actually not supported any more!)

Once you copy the DLL, you can proceed with creating a custom DCS with SQL Server 32bit counters:

1. Choose a name for the DCS and select “create manually (advanced)”

clip_image001

2. Choose “Performance counter” and click “Next”

clip_image002[4]

3. Choose any SQL related counters (here you see General Statistics for example):

clip_image003

4. Here you select the location, wrap up the DCS creation and start the collection.
After a chosen amount of time, you can stop the collection.

clip_image004[4]

clip_image005

5. To view the counters, in Perfmon you select and open the created BLG file of the custom DCS

clip_image006[4]

6. You now select which objects you would like to see displayed:

clip_image007

7. As you can see, sample collection works fine.

clip_image008[4]

As always, i hope you find this post useful and feel free to rate it or drop some comments, we love to hear back from you!

Bogdan Palos
- Technical Lead / Enterprise Platforms Support (Core)