|
2 | 2 | title: Database Instant File Initialization |
3 | 3 | description: Learn about instant file initialization and how to enable it on your SQL Server database. |
4 | 4 | ms.custom: contperfq4 |
5 | | -ms.date: 05/30/2020 |
| 5 | +ms.date: 07/24/2020 |
6 | 6 | ms.prod: sql |
7 | 7 | ms.prod_service: "database-engine" |
8 | 8 | ms.reviewer: "" |
@@ -32,6 +32,7 @@ By default, data and log files are initialized to overwrite any existing data le |
32 | 32 |
|
33 | 33 | In [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)], instant file initialization (IFI) 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. Log files cannot be initialized instantaneously. |
34 | 34 |
|
| 35 | + |
35 | 36 | ## Enable instant file initialization |
36 | 37 |
|
37 | 38 | Instant file initialization is only available if the [!INCLUDE[ssNoVersion](../../includes/ssnoversion-md.md)] service startup account has been 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. |
@@ -93,5 +94,29 @@ If the potential for disclosing deleted content is a concern, you should take on |
93 | 94 | > [!NOTE] |
94 | 95 | > 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. |
95 | 96 | |
| 97 | +### SE_MANAGE_VOLUME_NAME user right |
| 98 | + |
| 99 | +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. |
| 100 | + |
| 101 | +## Performance considerations |
| 102 | + |
| 103 | +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 may see the following messages recorded in the SQL Server Errorlog and the Application Log. |
| 104 | + |
| 105 | +``` |
| 106 | +Msg 5144 |
| 107 | +Autogrow of file '%.*ls' in database '%.*ls' was cancelled by user or timed out after %d milliseconds. Use ALTER DATABASE to set a smaller FILEGROWTH value for this file or to explicitly set a new file size. |
| 108 | +``` |
| 109 | + |
| 110 | +``` |
| 111 | +Msg 5145 |
| 112 | +Autogrow of file '%.*ls' in database '%.*ls' took %d milliseconds. Consider using ALTER DATABASE to set a smaller FILEGROWTH for this file. |
| 113 | +``` |
| 114 | + |
| 115 | +A long autogrow of a database and/or transaction log file may cause query performance problems. This is because an operation that requires the autogrowth of a file will hold on to resources such as locks or latches during the duration of the file grow operation. You may see long waits on latches for allocation pages. The operation that requires the long autogrow will show a wait type of PREEMPTIVE_OS_WRITEFILEGATHER. |
| 116 | + |
| 117 | + |
| 118 | + |
| 119 | + |
| 120 | + |
96 | 121 | ## See Also |
97 | 122 | [CREATE DATABASE (SQL Server Transact-SQL)](../../t-sql/statements/create-database-sql-server-transact-sql.md) |
0 commit comments