{"id":865,"date":"2009-05-12T16:56:00","date_gmt":"2009-05-12T16:56:00","guid":{"rendered":"\/blogs\/paul\/post\/How-to-get-all-the-corruption-messages-from-CHECKDB.aspx"},"modified":"2009-05-12T16:56:00","modified_gmt":"2009-05-12T16:56:00","slug":"how-to-get-all-the-corruption-messages-from-checkdb","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/paul\/how-to-get-all-the-corruption-messages-from-checkdb\/","title":{"rendered":"How to get all the corruption messages from CHECKDB"},"content":{"rendered":"<p>\n<font face=\"verdana,geneva\" size=\"2\">Hopefully all of you reading my blog already know to use the <font face=\"courier new,courier\">WITH ALL_ERRORMSGS<\/font> option whenever you run <font face=\"courier new,courier\">DBCC CHECKDB<\/font> (which is now the default in 2005 SP3, haven&#39;t checked if it made it into 2008 SP1). If you&#39;re doing some quick analysis of the results to see, for example, whether it&#39;s just nonclustered indexes that are corrupt then you need to see all the errors &#8211; as it may look like all the errors are (relatively) benign but there&#39;s one error you didn&#39;t see that says a clustered index data page is corrupt.<\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">That option is all well and good *except* when you run the <font face=\"courier new,courier\">DBCC<\/font> command through SSMS. It will only show the first 1000 errors (long story, but let&#39;s just says it involves me being able to create corruption cases during 2005 development that would generate so many errors it would cause SSMS to crash) and there&#39;s no way to get around this. So, if you have more than 1000 errors, as in a case I&#39;m helping with today where there are 19000+ errors, you can&#39;t use SSMS and expect to get them all back. Problem is, you don&#39;t know that you&#39;ve got that many errors until you run it &#8211; so if you used SSMS and find there are more than 1000 errors, AND you want to do some analysis of them, you&#39;ll need to go and run it again using a different connection to the server.<\/font>\n<\/p>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">So &#8211; something I advise is to run <font face=\"courier new,courier\">DBCC<\/font> from the command line. <\/font><font face=\"verdana,geneva\" size=\"2\">Either <font face=\"courier new,courier\">osql<\/font> or <font face=\"courier new,courier\">sqlcmd<\/font> will do the trick. For instance:<\/font>\n<\/p>\n<blockquote>\n<p>\n\t<font face=\"courier new,courier\" size=\"2\">osql -E -Q&quot;DBCC CHECKDB (master) WITH ALL_ERRORMSGS, NO_INFOMSGS&quot; -oC:\\outputfile.txt<\/font>\n\t<\/p>\n<\/blockquote>\n<p>\n<font face=\"verdana,geneva\" size=\"2\">This will run the DBCC command and store the output in a file for later analysis. You can substitute <font face=\"courier new,courier\">sqlcmd<\/font> for <font face=\"courier new,courier\">osql<\/font> in the command above if you want.<\/font><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hopefully all of you reading my blog already know to use the WITH ALL_ERRORMSGS option whenever you run DBCC CHECKDB (which is now the default in 2005 SP3, haven&#39;t checked if it made it into 2008 SP1). If you&#39;re doing some quick analysis of the results to see, for example, whether it&#39;s just nonclustered indexes [&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,34,35,52,95],"tags":[],"class_list":["post-865","post","type-post","status-publish","format-standard","hentry","category-checkdb-from-every-angle","category-dbcc","category-disaster-recovery","category-involuntary-dba","category-tools"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to get all the corruption messages from 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\/how-to-get-all-the-corruption-messages-from-checkdb\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to get all the corruption messages from CHECKDB - Paul S. Randal\" \/>\n<meta property=\"og:description\" content=\"Hopefully all of you reading my blog already know to use the WITH ALL_ERRORMSGS option whenever you run DBCC CHECKDB (which is now the default in 2005 SP3, haven&#039;t checked if it made it into 2008 SP1). If you&#039;re doing some quick analysis of the results to see, for example, whether it&#039;s just nonclustered indexes [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/paul\/how-to-get-all-the-corruption-messages-from-checkdb\/\" \/>\n<meta property=\"og:site_name\" content=\"Paul S. Randal\" \/>\n<meta property=\"article:published_time\" content=\"2009-05-12T16:56:00+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\/how-to-get-all-the-corruption-messages-from-checkdb\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/how-to-get-all-the-corruption-messages-from-checkdb\/\",\"name\":\"How to get all the corruption messages from CHECKDB - Paul S. Randal\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#website\"},\"datePublished\":\"2009-05-12T16:56:00+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/how-to-get-all-the-corruption-messages-from-checkdb\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/paul\/how-to-get-all-the-corruption-messages-from-checkdb\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/how-to-get-all-the-corruption-messages-from-checkdb\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to get all the corruption messages from 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":"How to get all the corruption messages from 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\/how-to-get-all-the-corruption-messages-from-checkdb\/","og_locale":"en_US","og_type":"article","og_title":"How to get all the corruption messages from CHECKDB - Paul S. Randal","og_description":"Hopefully all of you reading my blog already know to use the WITH ALL_ERRORMSGS option whenever you run DBCC CHECKDB (which is now the default in 2005 SP3, haven&#39;t checked if it made it into 2008 SP1). If you&#39;re doing some quick analysis of the results to see, for example, whether it&#39;s just nonclustered indexes [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/paul\/how-to-get-all-the-corruption-messages-from-checkdb\/","og_site_name":"Paul S. Randal","article_published_time":"2009-05-12T16:56:00+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\/how-to-get-all-the-corruption-messages-from-checkdb\/","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/how-to-get-all-the-corruption-messages-from-checkdb\/","name":"How to get all the corruption messages from CHECKDB - Paul S. Randal","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#website"},"datePublished":"2009-05-12T16:56:00+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/how-to-get-all-the-corruption-messages-from-checkdb\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/paul\/how-to-get-all-the-corruption-messages-from-checkdb\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/how-to-get-all-the-corruption-messages-from-checkdb\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/paul\/"},{"@type":"ListItem","position":2,"name":"How to get all the corruption messages from 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\/865","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=865"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts\/865\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/media?parent=865"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/categories?post=865"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/tags?post=865"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}