在sql Server 2008中缩小临时数据库时使用的最佳做法是什么?
使用以下内容有风险吗?
use tempdb GO DBCC FREEPROCCACHE -- clean cache DBCC DROPCLEANBUFFERS -- clean buffers DBCC FREESYSTEMCACHE ('ALL') -- clean system cache DBCC FREESESSIONCACHE -- clean session cache DBCC SHRINKDATABASE(tempdb,10); -- shrink tempdb dbcc shrinkfile ('tempdev') -- shrink db file dbcc shrinkfile ('templog') -- shrink log file GO -- report the new file sizes SELECT name,size FROM sys.master_files WHERE database_id = DB_ID(N'tempdb'); GO