Sql Server 压缩日志文件

USE [master]
GO
ALTER DATABASE [2020] SET RECOVERY SIMPLE WITH NO_WAIT
GO
ALTER DATABASE [2020] SET RECOVERY SIMPLE
GO
USE [2020]
GO
DBCC SHRINKFILE (2020_log’ , 11, TRUNCATEONLY)
GO
USE [master]
GO
ALTER DATABASE [2020] SET RECOVERY FULL WITH NO_WAIT
GO
ALTER DATABASE [2020] SET RECOVERY FULL
GO

–将2020替换成子自己需要的数据库