SQLSERVER 2012 收缩日志

9/1/2015来源:SQL技巧人气:1725

SQLSERVER 2012 收缩日志

selectlog_reuse_wait_descfromsys.databaseswherename='tfs_CARDLANWEB'

 

backuplogtfs_CARDLANWEBtodisk='D:\dbbackup\2014-08-24-2.log'

GO

DBCCSHRINKFILE(N'tfs_CARDLANWEB_log' , 1024,TRUNCATEONLY)

 

 

GO

--提示错误就重复操作

 

SELECTname,size/128.0 -CAST(FILEPROPERTY(name,'SpaceUsed')ASint)/128.0 ASAvailableSpaceInMBFROMsys.database_files;