I am in the process of rolling out DBCC CHECKDB across our instances.
Each database will eventually either have a DBCC CHECKDB or DBCC CHECKDB PHYSICAL_ONLY.
The way I have been gauging whether a FULL CHECKDB should be done, or a PHYSICAL_ONLY is by examining the results from DBCC CHECKDB WITH ESTIMATEONLY.
However I ran this yesterday on SQL Server 2008 (SP1) and the tempdb estimation for a certain database was 510MB.
However in practice it filled the entire 19GB drive so the estimation was way off!
I was under the impression the ESTIMATEONLY bug was in SQL 2008 R2, not the standard 2008 ?
Is there another way to gauge tempdb usage? Some sort of database size to tempdb usage ratio: (I.e if I have a 500GB database how much tempdb consumption should I be expecting?)
I also need to implement test restores because we don't do that here. Once I have that server in place I will switch to PHYSICAL_ONLY for everything then do a full CHECKDB on the restored database.
Thank you
Best Answer
What we do to estimate the usage of tempdb and its size is to track its growth via data tracked in tables for a period of time before reboot happens as a part of maintenance activity.
P.S note: It may not be an alternative, but helps in tracking how tempdb grows over a period of time
Step 1 Create table to store the data:
Step 2 Create SP to catch the tempdb data and log file usage within above created table:
Step 3: Execute the above SP via SQL agent job: we schedule it to run every 4 hours. Therefore by the end of the week we have enough data to predict how much tempdb is growing and thus estimating accordingly.
Just execute
to view the stored results