你的位置:首页 > 数据库

[数据库]SQLSERVER 2012 收缩日志

select log_reuse_wait_desc from sys.databases where name='tfs_CARDLANWEB'

 

backup log tfs_CARDLANWEB to disk='D:\dbbackup\2014-08-24-2.log'

GO

DBCC SHRINKFILE (N'tfs_CARDLANWEB_log' , 1024, TRUNCATEONLY)

 

 

GO

--提示错误就重复操作

 

SELECT name ,size/128.0 - CAST(FILEPROPERTY(name, 'SpaceUsed') AS int)/128.0 AS AvailableSpaceInMB FROM sys.database_files;