Skip to content

Commit 6ec45b7

Browse files
Clarify the use of service SID when granting OS privileges (#34706)
Apply suggestions from code review
1 parent fea2914 commit 6ec45b7

File tree

2 files changed

+35
-22
lines changed

2 files changed

+35
-22
lines changed

docs/database-engine/configure-windows/enable-the-lock-pages-in-memory-option-windows.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
---
2-
title: "Enable the Lock pages in memory option (Windows)"
2+
title: "Enable the Lock Pages in Memory Option (Windows)"
33
description: "Learn how to turn on the Lock pages in memory option. See how it can boost performance by keeping data in physical memory instead of paging it to disk."
44
author: rwestMSFT
55
ms.author: randolphwest
6-
ms.date: 06/12/2024
6+
ms.date: 07/16/2025
77
ms.service: sql
88
ms.subservice: configuration
99
ms.topic: how-to
@@ -24,16 +24,27 @@ Use the Windows Group Policy tool (`gpedit.msc`) to enable this policy for the a
2424
### Enable the Lock pages in memory option
2525

2626
1. On the **Start** menu, select **Run**. In the **Open** box, type `gpedit.msc`. The **Group Policy** dialog box opens.
27+
2728
1. On the **Local Group Group Policy** console, expand **Computer Configuration**.
29+
2830
1. Expand **Windows Settings**.
31+
2932
1. Expand **Security Settings**.
33+
3034
1. Expand **Local Policies**.
31-
1. Select the **User Rights Assignment** folder. The policies will be displayed in the details pane.
35+
36+
1. Select the **User Rights Assignment** folder. The policies are displayed in the details pane.
37+
3238
1. In the pane, scroll to and double-click the **Lock pages in memory** policy.
33-
1. In the **Local Security Policy Setting** dialog box, select **Add User or Group...**. Add the SQL Server Service account. To determine the service account for the instance of [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)], refer to the SQL Server Configuration Manager or query the `service_account` from `sys.dm_server_services`. For more information, see [sys.dm_server_services](../../relational-databases/system-dynamic-management-views/sys-dm-server-services-transact-sql.md).
39+
40+
1. In the **Local Security Policy Setting** dialog box, select **Add User or Group...**. Add the [!INCLUDE [ssDE](../../includes/ssde-md.md)] service account or its service security identifier (SID). To determine the service account or the service SID for an instance of [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)], refer to the SQL Server Configuration Manager or use the `service_account` column in `sys.dm_server_services`. For more information, see [sys.dm_server_services](../../relational-databases/system-dynamic-management-views/sys-dm-server-services-transact-sql.md).
41+
3442
1. Select **OK**.
43+
3544
1. Restart the instance for this setting to take effect.
3645

46+
We recommend that you assign the **Lock pages in memory** policy to the [service SID](configure-windows-service-accounts-and-permissions.md#Serv_SID) of the [!INCLUDE [ssDE](../../includes/ssde-md.md)] service. This ensures that the grant remains even if you change the service account of the [!INCLUDE [ssDE](../../includes/ssde-md.md)] service. For more information, see [Using Service SIDs to grant permissions to services in SQL Server](../../relational-databases/security/using-service-sids-to-grant-permissions-to-services-in-sql-server.md).
47+
3748
## Related content
3849

3950
- [Server memory configuration options](server-memory-server-configuration-options.md)

docs/relational-databases/databases/database-instant-file-initialization.md

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ description: Learn about instant file initialization and how to enable it on you
44
author: WilliamDAssafMSFT
55
ms.author: wiassaf
66
ms.reviewer: randolphwest
7-
ms.date: 02/19/2025
7+
ms.date: 07/16/2025
88
ms.service: sql
99
ms.subservice: configuration
1010
ms.topic: conceptual
@@ -20,7 +20,7 @@ helpviewer_keywords:
2020

2121
[!INCLUDE [SQL Server](../../includes/applies-to-version/sql-asdb-asdbmi.md)]
2222

23-
In this article, you learn about instant file initialization (IFI) and how to enable it to speed up growth for your [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] database files.
23+
In this article, you learn about instant file initialization (IFI) and how to enable it to speed up the growth for your [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] database files.
2424

2525
By default, data and log files are initialized to overwrite any existing data left on the disk from previously deleted files. Data and log files are first initialized by zeroing the files (filling with zeros) when you perform the following operations:
2626

@@ -29,7 +29,7 @@ By default, data and log files are initialized to overwrite any existing data le
2929
- Increase the size of an existing file (including autogrow operations).
3030
- Restore a database or filegroup.
3131

32-
In [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)], instant file initialization allows for faster execution of the previously mentioned file operations, since it reclaims used disk space without filling that space with zeros. Instead, disk content is overwritten as new data is written to the files.
32+
In [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)], instant file initialization allows for faster execution of the previously mentioned file operations, since it reclaims used disk space without filling that space with zeros. Instead, old disk content is overwritten as new data is written to the files.
3333

3434
In [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)] and [!INCLUDE [ssazuremi-md](../../includes/ssazuremi-md.md)], instant file initialization is available for transaction log files only.
3535

@@ -47,40 +47,42 @@ Unlike instant file initialization for data files, which is prevented if transpa
4747

4848
## Enable instant file initialization
4949

50-
Instant file initialization of data files is only available if the [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] service startup account is granted `SE_MANAGE_VOLUME_NAME`. Members of the Windows Administrator group have this right and can grant it to other users by adding them to the **Perform Volume Maintenance Tasks** security policy. The `SE_MANAGE_VOLUME_NAME` right isn't required for instant file initialization of growth events up to 64 MB in the transaction log, which was introduced with the release of [!INCLUDE [sssql22-md](../../includes/sssql22-md.md)].
50+
Instant file initialization of data files is only available if either the service account or the service SID of the [!INCLUDE [ssDE](../../includes/ssde-md.md)] service is granted the `SE_MANAGE_VOLUME_NAME` privilege. Members of the Windows Administrators group have this right and can grant it to other users by adding them to the **Perform volume maintenance tasks** security policy. The `SE_MANAGE_VOLUME_NAME` privilege isn't required for instant file initialization of growth events up to 64 MB in the transaction log, which was introduced with the release of [!INCLUDE [sssql22-md](../../includes/sssql22-md.md)].
51+
52+
We recommend that you grant the `SE_MANAGE_VOLUME_NAME` privilege to the [service SID](../../database-engine/configure-windows/configure-windows-service-accounts-and-permissions.md#Serv_SID) of the [!INCLUDE [ssDE](../../includes/ssde-md.md)] service. This ensures that the grant remains even if you change the service account of the [!INCLUDE [ssDE](../../includes/ssde-md.md)] service. For more information, see [Using Service SIDs to grant permissions to services in SQL Server](../security/using-service-sids-to-grant-permissions-to-services-in-sql-server.md).
5153

5254
> [!IMPORTANT]
5355
> Some feature usage, such as [Transparent data encryption (TDE)](../security/encryption/transparent-data-encryption.md), can prevent instant file initialization (IFI). In [!INCLUDE [sssql22-md](../../includes/sssql22-md.md)] and later versions, and on [!INCLUDE [ssazure-sqldb](../../includes/ssazure-sqldb.md)] and [!INCLUDE [ssazuremi-md](../../includes/ssazuremi-md.md)], IFI is allowed on the transaction log. For more information, see [Instant file initialization and the transaction log](#instant-file-initialization-and-the-transaction-log).
5456
55-
In [!INCLUDE [sssql16-md](../../includes/sssql16-md.md)] and later versions, this permission can be granted to the service account at install time, during setup.
57+
In [!INCLUDE [sssql16-md](../../includes/sssql16-md.md)] and later versions, this permission can be granted to the [!INCLUDE [ssDE](../../includes/ssde-md.md)] service security identifier (SID) at install time, during setup.
5658

5759
If you use the [command prompt install](../../database-engine/install-windows/install-sql-server-from-the-command-prompt.md), add the `/SQLSVCINSTANTFILEINIT` argument, or check the box *Grant Perform Volume Maintenance Task privilege to SQL Server Database Engine Service* in the [installation wizard](../../database-engine/install-windows/install-sql-server-from-the-installation-wizard-setup.md).
5860

59-
To grant an account the `Perform volume maintenance tasks` permission:
61+
To grant an account or a service SID the `Perform volume maintenance tasks` security policy:
6062

61-
1. On the computer where the data file will be created, open the **Local Security Policy** application (`secpol.msc`).
63+
1. On the computer where data files will be created, open the **Local Security Policy** application (`secpol.msc`).
6264

6365
1. In the left pane, expand **Local Policies**, and then select **User Rights Assignment**.
6466

6567
1. In the right pane, double-click **Perform volume maintenance tasks**.
6668

67-
1. Select **Add User or Group** and add the [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] service account.
69+
1. Select **Add User or Group** and add the [!INCLUDE [ssDE](../../includes/ssde-md.md)] service account or its service SID.
6870

6971
1. Select **Apply**, and then close all **Local Security Policy** dialog boxes.
7072

71-
1. Restart the [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] service.
73+
1. Restart the [!INCLUDE [ssDE](../../includes/ssde-md.md)] service.
7274

73-
1. Check the [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] error log at startup.
75+
1. Check the [!INCLUDE [ssDE](../../includes/ssde-md.md)] error log at startup.
7476

7577
**Applies to:** [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] (Starting with [!INCLUDE [ssSQL11](../../includes/sssql11-md.md)] SP4, [!INCLUDE [ssSQL14](../../includes/sssql14-md.md)] SP2, and [!INCLUDE [sssql16-md](../../includes/sssql16-md.md)] and later).
7678

77-
1. If the [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] service startup account is granted `SE_MANAGE_VOLUME_NAME`, an informational message that resembles the following example is logged:
79+
1. If the [!INCLUDE [ssDE](../../includes/ssde-md.md)] service account or its service SID is granted the `SE_MANAGE_VOLUME_NAME` privilege, an informational message that resembles the following example is logged:
7880

7981
```output
8082
Database Instant File Initialization: enabled. For security and performance considerations see the topic 'Database Instant File Initialization' in SQL Server Books Online. This is an informational message only. No user action is required.
8183
```
8284
83-
1. If the [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] service startup account was **not** granted `SE_MANAGE_VOLUME_NAME`, an informational message that resembles the following example is logged:
85+
1. If the [!INCLUDE [ssDE](../../includes/ssde-md.md)] service account or its service SID was **not** granted the `SE_MANAGE_VOLUME_NAME` privilege, an informational message that resembles the following example is logged:
8486
8587
```output
8688
Database Instant File Initialization: disabled. For security and performance considerations see the topic 'Database Instant File Initialization' in SQL Server Books Online. This is an informational message only. No user action is required.
@@ -95,7 +97,7 @@ We recommend enabling instant file initialization as the benefits can outweigh t
9597
9698
When you use instant file initialization, the deleted disk content is overwritten only as new data is written to the files. For this reason, the deleted content is potentially accessible by an unauthorized principal, until some other data writes on that specific area of the data file.
9799
98-
While the database file is attached to the instance of [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)], this information disclosure risk is reduced by the discretionary access control list (DACL) on the file. This DACL allows file access only to the [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] service account and the local administrator. However, when the file is detached, it's potentially accessible by a user or service that doesn't have `SE_MANAGE_VOLUME_NAME`.
100+
While the database file is attached to the instance of [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)], this information disclosure risk is reduced by the discretionary access control list (DACL) on the file. The DACL allows file access only to the [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] service account, its service SID, and the local administrator. However, when the file is detached, it's potentially accessible by a user or service that doesn't have the `SE_MANAGE_VOLUME_NAME` privilege.
99101
100102
Similar considerations exist when:
101103
@@ -109,18 +111,18 @@ If the potential for disclosing deleted content is a concern, you should take on
109111
110112
- Always make sure that any detached data files and backup files have restrictive DACLs.
111113
112-
- Disable instant file initialization for the instance of [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)]. To do so, revoke `SE_MANAGE_VOLUME_NAME` from the [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)] service startup account.
114+
- Disable instant file initialization for the instance of [!INCLUDE [ssNoVersion](../../includes/ssnoversion-md.md)]. To do so, revoke `SE_MANAGE_VOLUME_NAME` from the [!INCLUDE [ssDE](../../includes/ssde-md.md)] service account and its service SID.
113115
114116
> [!NOTE]
115-
> Disabling will increase allocation times for data files, and only affects files that are created or increased in size after the user right is revoked.
117+
> Disabling IFI increases growth time for data files, and only affects files that are created or increased in size after the privilege is revoked.
116118
117-
### SE_MANAGE_VOLUME_NAME user right
119+
### SE_MANAGE_VOLUME_NAME privilege
118120
119-
The `SE_MANAGE_VOLUME_NAME` user privilege can be assigned in **Windows Administrative Tools**, **Local Security Policy** applet. Under **Local Policies** select **User Right Assignment** and modify the **Perform volume maintenance tasks** property.
121+
The `SE_MANAGE_VOLUME_NAME` privilege can be assigned in **Windows Administrative Tools**, **Local Security Policy** applet. Under **Local Policies** select **User Right Assignment** and modify the **Perform volume maintenance tasks** property.
120122
121123
## Performance considerations
122124
123-
The Database File initialization process writes zeros to the new regions of the file under initialization. The duration of this process depends on size of file portion that is initialized and on the response time and capacity of the storage system. If the initialization takes a long time, you might see the following messages recorded in the [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] error log and the Application Log.
125+
The database file initialization process writes zeros to the new regions of the file under initialization. The duration of this process depends on size of file portion that is initialized and on the response time and capacity of the storage system. If the initialization takes a long time, you might see the following messages recorded in the [!INCLUDE [ssnoversion-md](../../includes/ssnoversion-md.md)] error log and the Application Log.
124126
125127
```output
126128
Msg 5144

0 commit comments

Comments
 (0)