{"id":934,"date":"2009-03-10T11:51:00","date_gmt":"2009-03-10T11:51:00","guid":{"rendered":"\/blogs\/paul\/post\/Misconceptions-around-instant-file-initialization.aspx"},"modified":"2017-04-13T09:51:47","modified_gmt":"2017-04-13T16:51:47","slug":"misconceptions-around-instant-file-initialization","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/paul\/misconceptions-around-instant-file-initialization\/","title":{"rendered":"Misconceptions around instant file initialization"},"content":{"rendered":"<p><span style=\"font-family: verdana, geneva; font-size: small;\">Whenever I teach a class I&#8217;m amazed at the number of DBAs who don&#8217;t know about instant file initialization. Without wanting to redo blog posts that others have done, in a nutshell it allows a file to be create or grown &#8216;instantly&#8217; by not having to zero the space in the file. This is especially useful in disaster recovery situations, where restoring a database may have to create the data files first &#8211; and with instant file initialization turned on it cuts out a bunch of downtime. See Kimberly&#8217;s blog post <\/span><a href=\"http:\/\/www.sqlskills.com\/blogs\/kimberly\/instant-initialization-what-why-and-how\/\"><span style=\"font-family: verdana, geneva; font-size: small;\">Instant Initialization &#8211; What, Why and How?<\/span><\/a><span style=\"font-family: verdana, geneva; font-size: small;\">\u00a0for more details.<\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">Anyway, the reason I&#8217;m posting today is to clear up some misconceptions that I keep hearing.<\/span><\/p>\n<p><span style=\"font-family: verdana, geneva;\"><span style=\"font-size: small;\"><strong>Misconception: instant file initialization is on by default.<\/strong> No it isn&#8217;t. There&#8217;s a tiny security risk with having it enabled (for systems where the SQL data drives are shared by sensitive non-SQL files) so it&#8217;s off by default and requires granting the SE_MANAGE_VOLUME_NAME permission (more commonly known as Perform Volume Maintenance Tasks). Kimberly&#8217;s blog post explains how to enable it.<\/span><\/span><\/p>\n<p><span style=\"font-family: verdana, geneva;\"><span style=\"font-size: small;\"><strong>Misconception: instant file initialization is Enterprise-only.<\/strong> No it isn&#8217;t.<\/span><\/span><\/p>\n<p><span style=\"font-family: verdana, geneva;\"><span style=\"font-size: small;\"><strong>Misconception: instant file initialization applies to log files too.<\/strong> No it doesn&#8217;t. Log files cannot be instant initializated &#8211; my blog post <\/span><\/span><a href=\"https:\/\/www.sqlskills.com\/blogs\/paul\/search-engine-qa-24-why-cant-the-transaction-log-use-instant-initialization\/\"><span style=\"font-family: verdana, geneva; font-size: small;\">Search Engine Q&amp;A #24: Why can&#8217;t the transaction log use instant initialization?<\/span><\/a><span style=\"font-family: verdana, geneva; font-size: small;\">\u00a0explains why not.<\/span><\/p>\n<p><span style=\"font-family: verdana, geneva;\"><span style=\"font-size: small;\"><strong>Misconception: NTFS performs the zeroing when instant file initialization is not enabled.<\/strong> No it doesn&#8217;t. SQL Server does it, because it can do it faster than NTFS. When instant file initialization is enabled, SQL skips zeroing the file and instead just calls the\u00a0Windows API SetFileValidData. The special permission is required to be able to call that API. MSDN has more details at <\/span><\/span><a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/aa365544(VS.85).aspx\"><span style=\"font-family: verdana, geneva; font-size: small;\">http:\/\/msdn.microsoft.com\/en-us\/library\/aa365544(VS.85).aspx<\/span><\/a><span style=\"font-family: verdana, geneva; font-size: small;\">. Ok &#8211; that took a bit of remembering, and digging around on MSDN.<\/span><\/p>\n<p><span style=\"font-family: verdana, geneva;\"><span style=\"font-size: small;\"><strong>Misconception: when instant file initialization is enabled, pages are zero&#8217;d before they&#8217;re written.<\/strong> No they&#8217;re not. An entire 8k image is written to disk, which overwrites that uninitialized 8k portion of the file. Another flavor of this misconception is that if a page is allocated from an extent in an instant initialized file, the unallocated pages in the extent are zero&#8217;d out &#8211; that&#8217;s not true either.<\/span><\/span><\/p>\n<p><span style=\"font-family: verdana, geneva; font-size: small;\">Hope this helps<\/span><\/p>\n<p><span style=\"font-size: small;\">PS And a perfect opportunity for another survey:<\/span><\/p>\n<p><script type=\"text\/javascript\">\/\/ <![CDATA[\nem24_survey_x = \"a542a46b-afa6-44a5-8105-86986035455d\";\nem24_survey_width = \"255\";\nem24_survey_height = \"172\";\nem24_styles = \".em24_s {border:solid 1px #626A84; width:250px;} .em24_s td {font-size:12px;} .em24_q {background:#798BC6; color:#ffffff;} .em24_ai0, .em24_at0 {background:#E7F3FF; border-top:1px solid #B3C7D9;} .em24_ai1, .em24_at1 {background:#E3F7DE; border-top:1px solid #B3C7D9;} .em24_v {background:#798BC6}\";\n\/\/ ]]><\/script><br \/>\n<script type=\"text\/javascript\" src=\"http:\/\/my.surveypopups.com\/show\/si.js\">\/\/ <![CDATA[\n\n\/\/ ]]><\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Whenever I teach a class I&#8217;m amazed at the number of DBAs who don&#8217;t know about instant file initialization. Without wanting to redo blog posts that others have done, in a nutshell it allows a file to be create or grown &#8216;instantly&#8217; by not having to zero the space in the file. This is especially [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[48,50,61,91],"tags":[],"class_list":["post-934","post","type-post","status-publish","format-standard","hentry","category-inside-the-storage-engine","category-instant-initialization","category-misconceptions","category-surveys"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Misconceptions around instant file initialization - Paul S. Randal<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqlskills.com\/blogs\/paul\/misconceptions-around-instant-file-initialization\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Misconceptions around instant file initialization - Paul S. Randal\" \/>\n<meta property=\"og:description\" content=\"Whenever I teach a class I&#8217;m amazed at the number of DBAs who don&#8217;t know about instant file initialization. Without wanting to redo blog posts that others have done, in a nutshell it allows a file to be create or grown &#8216;instantly&#8217; by not having to zero the space in the file. This is especially [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/paul\/misconceptions-around-instant-file-initialization\/\" \/>\n<meta property=\"og:site_name\" content=\"Paul S. Randal\" \/>\n<meta property=\"article:published_time\" content=\"2009-03-10T11:51:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-04-13T16:51:47+00:00\" \/>\n<meta name=\"author\" content=\"Paul Randal\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Paul Randal\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/misconceptions-around-instant-file-initialization\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/misconceptions-around-instant-file-initialization\/\",\"name\":\"Misconceptions around instant file initialization - Paul S. Randal\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#website\"},\"datePublished\":\"2009-03-10T11:51:00+00:00\",\"dateModified\":\"2017-04-13T16:51:47+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/misconceptions-around-instant-file-initialization\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/paul\/misconceptions-around-instant-file-initialization\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/misconceptions-around-instant-file-initialization\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Misconceptions around instant file initialization\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#website\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/\",\"name\":\"Paul S. Randal\",\"description\":\"In Recovery...\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce\",\"name\":\"Paul Randal\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g\",\"caption\":\"Paul Randal\"},\"sameAs\":[\"http:\/\/3.209.169.194\/blogs\/paul\"],\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/author\/paul\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Misconceptions around instant file initialization - Paul S. Randal","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqlskills.com\/blogs\/paul\/misconceptions-around-instant-file-initialization\/","og_locale":"en_US","og_type":"article","og_title":"Misconceptions around instant file initialization - Paul S. Randal","og_description":"Whenever I teach a class I&#8217;m amazed at the number of DBAs who don&#8217;t know about instant file initialization. Without wanting to redo blog posts that others have done, in a nutshell it allows a file to be create or grown &#8216;instantly&#8217; by not having to zero the space in the file. This is especially [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/paul\/misconceptions-around-instant-file-initialization\/","og_site_name":"Paul S. Randal","article_published_time":"2009-03-10T11:51:00+00:00","article_modified_time":"2017-04-13T16:51:47+00:00","author":"Paul Randal","twitter_misc":{"Written by":"Paul Randal","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/misconceptions-around-instant-file-initialization\/","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/misconceptions-around-instant-file-initialization\/","name":"Misconceptions around instant file initialization - Paul S. Randal","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#website"},"datePublished":"2009-03-10T11:51:00+00:00","dateModified":"2017-04-13T16:51:47+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/misconceptions-around-instant-file-initialization\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/paul\/misconceptions-around-instant-file-initialization\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/misconceptions-around-instant-file-initialization\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/paul\/"},{"@type":"ListItem","position":2,"name":"Misconceptions around instant file initialization"}]},{"@type":"WebSite","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#website","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/","name":"Paul S. Randal","description":"In Recovery...","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqlskills.com\/blogs\/paul\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce","name":"Paul Randal","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/0b6a266bba2f088f2551ef529293001bd73bf026bc1908b9866728c062beeeb6?s=96&d=mm&r=g","caption":"Paul Randal"},"sameAs":["http:\/\/3.209.169.194\/blogs\/paul"],"url":"https:\/\/www.sqlskills.com\/blogs\/paul\/author\/paul\/"}]}},"_links":{"self":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts\/934","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/comments?post=934"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts\/934\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/media?parent=934"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/categories?post=934"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/tags?post=934"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}