少於 1 分鐘閱讀

先轉為簡易模式,縮小後,再改回完整模式

USE YOUR_DB;
GO
-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE YOUR_DB
SET RECOVERY SIMPLE;
GO
-- Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (YOUR_DB_Log, 1);
GO
-- Reset the database recovery model.
ALTER DATABASE YOUR_DB
SET RECOVERY FULL;
GO

參考:

  1. https://dotblogs.com.tw/chou/archive/2011/01/09/20693.aspx

更新時間:

留言