1. 程式人生 > >AlwaysOn環境下的壓縮Log文件方法

AlwaysOn環境下的壓縮Log文件方法

reset class shrink alwayson imp step tab ont mod

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重新加入可用性組

AlwaysOn環境下的壓縮Log文件方法