SQL2008:
'在SQL2008中清除日志就必须在简单模式下进行,等清除动作完毕再调回到完全模式。
USE [master]
GO
ALTER DATABASE DBName SET RECOVERY SIMPLE WITH NO_WAIT
GO
ALTER DATABASE DBName SET RECOVERY SIMPLE --简单模式
GO
USE DBName
GO
DBCC SHRINKFILE (N'DBName_Log' , 11, TRUNCATEONLY) GO USE [master]
GO
ALTER DATABASE DBName SET RECOVERY FULL WITH NO_WAIT
GO
ALTER DATABASE DBName SET RECOVERY FULL --还原为完全模式
GO