使用内存优化表的要求Requirements for Using Memory-Optimized Tables

适用对象:是SQL Server 否Azure SQL 数据库 否Azure Synapse Analytics (SQL DW) 否并行数据仓库APPLIES TO: yesSQL Server noAzure SQL Database noAzure Synapse Analytics (SQL DW) noParallel Data Warehouse

若要了解如何在 Azure DB 中使用内存中 OLTP,请参阅 Get started with In-Memory in SQL Database(在 SQL 数据库中使用内存中功能入门)。For using In-Memory OLTP in Azure DB see Get started with In-Memory in SQL Database.

除了需要满足 安装 SQL Server 的硬件和软件要求外,还要满足以下使用内存中 OLTP 的要求:In addition to the Hardware and Software Requirements for Installing SQL Server, the following are requirements to use In-Memory OLTP:

  • 任何版本的 SQL Server 2016 (13.x)SQL Server 2016 (13.x) SP1(或更高版本)。SQL Server 2016 (13.x)SQL Server 2016 (13.x) SP1 (or later), any edition. 对于 SQL Server 2014 (12.x)SQL Server 2014 (12.x)SQL Server 2016 (13.x)SQL Server 2016 (13.x) RTM(SP1 预览版),需要 Enterprise、Developer 或 Evaluation 版。For SQL Server 2014 (12.x)SQL Server 2014 (12.x) and SQL Server 2016 (13.x)SQL Server 2016 (13.x) RTM (pre-SP1) you need Enterprise, Developer, or Evaluation edition.

    备注

    内存中 OLTP 要求 64 位版本的 SQL ServerSQL ServerIn-Memory OLTP requires the 64-bit version of SQL ServerSQL Server.

  • SQL ServerSQL Server 需要有足够的内存来保留内存优化表和索引中的数据,以及额外的内存来支持联机工作负荷。needs enough memory to hold the data in memory-optimized tables and indexes, as well as additional memory to support the online workload. 有关详细信息,请参阅 估算内存优化表的内存需求See Estimate Memory Requirements for Memory-Optimized Tables for more information.

  • 在虚拟机 (VM) 中运行 SQL ServerSQL Server 时,请确保有足够的内存分配给 VM 以提供内存优化表和索引所需的内存。When running SQL ServerSQL Server in a Virtual Machine (VM), ensure there is enough memory allocated to the VM to support the memory needed for memory-optimized tables and indexes. 用于保证 VM 内存分配的配置选项可称为“内存预留”或“最小 RAM”(使用动态内存时),具体取决于 VM 主机应用程序。Depending on the VM host application, the configuration option to guarantee memory allocation for the VM could be called Memory Reservation or, when using Dynamic Memory, Minimum RAM. 请确保这些设置足以满足 SQL ServerSQL Server中的数据库需求。Make sure these settings are sufficient for the needs of the databases in SQL ServerSQL Server.

  • 可用磁盘空间需为你的持久内存优化表大小的两倍。Free disk space that is two times the size of your durable memory-optimized tables.

  • 处理器必须支持指令 cmpxchg16b 才能使用内存中 OLTP。A processor needs to support the instruction cmpxchg16b to use In-Memory OLTP. 所有新式 64 位处理器都支持 cmpxchg16bAll modern 64-bit processors support cmpxchg16b.

    如果你使用的是虚拟机,并且 SQL ServerSQL Server 显示因处理器较旧而生成的错误消息,请检查虚拟机主机应用程序是否将配置选项设置为允许使用 cmpxchg16bIf you are using a Virtual Machine and SQL ServerSQL Server displays an error caused by an older processor, see if the VM host application has a configuration option to allow cmpxchg16b. 如果没有设置,你可以使用支持 cmpxchg16b 的 Hyper-V,而无需修改配置选项。If not, you could use Hyper-V, which supports cmpxchg16b without needing to modify a configuration option.

  • 内存中 OLTP 作为 数据库引擎服务的一部分进行安装。In-Memory OLTP is installed as part of Database Engine Services.

    要安装报表生成(确定表或存储过程是否应移植到内存中 OLTP)和 SQL Server Management StudioSQL Server Management Studio(通过 SQL Server Management StudioSQL Server Management Studio 对象资源管理器管理内存中 OLTP),请下载 SQL Server Management Studio (SSMS)To install report generation (Determining if a Table or Stored Procedure Should Be Ported to In-Memory OLTP) and SQL Server Management StudioSQL Server Management Studio (to manage In-Memory OLTP via SQL Server Management StudioSQL Server Management Studio Object Explorer), download SQL Server Management Studio (SSMS).

有关使用 内存中 OLTPIn-Memory OLTP 的重要说明Important Notes on using 内存中 OLTPIn-Memory OLTP

  • SQL Server 2016 (13.x)SQL Server 2016 (13.x) 起,对内存优化表没有大小限制(不同于可用内存)。Starting SQL Server 2016 (13.x)SQL Server 2016 (13.x), there is no limit on the size of memory-optimized tables, other than available memory.

  • SQL Server 2014 (12.x)SQL Server 2014 (12.x) 中,数据库中所有持久表在内存中的总大小不应超过 250 GB。In SQL Server 2014 (12.x)SQL Server 2014 (12.x), the total in-memory size of all durable tables in a database should not exceed 250 GB. 有关详细信息,请参阅 估算内存优化表的内存需求For more information, see Estimate Memory Requirements for Memory-Optimized Tables.

备注

SQL Server 2016 (13.x)SQL Server 2016 (13.x) SP1 开始,Standard 和 Express 版本支持内存中 OLTP,但它们对可用于给定数据库中内存优化表的内存量设置了配额。Starting SQL Server 2016 (13.x)SQL Server 2016 (13.x) SP1, Standard and Express Editions support In-Memory OLTP, but they impose quotas on the amount of memory you can use for memory-optimized tables in a given database. 在 Standard 版本中,每个数据库的配额是 32GB;在 Express 版本中,每个数据库的配额是 352MB。In Standard edition this is 32GB per database; in Express edition this is 352MB per database.

  • 如果创建一个或多个包含内存优化表的数据库,应通过向 SQL ServerSQL Server 服务启动帐户授予 SE_MANAGE_VOLUME_NAME 用户权限,启用即时文件初始化 (IFI)。If you create one or more databases with memory-optimized tables, you should enable Instant File Initialization (IFI) by granting the SQL ServerSQL Server service startup account the SE_MANAGE_VOLUME_NAME user right. 如果没有 IFI,内存优化存储文件(数据和差异文件)将在创建时初始化,这会对工作负荷性能产生负面影响。Without IFI, memory-optimized storage files (data and delta files) will be initialized upon creation, which can have negative impact on the performance of your workload. 有关 IFI 的详细信息,包括如何启用它,请参阅数据库即时文件初始化For more information about IFI, including how to enable it, see Database Instant File Initialization.

另请参阅See Also

内存中 OLTP(内存中优化)In-Memory OLTP (In-Memory Optimization)
数据库实例文件初始化Database Instant File Initialization
内存体系结构指南Memory Architecture guide