Professional Documents
Culture Documents
Shrinking The Transaction Log JJ
Shrinking The Transaction Log JJ
ShrinkingtheTransactionLog
Virtual logs 5 and 6 are freed immediately because they hold no portion of the logical log. To meet the specified target_size, however, virtual log 4 should also be
freed, but cannot because it holds the end portion of the logical log. After freeing virtual logs 5 and 6, SQL Server 2000 fills the remaining part of virtual log 4 with
dummy records. This forces the end of the log file to virtual log 1. In most systems, all transactions starting in virtual log 4 will be committed within seconds,
meaning that all of the active portion of the log moves to virtual log 1, and the log file now looks like this:
The DBCC SHRINKFILE statement also issues an informational message that it could not free all the space requested, and indicate that you can execute a BACKUP
LOG statement to make it possible to free the remaining space. Once the active portion of the log moves to virtual log 1, a BACKUP LOG statement will truncate the
entire logical log that is in virtual log 4:
https://technet.microsoft.com/enus/library/aa174524(d=printer,v=sql.80).aspx
1/2
27/12/2015
ShrinkingtheTransactionLog
Because virtual log 4 no longer holds any portion of the logical log, if you now execute the same DBCC SHRINKFILE statement with a target_size of 275 MB, virtual
log 4 will be freed and the size of the physical log file reduced to the size requested.
See Also
BACKUP
Setting Database Options
Space Allocation and Reuse
Transaction Log Backups
Truncating the Transaction Log
2015 Microsoft
https://technet.microsoft.com/enus/library/aa174524(d=printer,v=sql.80).aspx
2/2