收缩临时库 shrink tempdb
tempdb實(shí)際占用空間40mb,文件大小70G, 原始大小2GB
無法使用dbcc shrinkfile進(jìn)行收縮.
?
看到的解決方案是
- 重啟數(shù)據(jù)庫
- DBCC FREESYSTEMCACHE ('ALL') ,然后再收縮.
http://social.msdn.microsoft.com/Forums/en/sqldatabaseengine/thread/7b45f0de-2aa3-4de0-930b-d9d0fe931b3a
http://support.microsoft.com/kb/328551/en-us
http://blogs.msdn.com/b/sqlserverstorageengine/archive/2008/12/22/tempdb-basics-cont.aspx
?
從sqlserver 2005起,會(huì)緩存一些臨時(shí)表的iam頁,導(dǎo)致這些被緩存的頁沒有辦法被回收...
?Improved caching for temporary objects. SQL Server caches 1 IAM page and 1 data page with the associated query plan. The benefit of this is significant. First, if the same plan is executed multiple times, the temporary table needs to be created once there by reducing DDL contention. Imagine if a temporary table with say 5 columns gets created/destroyed every time, SQL Server will need to insert one row system table for ‘tables’ and 5 rows for columns in ‘columns’ and then remove these entries when table is removed. Second, it reduces allocation overhead.?Let me illustrate this with the following example
轉(zhuǎn)載于:https://www.cnblogs.com/stswordman/archive/2010/11/11/1874819.html
總結(jié)
以上是生活随笔為你收集整理的收缩临时库 shrink tempdb的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 百合中国画是谁画的啊?
- 下一篇: 物体控制