SQL server 数据库日志文件过大清空日志文件
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 GO 12 13 USE [master] 14 GO 15 ALTER DATABASE DBName SET RECOVERY FULL WITH NO_WAIT 16 GO 17 ALTER DATABASE DBName SET RECOVERY FULL --还原为完全模式 18 GO