How to shrink tempdb.mdf:
exec backup log tempdb with no_log
then restart SQL Service
如果没有用,再执行:
use tempdb
dbcc shrinkfile(tempdev,1)
How to shrink tempdb.log
1:DBCC SHRINKDATABASE(tempdb,10) ---10 percent
2:DBCC SHRINKFILE (LogicalFileName, NewSize) ---newsize:MB
Why:
tempdb 用来存储临时表数据
每次启动数据库引擎时,它会重置为其初始大小。
exec backup log tempdb with no_log
then restart SQL Service
如果没有用,再执行:
use tempdb
dbcc shrinkfile(tempdev,1)
How to shrink tempdb.log
1:DBCC SHRINKDATABASE(tempdb,10) ---10 percent
2:DBCC SHRINKFILE (LogicalFileName, NewSize) ---newsize:MB
Why:
tempdb 用来存储临时表数据
每次启动数据库引擎时,它会重置为其初始大小。