启用“锁定内存页”选项 (Windows)Enable the Lock Pages in Memory Option (Windows)

适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) 适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions)

此 Windows 策略将确定哪些帐户可以使用进程将数据保留在物理内存中,从而阻止系统将数据分页到磁盘的虚拟内存中。This Windows policy determines which accounts can use a process to keep data in physical memory, preventing the system from paging the data to virtual memory on disk.

备注

当预计会将内存分页到磁盘时,锁定内存中的页可以大大提高性能。Locking pages in memory may boost performance when paging memory to disk is expected.

使用 Windows 组策略工具 (gpedit.msc),可以为 SQL ServerSQL Server使用的帐户启用此策略。Use the Windows Group Policy tool (gpedit.msc) to enable this policy for the account used by SQL ServerSQL Server. 必须是系统管理员才能更改此策略。You must be a system administrator to change this policy.

启用“锁定内存页”选项To enable the lock pages in memory option

  1. “开始” 菜单上,单击 “运行”On the Start menu, click Run. 在“打开” 框中,键入 gpedit.mscIn the Open box, type gpedit.msc.

  2. “本地组策略编辑器” 控制台上,展开 “计算机配置” ,再展开 “Windows 设置”On the Local Group Policy Editor console, expand Computer Configuration, and then expand Windows Settings.

  3. 展开 “安全设置” ,再展开 “本地策略”Expand Security Settings, and then expand Local Policies.

  4. 选择 “用户权利指派” 文件夹。Select the User Rights Assignment folder.

    细节窗格中随即显示出策略。The policies will be displayed in the details pane.

  5. 在该窗格中,双击“锁定内存页”。In the pane, double-click Lock pages in memory.

  6. 在“本地安全设置 - 锁定内存中的页”对话框中,单击“添加用户或组” 。In the Local Security Setting - Lock pages in memory dialog box, click Add User or Group.

  7. 在“选择用户”、“服务帐户”或“组”对话框中,选择 SQL Server 服务帐户。In the Select Users, Service Accounts, or Groups dialog box, select the SQL Server Service account.

  8. 重启 SQL Server 服务,以使此设置生效。Restart the SQL Server Service for this setting to take effect.

另请参阅See Also

“服务器内存”服务器配置选项Server Memory Server Configuration Options