DBCC SHRINKFILE tries to shrink each physical log file to its target size immediately. However, if part of the logical log resides in the virtual logs beyond the target size, the Database Engine frees as much space as possible, and then issues an informat
若要允许 DBCC SHRINKFILE 命令收缩文件,首先需要通过将数据库恢复模式设置为 SIMPLE 来截断该文件。 -- Truncate the log by changing the database recovery model to SIMPLE. -- Shrink the truncated log file to 1 MB. -- Reset the database recovery model. 注意:从设置数据库到简单恢复,缩小文件,再设置完全恢复,实际上有部分日志数据是丢失的,
You can shrink a transaction log file while the system is in use (DML commands are also being executed), however this will only affect the inactive portion of the transaction log file.