Sql2008r2|Sql2008r2 数据库清除日志文件亲测有效

USE [master]
GO
ALTER DATABASE [数据库名] SET RECOVERY SIMPLE WITH NO_WAIT
GO
ALTER DATABASE [数据库名] SET RECOVERY SIMPLE
GO
USE [数据库名]
GO
DBCC SHRINKFILE (N'[数据库日志文件名称]' , 0,TRUNCATEONLY)
GO
USE [master]
GO
ALTER DATABASE [数据库名] SET RECOVERY FULL WITH NO_WAIT
GO
ALTER DATABASE [数据库名] SET RECOVERY FULL
GO

--查询指定数据库的日志文件名称
USE [数据库名]
GO
SELECT name FROM SYS.database_files WHERE type_desc='LOG'
【Sql2008r2|Sql2008r2 数据库清除日志文件亲测有效】原文链接:https://www.cnblogs.com/rrxc/p/4554494.html

    推荐阅读