{"id":1047,"date":"2008-06-09T15:54:32","date_gmt":"2008-06-09T15:54:32","guid":{"rendered":"\/blogs\/paul\/post\/CHECKDB-From-Every-Angle-Using-DBCC-PAGE-to-find-what-repair-will-delete.aspx"},"modified":"2008-06-09T15:54:32","modified_gmt":"2008-06-09T15:54:32","slug":"checkdb-from-every-angle-using-dbcc-page-to-find-what-repair-will-delete","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/paul\/checkdb-from-every-angle-using-dbcc-page-to-find-what-repair-will-delete\/","title":{"rendered":"CHECKDB From Every Angle: Using DBCC PAGE to find what repair will delete"},"content":{"rendered":"<p><FONT face=Verdana size=2><br \/>\n<P><EM>(I&#8217;m actually on-stage here at TechEd doing the&nbsp;&nbsp;DAT track pre-con with Kimberly &#8211; she&#8217;s on now until lunch so I&#8217;m catching up on forum problems&#8230;)<\/EM><\/P><br \/>\n<P>Here&#8217;s a question that came up on of the <A href=\"http:\/\/www.sqlservercentral.com\/\">SQLServerCentral.com<\/A> corruption forums I monitor that I think is worth blogging about. To paraphrase:<\/P><br \/>\n<BLOCKQUOTE dir=ltr style=\"MARGIN-RIGHT: 0px\"><br \/>\n<P><EM>I have a bunch of corruptions in a database, that look like they&#8217;ve been there for a while. Repair is my only option &#8211; it works but I&#8217;d like to know what data is being deleted. How can I do that? Here are some of the errors:<\/EM><\/P><br \/>\n<P dir=ltr><FONT face=\"Courier New\" color=#ff0000>Server: Msg 8928, Level 16, State 1, Line 2<BR>Object ID 645577338, index ID 0: Page (1:168576) could not be processed. See other errors for details.<BR>Server: Msg 8928, Level 16, State 1, Line 2<BR>Object ID 645577338, index ID 0: Page (1:168577) could not be processed. See other errors for details.<BR>Server: Msg 8928, Level 16, State 1, Line 2<BR>Object ID 645577338, index ID 0: Page (1:168578) could not be processed. See other errors for details.<BR>Server: Msg 8928, Level 16, State 1, Line 2<BR>Object ID 645577338, index ID 0: Page (1:168579) could not be processed. See other errors for details.<BR>Server: Msg 8928, Level 16, State 1, Line 2<BR>Object ID 645577338, index ID 0: Page (1:168580) could not be processed. See other errors for details.<BR>Server: Msg 8928, Level 16, State 1, Line 2<BR>Object ID 645577338, index ID 0: Page (1:168581) could not be processed. See other errors for details.<BR>Server: Msg 8928, Level 16, State 1, Line 2<BR>Object ID 645577338, index ID 0: Page (1:168582) could not be processed. See other errors for details.<BR>Server: Msg 8976, Level 16, State 1, Line 2<BR>Table error: Object ID 645577338, index ID 1. Page (1:168576) was not seen in the scan although its parent (1:165809) and previous (1:168575) refer to it. Check any previous errors.<BR>Server: Msg 8978, Level 16, State 1, Line 2<BR>Table error: Object ID 645577338, index ID 1. Page (1:168583) is missing a reference from previous page (1:168582). Possible chain linkage problem.<\/FONT><\/P><\/BLOCKQUOTE><br \/>\n<P><FONT face=\"Courier New\" color=#ff0000><FONT face=Verdana color=#000000>This is a clustered index that CHECKDB&nbsp; will repair by deleting pages at the leaf-level &#8211; essentially deleting a bunch of records. The pages look to be trashed (there were a bunch more errors that I didn&#8217;t include here that said the page headers were all corrupted &#8211; looked like the IO subsystem trashde a whole 64KB chunk of the disk) so there&#8217;s nothing much else you can do. As the table has a clustered index, you can use the error messages to find the pages on either &#8216;logical&#8217; side of the pages being deleted &#8211; and hence figure out the range of records that have been deleted.<BR><BR>The errors show that pages 168576 through 168582 in file 1 are corrupt. There are also errors that say the previous page of 168576 is 168575, and the next page of 168582 is 168583. If you do a <FONT face=\"Courier New\">DBCC PAGE<\/FONT> of these two pages, you can find the lower and upper bound of the clustered index key values that have been lost. Think of three ranges:<\/FONT><\/FONT><\/P><br \/>\n<UL><br \/>\n<LI><FONT face=\"Courier New\" color=#ff0000><FONT face=Verdana color=#000000>the lower range&nbsp;of records that are intact, logically before the corrupt pages in the index<\/FONT><\/FONT><br \/>\n<LI><FONT face=\"Courier New\" color=#ff0000><FONT face=Verdana color=#000000>the range of records that will be deleted by repair<\/FONT><\/FONT><br \/>\n<LI><FONT face=\"Courier New\" color=#ff0000><FONT face=Verdana color=#000000>the upper range of records that are intact, logically after the corrupt pages in the index<WBR><\/FONT><\/FONT><\/LI><\/UL><FONT face=\"Courier New\" color=#ff0000><FONT face=Verdana color=#000000><br \/>\n<P>To find the upper bound of the lower range:<\/P><br \/>\n<BLOCKQUOTE dir=ltr style=\"MARGIN-RIGHT: 0px\"><FONT color=#0000ff size=5><br \/>\n<P><FONT face=\"Courier New\" size=2>DBCC<\/FONT><\/FONT><FONT face=\"Courier New\"> TRACEON <FONT color=#808080>(<\/FONT>3604<FONT color=#808080>);<\/FONT> <FONT color=#008000>&#8212; allows the output to come to the console<BR><\/FONT><\/FONT><FONT color=#0000ff><FONT face=\"Courier New\">DBCC<\/FONT><\/FONT><FONT face=\"Courier New\"> PAGE <FONT color=#808080>(<\/FONT><FONT color=#ff0000>&#8216;dbname&#8217;<\/FONT><FONT color=#808080>,<\/FONT> 1<FONT color=#808080>,<\/FONT> 168575<FONT color=#808080>,<\/FONT> 3<FONT color=#808080>);<BR><\/FONT><\/FONT><FONT size=5><FONT face=\"Courier New\" size=2>GO<\/FONT><\/P><\/BLOCKQUOTE><br \/>\n<P dir=ltr><\/FONT>The key value in the slot at the end of output is the upper bound of the bottom range that&#8217;s intact. <\/P><br \/>\n<P dir=ltr>Then do:<\/P><FONT color=#0000ff size=5><br \/>\n<BLOCKQUOTE dir=ltr style=\"MARGIN-RIGHT: 0px\"><br \/>\n<P><FONT face=\"Courier New\" size=2>DBCC<\/FONT><\/FONT><FONT face=\"Courier New\"> PAGE <FONT color=#808080>(<\/FONT><FONT color=#ff0000>&#8216;dbname&#8217;<\/FONT><FONT color=#808080>,<\/FONT> 1<FONT color=#808080>,<\/FONT> 168583<FONT color=#808080>,<\/FONT> 3<FONT color=#808080>);<BR><\/FONT><\/FONT><FONT size=5><FONT face=\"Courier New\" size=2>GO<\/FONT><\/FONT><\/P><\/BLOCKQUOTE><br \/>\n<P dir=ltr>The key value in the slot at the beginning of the output is the lower bound of the upper range that&#8217;s intact.<BR><BR>Everything in the middle will be deleted. You could also try a <FONT face=\"Courier New\">DBCC PAGE<\/FONT> on the corrupt pages themselves too &#8211; you might be able to see some data in them.<\/P><br \/>\n<P dir=ltr>I&#8217;ll be blogging a bunch more about repair after my corruption session this week at TechEd &#8211; watch this space!<\/FONT><\/P><\/FONT><\/FONT><\/p>\n","protected":false},"excerpt":{"rendered":"<p>(I&#8217;m actually on-stage here at TechEd doing the&nbsp;&nbsp;DAT track pre-con with Kimberly &#8211; she&#8217;s on now until lunch so I&#8217;m catching up on forum problems&#8230;) Here&#8217;s a question that came up on of the SQLServerCentral.com corruption forums I monitor that I think is worth blogging about. To paraphrase: I have a bunch of corruptions in [&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,30,34,35,62,74,100],"tags":[],"class_list":["post-1047","post","type-post","status-publish","format-standard","hentry","category-checkdb-from-every-angle","category-corruption","category-dbcc","category-disaster-recovery","category-on-disk-structures","category-repair","category-undocumented-commands"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>CHECKDB From Every Angle: Using DBCC PAGE to find what repair will delete - 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\/checkdb-from-every-angle-using-dbcc-page-to-find-what-repair-will-delete\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CHECKDB From Every Angle: Using DBCC PAGE to find what repair will delete - Paul S. Randal\" \/>\n<meta property=\"og:description\" content=\"(I&#8217;m actually on-stage here at TechEd doing the&nbsp;&nbsp;DAT track pre-con with Kimberly &#8211; she&#8217;s on now until lunch so I&#8217;m catching up on forum problems&#8230;) Here&#8217;s a question that came up on of the SQLServerCentral.com corruption forums I monitor that I think is worth blogging about. To paraphrase: I have a bunch of corruptions in [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/paul\/checkdb-from-every-angle-using-dbcc-page-to-find-what-repair-will-delete\/\" \/>\n<meta property=\"og:site_name\" content=\"Paul S. Randal\" \/>\n<meta property=\"article:published_time\" content=\"2008-06-09T15:54:32+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\/checkdb-from-every-angle-using-dbcc-page-to-find-what-repair-will-delete\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/checkdb-from-every-angle-using-dbcc-page-to-find-what-repair-will-delete\/\",\"name\":\"CHECKDB From Every Angle: Using DBCC PAGE to find what repair will delete - Paul S. Randal\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#website\"},\"datePublished\":\"2008-06-09T15:54:32+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/checkdb-from-every-angle-using-dbcc-page-to-find-what-repair-will-delete\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/paul\/checkdb-from-every-angle-using-dbcc-page-to-find-what-repair-will-delete\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/checkdb-from-every-angle-using-dbcc-page-to-find-what-repair-will-delete\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CHECKDB From Every Angle: Using DBCC PAGE to find what repair will delete\"}]},{\"@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":"CHECKDB From Every Angle: Using DBCC PAGE to find what repair will delete - 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\/checkdb-from-every-angle-using-dbcc-page-to-find-what-repair-will-delete\/","og_locale":"en_US","og_type":"article","og_title":"CHECKDB From Every Angle: Using DBCC PAGE to find what repair will delete - Paul S. Randal","og_description":"(I&#8217;m actually on-stage here at TechEd doing the&nbsp;&nbsp;DAT track pre-con with Kimberly &#8211; she&#8217;s on now until lunch so I&#8217;m catching up on forum problems&#8230;) Here&#8217;s a question that came up on of the SQLServerCentral.com corruption forums I monitor that I think is worth blogging about. To paraphrase: I have a bunch of corruptions in [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/paul\/checkdb-from-every-angle-using-dbcc-page-to-find-what-repair-will-delete\/","og_site_name":"Paul S. Randal","article_published_time":"2008-06-09T15:54:32+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\/checkdb-from-every-angle-using-dbcc-page-to-find-what-repair-will-delete\/","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/checkdb-from-every-angle-using-dbcc-page-to-find-what-repair-will-delete\/","name":"CHECKDB From Every Angle: Using DBCC PAGE to find what repair will delete - Paul S. Randal","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#website"},"datePublished":"2008-06-09T15:54:32+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/checkdb-from-every-angle-using-dbcc-page-to-find-what-repair-will-delete\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/paul\/checkdb-from-every-angle-using-dbcc-page-to-find-what-repair-will-delete\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/checkdb-from-every-angle-using-dbcc-page-to-find-what-repair-will-delete\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/paul\/"},{"@type":"ListItem","position":2,"name":"CHECKDB From Every Angle: Using DBCC PAGE to find what repair will delete"}]},{"@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\/1047","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=1047"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts\/1047\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/media?parent=1047"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/categories?post=1047"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/tags?post=1047"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}