Data and log files are first initialized by filling the files with zeros when you perform one of the following operations:
- Create a database.
- Add files, log or data, to an existing database.
- Increase the size of an existing file (including autogrow operations).
- Restore a database or filegroup.
File initialization causes these operations to take longer. However, when data is written to the files for the first time, the operating system does not have to fill the files with zeros.
Instant file initialization is only available if the SQL Server (MSSQLSERVER) service account has been granted SE_MANAGE_VOLUME_NAME. This permission is granted by adding service account to the Perform Volume Maintenance Tasks security policy (in GPEDIT.MSC).
Instant file initialization is not available when TDE is enabled.
To check if the SQL service account has this permission granted, run the following script:
EXEC sp_configure 'Show Advanced Options', 1
reconfigure;
EXEC sp_configure 'xp_cmdshell',1
reconfigure;
SET NOCOUNT ON
EXEC xp_cmdshell 'whoami /priv | findstr "SeManageVolumePrivilege"'
EXEC sp_configure 'xp_cmdshell',0
EXEC sp_configure 'Show Advanced Options', 0
reconfigure;
If the output says
output
--------------------------------_-----------------------------------
SeManageVolumePrivilege Perform volume maintenance tasks Enabled
NULL
then the service account has the "Perform Volume Maintenance Tasks" permission.
Comments
Post a Comment