SQL数据库日志文件收缩

时间:2022-07-03 21:43:45
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