MSSQL2012 截断日志

USE w9157
select * from sys.database_files	--查询Log名称
ALTER DATABASE w9157 SET RECOVERY SIMPLE WITH NO_WAIT
ALTER DATABASE w9157 SET RECOVERY SIMPLE   --简单模式
DBCC SHRINKFILE (N'log' , 11, TRUNCATEONLY)   -- 11是大小  11M
ALTER DATABASE w9157 SET RECOVERY FULL WITH NO_WAIT
ALTER DATABASE w9157 SET RECOVERY FULL  --还原为完全模式