收缩数据库日志
--收缩日志文件
--查看日志文件大小
--dbcc sqlperf(logspace)
USE [master]
GO
ALTER DATABASE DNName SET RECOVERY SIMPLE WITH NO_WAIT
GO
ALTER DATABASE DNName SET RECOVERY SIMPLE --简单模式
GO
USE DNName
GO
--收缩日志文件为100M
DBCC SHRINKFILE (N'DNName_Log' , 100, TRUNCATEONLY)
GO
USE [master]
GO
ALTER DATABASE DNName SET RECOVERY FULL WITH NO_WAIT
GO
ALTER DATABASE DNName SET RECOVERY FULL --还原为完全模式
GO