프로그래밍/MS_SQL
mssql 2008 로그 축소
GOHA
2013. 4. 29. 11:21
728x90
--2008 이전 버젼의 경우
BACKUP LOG EchoRPT WITH NO_LOG
DBCC SHRINKDATABASE (EchoRPT, TRUNCATEONLY)
--2008 버젼의 경우
GO
-- 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, 1); --1mb로 축소
GO
-- Reset the database recovery model.
ALTER DATABASE DB이름
SET RECOVERY FULL;
GO
728x90