--為保險起見,要先備份DB的log檔
--查看recovery_model
SELECT recovery_model_desc FROM sys.databases WHERE name = 'CustomLogging'
--設定查看recovery_model為SIMPLE
ALTER DATABASE CustomLogging SET recovery SIMPLE
--查看修改後的recovery_model
SELECT recovery_model_desc FROM sys.databases WHERE name = 'CustomLogging'
--查看硬碟空間
EXEC xp_fixeddrives
-- 記下尚未壓縮LOG檔之前的LOG檔大小
EXEC sp_helpdb CustomLogging
-- 壓縮LOG檔
DBCC shrinkfile(CustomLogging_log, 0)
-- 記下壓縮LOG檔之前的LOG檔大小
EXEC sp_helpdb CustomLogging
--查看硬碟空間
EXEC xp_fixeddrives
沒有留言:
張貼留言