{"id":972,"date":"2008-11-30T17:37:00","date_gmt":"2008-11-30T17:37:00","guid":{"rendered":"\/blogs\/paul\/post\/TechEd-demo-corruptions-fatal-to-DBCC-CHECKDB.aspx"},"modified":"2013-04-03T05:41:56","modified_gmt":"2013-04-03T12:41:56","slug":"teched-demo-corruptions-fatal-to-dbcc-checkdb","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/paul\/teched-demo-corruptions-fatal-to-dbcc-checkdb\/","title":{"rendered":"TechEd demo: corruptions fatal to DBCC CHECKDB"},"content":{"rendered":"<p><span style=\"font-family: verdana, geneva; font-size: small;\">This blog post describes the demo &#8220;1 &#8211; Fatal Errors&#8221; from my Corruption Survival Techniques conference session from various conferences in 2008. The links to the scripts and databases to use are in <a href=\"https:\/\/www.sqlskills.com\/blogs\/paul\/conference-corruption-demo-scripts-and-example-corrupt-databases\/\">this blog post<\/a>.<\/span><\/p>\n<p><span style=\"font-size: small;\">The aim of this demo is to show that sometimes a database is so corrupt that <span style=\"font-family: 'courier new', courier;\">DBCC CHECKDB<\/span> just cannot run on it. In that case, there&#8217;s no way to force <span style=\"font-family: 'courier new', courier;\">DBCC CHECKDB<\/span> to get past the fatal corruption and so there&#8217;s no way to run a repair either &#8211; you&#8217;re looking at restoring from a backup or at worst, extracting as much data as possible into a new database.<\/span><\/p>\n<p><span style=\"font-size: small;\">Let&#8217;s look at a couple of examples. Extract and restore the DemoFatalCorruption1 and DemoFatalCorruption2 databases, and the FatalErrors.sql script. What do we get from running <span style=\"font-family: 'courier new', courier;\">DBCC CHECKDB<\/span> on DemoFatalCorruption1 (lines 47-49 in the script)?<\/span><\/p>\n<blockquote><p><span style=\"font-family: 'courier new', courier; font-size: small;\"><span style=\"color: #0000ff;\">DBCC CHECKDB <\/span><span style=\"color: #808080;\">(<\/span>DemoFatalCorruption1<span style=\"color: #808080;\">)<\/span><br \/>\n<span style=\"color: #0000ff;\">WITH NO_INFOMSGS<\/span><span style=\"color: #808080;\">,<\/span> <span style=\"color: #0000ff;\">ALL_ERRORMSGS<\/span><span style=\"color: #808080;\">;<\/span><br \/>\nGO<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: 'courier new', courier; font-size: small;\"><span style=\"color: #ff0000;\">Msg 8928, Level 16, State 6, Line 1<br \/>\nObject ID 0, index ID -1, partition ID 0, alloc unit ID 0 (type Unknown): Page (1:71) could not be processed. See other errors for details.<br \/>\n<\/span>CHECKDB found 1 allocation errors and 0 consistency errors not associated with any single object.<br \/>\n<span style=\"color: #ff0000;\">Msg 8906, Level 16, State 1, Line 1<br \/>\nPage (1:19) in database ID 8 is allocated in the SGAM (1:3) and PFS (1:1), but was not allocated in any IAM. PFS flags &#8216;MIXED_EXT ALLOCATED 0_PCT_FULL&#8217;.<br \/>\nMsg 2575, Level 16, State 1, Line 1<br \/>\nThe Index Allocation Map (IAM) page (1:71) is pointed to by the next pointer of IAM page (0:0) in object ID 15, index ID 1, partition ID 983040, alloc unit ID 983040 (type In-row data), but it was not detected in the scan.<br \/>\nMsg 7965, Level 16, State 2, Line 1<br \/>\nTable error: Could not check object ID 15, index ID 1, partition ID 983040, alloc unit ID 983040 (type In-row data) due to invalid allocation (IAM) page(s).<br \/>\nMsg 8906, Level 16, State 1, Line 1<br \/>\nPage (1:71) in database ID 8 is allocated in the SGAM (1:3) and PFS (1:1), but was not allocated in any IAM. PFS flags &#8216;IAM_PG MIXED_EXT ALLOCATED 0_PCT_FULL&#8217;.<br \/>\nMsg 8939, Level 16, State 5, Line 1<br \/>\nTable error: Object ID 15, index ID 1, partition ID 983040, alloc unit ID 983040 (type In-row data), page (1:71). Test (m_headerVersion == HEADER_7_0) failed. Values are 0 and 1.<br \/>\nMsg 8939, Level 16, State 6, Line 1<br \/>\nTable error: Object ID 15, index ID 1, partition ID 983040, alloc unit ID 983040 (type In-row data), page (1:71). Test ((m_type &gt;= DATA_PAGE &amp;&amp; m_type &lt;= UNDOFILE_HEADER_PAGE) || (m_type == UNKNOWN_PAGE &amp;&amp; level == BASIC_HEADER)) failed. Values are 0 and 0.<br \/>\nMsg 8939, Level 16, State 5, Line 1<br \/>\nTable error: Object ID 15, index ID 1, partition ID 983040, alloc unit ID 983040 (type In-row data), page (1:71). Test (m_headerVersion == HEADER_7_0) failed. Values are 0 and 1.<br \/>\nMsg 8939, Level 16, State 6, Line 1<br \/>\nTable error: Object ID 15, index ID 1, partition ID 983040, alloc unit ID 983040 (type In-row data), page (1:71). Test ((m_type &gt;= DATA_PAGE &amp;&amp; m_type &lt;= UNDOFILE_HEADER_PAGE) || (m_type == UNKNOWN_PAGE &amp;&amp; level == BASIC_HEADER)) failed. Values are 0 and 0.<br \/>\n<\/span>CHECKDB found 5 allocation errors and 3 consistency errors in table &#8216;sys.syshobts&#8217; (object ID 15).<br \/>\n<span style=\"color: #ff0000;\">Msg 7995, Level 16, State 1, Line 1<br \/>\nDatabase &#8216;DemoFatalCorruption1&#8217;: consistency errors in system catalogs prevent further DBCC checkdb processing.<br \/>\n<\/span>CHECKDB found 0 allocation errors and 1 consistency errors in table &#8216;ALLOCATION&#8217; (object ID 99).<br \/>\nCHECKDB found 6 allocation errors and 4 consistency errors in database &#8216;DemoFatalCorruption1&#8217;.<\/span><\/p>\n<p>&nbsp;<\/p><\/blockquote>\n<p><span style=\"font-size: small;\">A bunch of errors that look like regular <span style=\"font-family: 'courier new', courier;\">DBCC CHECKDB<\/span> output &#8211; but if you look carefully\u00a0near the end of the output you&#8217;ll see error 7995 stating that the system catalogs are so corrupt that <span style=\"font-family: 'courier new', courier;\">DBCC CHECKDB<\/span> can&#8217;t continue. Notice also that there&#8217;s nothing at the end of the output stating what the minimum repair level is to fix the errors &#8211; because repair cannot be run on this database.<\/span><\/p>\n<p><span style=\"font-size: small;\">The second example is even worse (running lines 53-55 in the script):<\/span><\/p>\n<blockquote><p><span style=\"font-family: 'Courier New'; font-size: small;\"><span style=\"color: #0000ff;\">DBCC CHECKDB <\/span><span style=\"color: #808080;\">(<\/span>DemoFatalCorruption2<span style=\"color: #808080;\">)<\/span><br \/>\n<span style=\"color: #0000ff;\">WITH NO_INFOMSGS<\/span><span style=\"color: #808080;\">,<\/span> <span style=\"color: #0000ff;\">ALL_ERRORMSGS<\/span><span style=\"color: #808080;\">;<\/span><br \/>\nGO <\/span><\/p>\n<p>Msg 211, Level 23, State 51, Line 1<br \/>\nPossible schema corruption. Run DBCC CHECKCATALOG.<\/p>\n<p>&nbsp;<\/p><\/blockquote>\n<p><span style=\"font-size: small;\">In this case, the corruption is so bad that <span style=\"font-family: 'courier new', courier;\">DBCC CHECKDB<\/span> didn&#8217;t even get a chance to terminate gracefully &#8211; the metadata subsystem in the Query Processor just blew away the whole command. Running <span style=\"font-family: 'courier new', courier;\">DBCC CHECKCATALOG<\/span> as the error message states doesn&#8217;t do any better &#8211; it just prints the same error! (I didn&#8217;t write that error message :-) <\/span><\/p>\n<p>So &#8211; just because <span style=\"font-family: 'courier new', courier;\">DBCC CHECKDB<\/span> completes, doesn&#8217;t always mean it completes <em>successfully<\/em>. Make sure you always check the output.<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This blog post describes the demo &#8220;1 &#8211; Fatal Errors&#8221; from my Corruption Survival Techniques conference session from various conferences in 2008. The links to the scripts and databases to use are in this blog post. The aim of this demo is to show that sometimes a database is so corrupt that DBCC CHECKDB just [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22,27,30,34,35,38],"tags":[],"class_list":["post-972","post","type-post","status-publish","format-standard","hentry","category-checkdb-from-every-angle","category-conferences","category-corruption","category-dbcc","category-disaster-recovery","category-example-scripts"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>TechEd demo: corruptions fatal to DBCC CHECKDB - 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\/teched-demo-corruptions-fatal-to-dbcc-checkdb\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"TechEd demo: corruptions fatal to DBCC CHECKDB - Paul S. Randal\" \/>\n<meta property=\"og:description\" content=\"This blog post describes the demo &#8220;1 &#8211; Fatal Errors&#8221; from my Corruption Survival Techniques conference session from various conferences in 2008. The links to the scripts and databases to use are in this blog post. The aim of this demo is to show that sometimes a database is so corrupt that DBCC CHECKDB just [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/paul\/teched-demo-corruptions-fatal-to-dbcc-checkdb\/\" \/>\n<meta property=\"og:site_name\" content=\"Paul S. Randal\" \/>\n<meta property=\"article:published_time\" content=\"2008-11-30T17:37:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2013-04-03T12:41:56+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=\"3 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\/teched-demo-corruptions-fatal-to-dbcc-checkdb\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/teched-demo-corruptions-fatal-to-dbcc-checkdb\/\",\"name\":\"TechEd demo: corruptions fatal to DBCC CHECKDB - Paul S. Randal\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#website\"},\"datePublished\":\"2008-11-30T17:37:00+00:00\",\"dateModified\":\"2013-04-03T12:41:56+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/teched-demo-corruptions-fatal-to-dbcc-checkdb\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/paul\/teched-demo-corruptions-fatal-to-dbcc-checkdb\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/teched-demo-corruptions-fatal-to-dbcc-checkdb\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"TechEd demo: corruptions fatal to DBCC CHECKDB\"}]},{\"@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":"TechEd demo: corruptions fatal to DBCC CHECKDB - 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\/teched-demo-corruptions-fatal-to-dbcc-checkdb\/","og_locale":"en_US","og_type":"article","og_title":"TechEd demo: corruptions fatal to DBCC CHECKDB - Paul S. Randal","og_description":"This blog post describes the demo &#8220;1 &#8211; Fatal Errors&#8221; from my Corruption Survival Techniques conference session from various conferences in 2008. The links to the scripts and databases to use are in this blog post. The aim of this demo is to show that sometimes a database is so corrupt that DBCC CHECKDB just [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/paul\/teched-demo-corruptions-fatal-to-dbcc-checkdb\/","og_site_name":"Paul S. Randal","article_published_time":"2008-11-30T17:37:00+00:00","article_modified_time":"2013-04-03T12:41:56+00:00","author":"Paul Randal","twitter_misc":{"Written by":"Paul Randal","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/teched-demo-corruptions-fatal-to-dbcc-checkdb\/","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/teched-demo-corruptions-fatal-to-dbcc-checkdb\/","name":"TechEd demo: corruptions fatal to DBCC CHECKDB - Paul S. Randal","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#website"},"datePublished":"2008-11-30T17:37:00+00:00","dateModified":"2013-04-03T12:41:56+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/teched-demo-corruptions-fatal-to-dbcc-checkdb\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/paul\/teched-demo-corruptions-fatal-to-dbcc-checkdb\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/teched-demo-corruptions-fatal-to-dbcc-checkdb\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/paul\/"},{"@type":"ListItem","position":2,"name":"TechEd demo: corruptions fatal to DBCC CHECKDB"}]},{"@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\/972","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=972"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts\/972\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/media?parent=972"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/categories?post=972"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/tags?post=972"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}