SQL数据库日志文件收缩

USE [master]
GO
ALTER DATABASE LoganPlanSystem SET RECOVERY SIMPLE WITH NO_WAIT
GO
ALTER DATABASE LoganPlanSystem SET RECOVERY SIMPLE   --简单模式
GO
USE  [LoganPlanSystem]
GO
--收缩日志文件为2G = 2000M
SELECT * FROM sys.database_files--获取日志文件
DBCC SHRINKFILE (N'lc_mds_fc_log' , 2000, TRUNCATEONLY)
GO
USE [master]
GO
ALTER DATABASE LoganPlanSystem SET RECOVERY FULL WITH NO_WAIT
GO
ALTER DATABASE LoganPlanSystem SET RECOVERY FULL  --还原为完全模式
GO

 

展开阅读全文

没有更多推荐了,返回首页