AlwaysOn环境下的压缩Log文件方法

Step1.将DB脱离可用性组
Step2.修改为简单恢复模式>收缩文件>修改回完整恢复模式
-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE [DB]
SET RECOVERY SIMPLE;
GO
-- Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (DB_Log, 100);
GO
-- Reset the database recovery model.
ALTER DATABASE [DB]
SET RECOVERY FULL;
GO
Step3.完整备份
Step4.将DB重新加入可用性组
posted @ 2017-05-31 10:43  芈璐  阅读(589)  评论(0编辑  收藏  举报