As a SQL Server professional, I often come across various issues and bugs that can be quite puzzling. Recently, I encountered a strange bug related to the DBCC CHECKDB command in SQL Server 2017. In this blog post, I will share my experience and explain the details of this bug.
One of my clients, who had previously used my Comprehensive Database Performance Health Check service, reached out to me with a peculiar problem. They were facing an error when running DBCC CHECKDB WITH PHYSICAL_ONLY, but the same command succeeded when running DBCC CHECKDB. This inconsistency was quite surprising, as usually, if DBCC CHECKDB WITH PHYSICAL_ONLY fails, it is also caught by DBCC CHECKDB.
Upon further investigation, I discovered that the issue was related to the presence of a ColumnStore index on one of the tables in the database. When we removed the ColumnStore index, the error disappeared. Intrigued by this behavior, I decided to search for more information on the internet.
My search led me to a bug report related to the latest version of SQL Server 2017. It turns out that if a database contains a table with a clustered ColumnStore index, running the statement DBCC CHECKDB WITH ALL_ERRORMSGS, NO_INFOMSGS, PHYSICAL_ONLY generates a dump file with an error message. This bug has been acknowledged by Microsoft, and they claim to have fixed it in Cumulative Update 11. However, it seems that the bug still persists in the latest version of SQL Server.
Until this bug is completely resolved, I recommend relying solely on DBCC CHECKDB without the PHYSICAL_ONLY option. This will ensure that you do not encounter any unexpected errors related to ColumnStore indexes.
As SQL Server professionals, it is important for us to stay updated with the latest bugs and issues in the software we work with. By being aware of such problems, we can avoid potential pitfalls and provide better solutions to our clients.
I hope this blog post has shed some light on the strange bug related to DBCC CHECKDB WITH PHYSICAL_ONLY in SQL Server 2017. If you have any questions or have encountered similar issues, feel free to leave a comment below.