posts - 22, comments - 5, trackbacks - 0, articles - 11

Shrink Log file in MSSQL 2008 R2

Posted on 2014-03-31 10:37 疯狂水车 阅读(180) 评论(0)  编辑 收藏 引用 所属分类: 转载
USE DBName;
GO
-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE DBName
SET RECOVERY SIMPLE;
GO
-- Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (DBName_Log, 1);
GO
-- Reset the database recovery model.
ALTER DATABASE DBName
SET RECOVERY FULL;
GO
只有注册用户登录后才能发表评论。