SQL2008:
'在SQL2008中清除日志就必须在简单模式下进行,等清除动作完毕再调回到完全模式。1 USE [master] 2 GO 3 ALTER DATABASE DBName SET RECOVERY SIMPLE WITH NO_WAIT 4 GO 5 ALTER DATABASE DBName SET RECOVERY SIMPLE --简单模式 6 GO 7 USE DBName 8 GO 9 DBCC SHRINKFILE (N'DBName_Log' , 11, TRUNCATEONLY) 10 11 GO12 13 USE [master]14 GO15 ALTER DATABASE DBName SET RECOVERY FULL WITH NO_WAIT16 GO17 ALTER DATABASE DBName SET RECOVERY FULL --还原为完全模式18 GO