14.04.2013 Views

SQL SERVER 2008

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

<strong>SQL</strong> Server Builds ❘ 409<br />

Making the effort to watch for <strong>SQL</strong> Server service packs and cumulative updates, checking the<br />

fi x list, downloading them, testing them, and deploying them in your production environment is a<br />

benefi cial exercise for you and your organization. Deploying these updates using a planned, rolling<br />

upgrade strategy enables you to complete the deployments with minimal service interruptions, and<br />

it forces you to exercise some of your high-availability (HA), disaster-recovery (DR) infrastructure<br />

while keeping your servers up to date. I think this is much better than being a DBA who is overly<br />

hesitant to apply any <strong>SQL</strong> Server updates because you are afraid you might break something.<br />

The next query you want to run, shown in Listing 15-3, will give you a little more information<br />

about your operating system on the database server, including the language.<br />

LISTING 15-3: Windows information<br />

-- Windows information (<strong>SQL</strong> Server 2012)<br />

SELECT windows_release, windows_service_pack_level,<br />

windows_sku, os_language_version<br />

FROM sys.dm_os_windows_info WITH (NOLOCK) OPTION (RECOMPILE);<br />

-- Gives you major OS version, Service Pack, Edition,<br />

-- and language info for the operating system<br />

The preceding query simply gives you a little more specifi c information about the operating system,<br />

in a form that is easier to fi lter and parse than what you get from SELECT @@VERSION. Now that you<br />

know more about your operating system, you can start to gather some hardware information.<br />

The query shown in Listing 15-4 indicates how many logical processors you have, the hyperthread<br />

ratio of the processors, how many physical CPUs you have, and how much physical memory you<br />

have in your database server. It also indicates whether you are running in a virtual machine and<br />

when <strong>SQL</strong> Server was last started. Unfortunately, the hyperthread ratio does not distinguish<br />

between logical and physical cores in each physical processor. For example, the laptop used to write<br />

this chapter on is a dual-core processor with hyperthreading, and the hyperthread ratio is 4. If my<br />

laptop were a quad-core without hyperthreading, my hyperthread ratio would also be 4. Especially<br />

with the new, core-based licensing in <strong>SQL</strong> Server 2012 Enterprise Edition, it is important to distinguish<br />

between true physical cores and logical cores. Fortunately, the next two queries will help clear<br />

up this confusion.<br />

LISTING 15-4: Hardware information<br />

-- Hardware information from <strong>SQL</strong> Server 2012 (new virtual_machine_type_desc)<br />

-- (Cannot distinguish between HT and multi-core)<br />

SELECT cpu_count AS [Logical CPU Count], hyperthread_ratio AS [Hyperthread<br />

Ratio],cpu_count/hyperthread_ratio AS [Physical CPU Count],<br />

physical_memory_kb/1024 AS [Physical Memory (MB)],<br />

affinity_type_desc, virtual_machine_type_desc, sqlserver_start_time<br />

FROM sys.dm_os_sys_info WITH (NOLOCK) OPTION (RECOMPILE);<br />

-- Gives you some good basic hardware information about your database server

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!