{"id":485,"date":"2012-06-05T05:31:00","date_gmt":"2012-06-05T05:31:00","guid":{"rendered":"\/blogs\/paul\/post\/Why-are-so-many-DBCC-commands-undocumented.aspx"},"modified":"2017-08-11T10:21:52","modified_gmt":"2017-08-11T17:21:52","slug":"why-are-so-many-dbcc-commands-undocumented","status":"publish","type":"post","link":"https:\/\/www.sqlskills.com\/blogs\/paul\/why-are-so-many-dbcc-commands-undocumented\/","title":{"rendered":"Why are so many DBCC commands undocumented?"},"content":{"rendered":"<p style=\"text-align: justify;\">Last week on the MVP distribution alias there was a discussion on undocumented <em>DBCC<\/em> commands and someone asked why so many potentially useful DBCC commands are undocumented. I briefly explained why, and I&#8217;ve discussed this openly during classes and conferences too and don&#8217;t consider it an NDA explanation, so I thought I&#8217;d share it with you.<\/p>\n<p style=\"text-align: justify;\"><em>DBCC<\/em> commands have been around for a long, long time. Its way easier to add a <em>DBCC<\/em> command than it is to add any other way of getting SQL Server to do something through T-SQL.<\/p>\n<p style=\"text-align: justify;\">So the easiest way to make SQL Server change its behavior in some way, or get access to some internal data structures, is to write a <em>DBCC<\/em> command to print them out. The vast majority of the undocumented <em>DBCC<\/em> commands exist to help testing (the multitude of test teams inside the SQL Server Product Group) and debugging (Product Support and SQL Server team developers).<\/p>\n<p style=\"text-align: justify;\"><em>DBCC<\/em> doesn&#8217;t use the same parsing mechanism that everything else in the Engine does (i.e. the parser and algebrizer in the Query Processor). It does all it&#8217;s own parsing, permission checking, parameter checking, and code calling &#8211; I rewrote this entire mechanism during SQL Server 2005 development to be standardized and easily extensible &#8211; ironically making it even easier to add <em>DBCC<\/em> commands!<\/p>\n<p style=\"text-align: justify;\">When I rewrote all this code, I cleaned up a bunch of commands that weren&#8217;t being used any more (e.g. <em>DBCC NEWALLOC<\/em>, <em>DBCC TEXTALLOC<\/em>) and some that were used but were dangerous (e.g. <em>DBCC PINTABLE<\/em> &#8211; which I explained about <a href=\"https:\/\/www.sqlskills.com\/blogs\/paul\/dbcc-pintable\/\">here<\/a>). As part of that effort I canvassed the entire team to see which commands weren&#8217;t wanted any more. I also figured out which commands should be documented &#8211; there were five on the short list.<\/p>\n<p style=\"text-align: justify;\">At the top of the short list were <em>DBCC PAGE<\/em> and <em>DBCC IND<\/em>, which you&#8217;ve seen me use a lot on the blog here, and that are the two most well-known undocumented <em>DBCC<\/em> commands out there. There simply wasn&#8217;t enough justification of the engineering effort required to document them. The same thing happened in SQL Server 2008 development &#8211; not enough time.<\/p>\n<p style=\"text-align: justify;\">Not enough time for what? Well, it takes a lot of work to make an undocumented command become documented:<\/p>\n<ul style=\"text-align: justify;\">\n<li>Documentation: The Books Online entry needs to be created with appropriate examples<\/li>\n<li>Testing: There are\u00a0an infinity of test cases for any feature, considering combinations of all other features, and these have to be whittled down to a representative set. For <em>DBCC PAGE<\/em>, that includes some corruptions, and all types of pages. That&#8217;s a lot of work.<\/li>\n<li>Hardening: The <em>DBCC PAGE<\/em> code is pretty robust, but &#8216;pretty robust&#8217; isn&#8217;t good enough for a documented command &#8211; it has to 100% not cause problems on a production server. I&#8217;m confident that it won&#8217;t but it would have to be tested extensively to make doubly-sure.<\/li>\n<li>Keeping up: As a documented command, any time any page structure changes, then <em>DBCC PAGE<\/em> has to cope with it.<\/li>\n<\/ul>\n<p style=\"text-align: justify;\">And all this engineering effort was (and probably always will be) deemed less important than other features.<\/p>\n<p style=\"text-align: justify;\">The thing to consider is what practical use to the majority of SQL Server customers would any undocumented <em>DBCC<\/em> command be if it were to be documented? In some corruption scenarios, yes, but mostly it&#8217;s in working out what&#8217;s going on under the covers of SQL Server &#8211; and that&#8217;s not a compelling business case.<\/p>\n<p style=\"text-align: justify;\">I&#8217;m not holding my breath on any of the undocumented <em>DBCC<\/em> commands becoming documented, and I hope this explains why.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last week on the MVP distribution alias there was a discussion on undocumented DBCC commands and someone asked why so many potentially useful DBCC commands are undocumented. I briefly explained why, and I&#8217;ve discussed this openly during classes and conferences too and don&#8217;t consider it an NDA explanation, so I thought I&#8217;d share it with [&hellip;]<\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34,100],"tags":[],"class_list":["post-485","post","type-post","status-publish","format-standard","hentry","category-dbcc","category-undocumented-commands"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Why are so many DBCC commands undocumented? - 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\/why-are-so-many-dbcc-commands-undocumented\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Why are so many DBCC commands undocumented? - Paul S. Randal\" \/>\n<meta property=\"og:description\" content=\"Last week on the MVP distribution alias there was a discussion on undocumented DBCC commands and someone asked why so many potentially useful DBCC commands are undocumented. I briefly explained why, and I&#8217;ve discussed this openly during classes and conferences too and don&#8217;t consider it an NDA explanation, so I thought I&#8217;d share it with [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqlskills.com\/blogs\/paul\/why-are-so-many-dbcc-commands-undocumented\/\" \/>\n<meta property=\"og:site_name\" content=\"Paul S. Randal\" \/>\n<meta property=\"article:published_time\" content=\"2012-06-05T05:31:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-08-11T17:21:52+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\/why-are-so-many-dbcc-commands-undocumented\/\",\"url\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/why-are-so-many-dbcc-commands-undocumented\/\",\"name\":\"Why are so many DBCC commands undocumented? - Paul S. Randal\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#website\"},\"datePublished\":\"2012-06-05T05:31:00+00:00\",\"dateModified\":\"2017-08-11T17:21:52+00:00\",\"author\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/why-are-so-many-dbcc-commands-undocumented\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqlskills.com\/blogs\/paul\/why-are-so-many-dbcc-commands-undocumented\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/why-are-so-many-dbcc-commands-undocumented\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqlskills.com\/blogs\/paul\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Why are so many DBCC commands undocumented?\"}]},{\"@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":"Why are so many DBCC commands undocumented? - 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\/why-are-so-many-dbcc-commands-undocumented\/","og_locale":"en_US","og_type":"article","og_title":"Why are so many DBCC commands undocumented? - Paul S. Randal","og_description":"Last week on the MVP distribution alias there was a discussion on undocumented DBCC commands and someone asked why so many potentially useful DBCC commands are undocumented. I briefly explained why, and I&#8217;ve discussed this openly during classes and conferences too and don&#8217;t consider it an NDA explanation, so I thought I&#8217;d share it with [&hellip;]","og_url":"https:\/\/www.sqlskills.com\/blogs\/paul\/why-are-so-many-dbcc-commands-undocumented\/","og_site_name":"Paul S. Randal","article_published_time":"2012-06-05T05:31:00+00:00","article_modified_time":"2017-08-11T17:21:52+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\/why-are-so-many-dbcc-commands-undocumented\/","url":"https:\/\/www.sqlskills.com\/blogs\/paul\/why-are-so-many-dbcc-commands-undocumented\/","name":"Why are so many DBCC commands undocumented? - Paul S. Randal","isPartOf":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#website"},"datePublished":"2012-06-05T05:31:00+00:00","dateModified":"2017-08-11T17:21:52+00:00","author":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/#\/schema\/person\/ffcec826c18782e1e0adf173826a7fce"},"breadcrumb":{"@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/why-are-so-many-dbcc-commands-undocumented\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqlskills.com\/blogs\/paul\/why-are-so-many-dbcc-commands-undocumented\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqlskills.com\/blogs\/paul\/why-are-so-many-dbcc-commands-undocumented\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqlskills.com\/blogs\/paul\/"},{"@type":"ListItem","position":2,"name":"Why are so many DBCC commands undocumented?"}]},{"@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\/485","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=485"}],"version-history":[{"count":0,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/posts\/485\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/media?parent=485"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/categories?post=485"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.sqlskills.com\/blogs\/paul\/wp-json\/wp\/v2\/tags?post=485"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}