【转】SQL数据库日志文件收缩

时间:2023-02-03 16:41:29
USE [master]
GO
ALTER DATABASE MDM_OperationBase SET RECOVERY SIMPLE WITH NO_WAIT
GO
ALTER DATABASE MDM_OperationBase SET RECOVERY SIMPLE --简单模式
GO
USE MDM_OperationBase
GO
--收缩日志文件为2G = 2000M
DBCC SHRINKFILE (N'MDM_OperationBase_Log' , 2000, TRUNCATEONLY)
GO
USE [master]
GO
ALTER DATABASE MDM_OperationBase SET RECOVERY FULL WITH NO_WAIT
GO
ALTER DATABASE MDM_OperationBase SET RECOVERY FULL --还原为完全模式
GO

转自:https://blog.csdn.net/chadcao/article/details/80029639