General information
Forum:
Microsoft SQL Server
Category:
Database management
See if the file shrinks some time after you truncate (i.e., truncate, wait a while, and then check).
The reason why is that not all the data in the log is removed. Some of the log is still needed to maintain the integrity of the db. When you truncate the log, SQL Server marks any pages it doesn't need as junk, and then tries to shrink the log until it hits a page it needs. The problem is that if the "junk" is in the middle, then it doesn't get deleted.
I.E.
Log:
[need] [junk] [junk] [junk] [need] : This file doesn't get shrunk
Once a [need] is cleared (which will probably happen as the database is used), then SQL Server can clear out the junk pages inbetween. Also, IIRC, BOL has some stuff regarding this behavior if you need to find out more.
HTH,
John Barone
>Hello,
>
>I have log file more that 4GB while data file is 4.5GB.
>I've tried to truncate log file, but size of the file doesn't chenged.
>Where is the problem?
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only