SQL Server 2008 R2 下如何清理数据库日志文件
时间:2021-07-01 10:21:17
帮助过:4人阅读
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‘
08R2通过,其他版本未测试
SQL Server 2008 R2 下如何清理数据库日志文件
标签: