Every so often I’ll see posts on the various data corruption forums discussing causes of corruption. In this post I want to debunk some of the myths around what can cause corruption. There are really two types of corruption to deal with, physical corruption and logical corruption. Physical corruption This is where something has altered the contents of a data or log file sector with no regard for what is being stored there. Possible causes of physical corruption are: Physical corruption is what DBCC CHECKDB usually reports and the majority of cases are caused by a physical failures of some kind, with the minority caused by humans – software bugs. Logical corruption This is where something has altered some data so that a data relationship is broken. Possible causes of logical corruption are: :-) Okay… The point here is that a physical failure of a component does not cause logical corruption, it causes physical corruption. Conversely, application errors cause logical corruption, not physical corruption. DBCC CHECKDB errors are about physical corruption (okay, with the inclusion of DBCC CHECKCATALOG code in 2005, it will find cases where the DBA has manually altered the system tables, causing logical corruption) and applications cannot cause physical corruption as they can only manipulate data through SQL Server. If an application hits a SQL Server bug which causes physical corruption, that’s still not the application causing physical corruption, it’s SQL Server. So – on to the myths. Hope this helps.
Black Friday Super Sale!
It’s the time of year again where companies do crazy sales on the day after Thanksgiving in the US, and we’re doing the same! All
8 thoughts on “Search Engine Q&A #26: Myths around causing corruption”
Hi Paul – what do you mean by a data sector (in the physical corruption section)? A portion of a data page ? thanks
Yes.
cool thanks – just swotting up before my checkdb presentation. I appreciate the reply.
Hey Paul, I also heard from another DBA that having a max file size on your t-logs can cause corruption when the max size is exceeded. I disagree, but I am unable to find any documentation either way.
I believe an exception is created, and the transaction is backed out, but can you verify either way?
Nope – it won’t cause corruption. If the log file runs out of space, all active transactions are rolled back (and there’s enough space reserved to be able to do that).
Hi Paul,
I didn’t find so much about the issue of DB corruption during usage command DBCC SHRINGFILE with emty file. I moved all data from 4 files to only one and back to 4 files because I want use traceflag 1117 and 1118 to asure the best db performance. But during this move was data in random indexes corrupeted. Once it was also data in change_track table. Do know reason of this issue? It is MSSQL 2014 SP4 used for MS SCCM.
Thank you for your opinion.
BR Page
Haven’t heard of this scenario or any bugs causing corruption shrink. Suggest you contact Product Support for assistance.
Thank you. I’ll test it in singleuser mode, and in case that will help, I’ll not bothering anyone. In other case, when it won’t help, I’ll open case with MS.