본문 바로가기
프로그래밍/DB

MSSQL 트랜잭션 로그 축소

by Super User 2012. 11. 2.

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