SELECT cpu_count AS [Logical CPUs], hyperthread_ratio AS [Logical vs Physical cores Ratio], physical_memory_kb/1024 AS [Physical Memory in MB], committed_kb/1024 AS [Committed Memory in MB], committed_target_kb/1024 AS [Committed Target Memory in MB], max_workers_count AS [Max Workers Count], sqlserver_start_time AS [SQL Server Start Time], virtual_machine_type_desc AS [Virtual Machine] FROM sys.dm_os_sys_info WITH (NOLOCK) OPTION (RECOMPILE);
The sys.dm_os_sys_info is available since SQL Server 2005 and contains information about server resources. For eg: you can find out the following:
- How many CPUs are there in the server
- Total logical processors
- Amount of physical memory available (physical_memory_kb - SQL Server 2012 onwards)
- Amount of Virtual memory available (virtual_memory_kb - SQL Server 2012 onwards)
- Last Date and time SQL Server service was started
- Virtual Machine Type description (not reliable) (virtual_machine_type_desc – SQL 2008 R2 onwards)
The sqlserver_start_time is useful to find since what date and time SQL Server has been running.
When I run the query on my machine, this is what I get:
No comments:
Post a Comment