Configuring Windows Instant File Initialization for SQL Server 2005
Written By: Edwin Sarmiento -- 8/28/2008
-- read/post comments
-- print --
Rating:
(not rated yet)
Rate
Problem SQL Server 2005 supports Database Instant File Initialization which skips zeroing out data pages that can reduce the time when performing operations like creating databases, adding files to an existing database, increasing the size of an existing database file manually or thru autogrowth or restoring a database or filegroup. But how do we make sure that SQL Server is using this feature?
Solution In previous versions of SQL Server, data and log files are first initialized by filling the files with zeros when you perform one of the previously mentioned operations. This is very critical in disaster recovery and restore operations especially when dealing with very large databases.
With SQL Server 2005, instant file initialization is introduced. What this does is it skips the zeroing out of the data on disk, thereby, not overwriting the previous data written on the disk. The operating system just allocates the disk space, but the contents of the file is actually what is originally on the disk. This feature is available on all editions of SQL Server 2005 running on Windows Server 2003 or Windows XP on an NTFS file system.
Even though it is available, your instance might not be configured to use it. To do so, you should give your SQL Server service account or the local group SQLServerMSSQLUser$instancename the SE_MANAGE_VOLUME_NAME privilege. The SQLServerMSSQLUser$instancename local group is created when you install SQL Server 2005 and adds the SQL Server service account to it. To do this, the service account or local group has to be granted the "Perform Volume Maintenance Task" local security right. By default, the local Administrators group already has this permission so if your service account is a member of this group, you don't have to do anything.
Note that this is only applicable to data files and not log files so if you have a large transaction log file as part of your database backups, the database files will be created instantaneously but not the log files. They have to be zeroed out first before being written to disk. |