SQL Server 2008에서 로그 파일 자르기
1. 복구 모델을 SIMPLE로 변경후 DBCC SHRINKFILE/SHRINKDATABASE 수행
-- BACKUP LOG [dbname] WITH NO_LOG/TRUNCATE_ONLY는 2008부터 지원 안함.
ALTER DATABASE [dbname] SET RECOVERY SIMPLE WITH NO_WAIT;
GO
DBCC SHRINKDATABASE([dbname], 10, TRUNCATEONLY); -- or
DBCC SHRINKFILE([dbname_Log, 10);
GO
ALTER DATABASE [dbname] SET RECOVERY FULL WITH NO_WAIT';
GO
2. BACKUP LOG [dbname] TO DISK='NUL' 수행 후 DBCC SHRINKFILE/SHRINKDATABASE 수행
-- it became deprecated because of 'misuse' in 2005 & removed in 2008.
You can achieve the same result by sending the file to the NUL blackhole
BACKUP LOG [dbname] TO DISK='NUL';