Information générale
Forum:
Microsoft SQL Server
Catégorie:
Maintenance bases de données
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?
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement