SqlServer 2012 清理日誌 截斷日誌的方法
ALTER DATABASE MEDIA SET RECOVERY SIMPLE WITH NO_WAIT
ALTER DATABASE MEDIA SET RECOVERY SIMPLE --簡單模式
DBCC SHRINKFILE (N'MEDIA_Log' , 11, TRUNCATEONLY) -- 11是大小 11M
ALTER DATABASE MEDIA SET RECOVERY FULL WITH NO_WAIT
ALTER DATABASE MEDIA SET RECOVERY FULL --還原為完全模式
測試語句:資料庫名稱為QJGK_XT
ALTER DATABASE QJGK_XT SET RECOVERY SIMPLE WITH NO_WAIT
ALTER DATABASE QJGK_XT SET RECOVERY SIMPLE --簡單模式
DBCC SHRINKFILE (N'QJGK_XT_Log' , 11, TRUNCATEONLY) -- 11是大小 11M
ALTER DATABASE QJGK_XT SET RECOVERY FULL WITH NO_WAIT
ALTER DATABASE QJGK_XT SET RECOVERY FULL --還原為完全模式