LiCongMingDeShujuku / Get-Number-Of-Cores-In-SQL-Server

获取SQL Server中的内核数量

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

CLEVER DATA GIT REPO

获取SQL Server中的内核数量

Get Number Of Cores In SQL Server

发布-日期: 2016年10月18日 (评论)

Contents

中文

你有时需要访问许可证,为此,你需要针对sys.dm_os_sys_info运行一些查询,以便获取SQL Server的核心数量。

如果你想要sys.dm_os_sys_info上的所有信息,请访问:https:/msdn.microsoft.com/en-us/library/ms175048(v = sql.110).aspx

这里有一些快速的SQL逻辑可以帮助你入门。

English

From time to time you’ll need to visit your license costs, and to do so you’ll need to run some queries against sys.dm_os_sys_info so you can get the number of cores for SQL Server. If you want all the dirt on sys.dm_os_sys_info just go here: https://msdn.microsoft.com/en-us/library/ms175048(v=sql.110).aspx Here’s some quick SQL Logic to get you started.

#


Logic

use master;
set nocount on
select
     'physical_cpu' = cpu_count / hyperthread_ratio
,    'cores' =
         case
            when hyperthread_ratio = cpu_count then cpu_count
            else (cpu_count / hyperthread_ratio) * ((cpu_count - hyperthread_ratio) / (cpu_count / hyperthread_ratio))
         end
,     'logical_cpu' =
          case
             when hyperthread_ratio = cpu_count then cpu_count
          else ((cpu_count - hyperthread_ratio) / (cpu_count / hyperthread_ratio))
       end
from
    master.sys.dm_os_sys_info

当然,如果你对逻辑感到好奇,并且需要一种简单的方法来验证可以使用性能监视器快速浏览一下的话,只需右键单击任务栏,然后单击“任务管理器”。查看右下角,你将看到核心数和逻辑处理器数。

Of course; if you’re curious about the logic, and need a simple way to verify you can always get a quick glance from basically using performance monitor. Just right-click the task-bar, and click ‘Task Manager’. If you look at the lower right you’ll see the number of cores and the number of logical processors.

#

WorksEveryTime

Build-Info

Build Quality Build History
Build-Status
Coverage
Nuget
Build history

Author

  • 李聪明的数据库 Lee's Clever Data
  • Mike的数据库宝典 Mikes Database Collection
  • 李聪明的数据库 "Lee Songming"

Gist Twitter Wordpress


License

LicenseCCSA

Lee Songming

About

获取SQL Server中的内核数量


Languages

Language:TSQL 100.0%