Can we run dbcc checkdb on tempdb?

The short answer to this question is “yes but do you really need to do this?”.
Actually checkdb on tempdb does not run properly as you can not have a snapshot of tempdb. Realistically you do not have to bother a lot for a possible corruption of tempdb as it is purely temporarily and it gets recreated from scratch each time you restart the server.

Comments

Jason said…
That is not entirely true. Tempdb files are not deleted on instance restart so the corruption can persist. Tempdb files are also not 0 initialized so the corruption can persist.
http://www.sqlsoldier.com/wp/sqlserver/day14of31daysofdisasterrecoveryfixingacorrupttempdb
http://sqlblog.com/blogs/jonathan_kehayias/archive/2010/05/13/does-the-tempdb-log-file-get-zero-initialized-at-startup.aspx
UC said…
Thanks Jason. Sorry for delay in publishing your post but both links you gave here are very informative.
I will run a test by myself sometime later and have another post on this with observations.

Popular Posts