收缩sqlserver事务日志

若要允许 DBCC SHRINKFILE 命令收缩文件,首先需要通过将数据库恢复模式设置为 SIMPLE 来截断该文件。

示例,收缩数据库abce的事务日志

USE abce;
GO
-- Truncate the log by changing the database recovery model to SIMPLE.
ALTER DATABASE abce
SET RECOVERY SIMPLE;
GO
-- Shrink the truncated log file to 1 MB.
DBCC SHRINKFILE (abce_Log, 1);
GO
-- Reset the database recovery model.
ALTER DATABASE abce
SET RECOVERY FULL;
GO

  

上一篇:Percona-mysql server 5.5升级5.6


下一篇:sql 事务日志传输