收缩sqlserver事务日志
2017-06-06 15:40 abce 阅读(485) 评论(0) 编辑 收藏 举报若要允许 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