SQLServer收缩数据库日志的方法
1、查看数据库日志大小
dbcc sqlperf(logspace)
2、收缩数据库
比如数据库名称为ZYWY,则语句如下:
USE ZYWY;
GO
-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE ZYWY
SET RECOVERY SIMPLE;
GO
-- Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (ZYWY_log, 100);
GO
-- Reset the database recovery model.
ALTER DATABASE ZYWY
SET RECOVERY FULL;
GO
来源:CSDN
作者:CodingPioneer
链接:https://blog.csdn.net/zlbdmm/article/details/104608870