USE [master]
GO
ALTER DATABASE DBname SET RECOVERY SIMPLE WITH NO_WAIT
GO
ALTER DATABASE DBname SET RECOVERY SIMPLE --简单模式
GO
USE DBname
GO
DBCC SHRINKFILE (N'RmyyHisDW_Log' , 11, TRUNCATEONLY)
GO
USE [master]
GO
ALTER DATABASE RmyyHisDW SET RECOVERY FULL WITH NO_WAIT
GO
ALTER DATABASE RmyyHisDW SET RECOVERY FULL --还原为完全模式
GO
----------------------------------------------------------------------------------------------------------------
手动的话就是
USE [master]
GO
ALTER DATABASE DBname SET RECOVERY SIMPLE WITH NO_WAIT
GO
ALTER DATABASE DBname SET RECOVERY SIMPLE --简单模式
GO
右键-任务-收缩-文件-选数据-确定
右键-任务-收缩-文件-选日志-确定
ALTER DATABASE DBname SET RECOVERY FULL WITH NO_WAIT
GO
ALTER DATABASE DBname SET RECOVERY FULL --还原为完全模式
GO