Log file size  
Author Message
ubmatrix





PostPosted: Thu Jan 26 22:02:54 CST 2006 Top

SQL Server Developer >> Log file size

I find that the following commands successfully decrease the size of the log
file:
- Backup Log MyDB With Truncate_Only
- DBCC SHRINKDATABASE (MyDB)

However the following commands (exec one after one) can't decrease the size
of the log file:
- DBCC SHRINKDATABASE (MyDb, TruncateOnly)
- DBCC SHRINKDATABASE (MyDB)

Can anybody explain why?

Thanks,
KM

SQL Server9  
 
 
Dan





PostPosted: Thu Jan 26 22:02:54 CST 2006 Top

SQL Server Developer >> Log file size You can use DBCC SHRINKFILE to shrink a log file. See the Books Online for
usage information.

--
Hope this helps.

Dan Guzman
SQL Server MVP



>I find that the following commands successfully decrease the size of the
>log
> file:
> - Backup Log MyDB With Truncate_Only
> - DBCC SHRINKDATABASE (MyDB)
>
> However the following commands (exec one after one) can't decrease the
> size
> of the log file:
> - DBCC SHRINKDATABASE (MyDb, TruncateOnly)
> - DBCC SHRINKDATABASE (MyDB)
>
> Can anybody explain why?
>
> Thanks,
> KM
>
>


 
 
KenJ





PostPosted: Thu Jan 26 22:06:05 CST 2006 Top

SQL Server Developer >> Log file size the TLog is made up internally of virtual log files. truncating the
log frees up the virtual files so shrinkdatabase/shrinkfile can take
back the space. if you run shrinkdatabase/shrinkfile without first
freeing up the virtual files, the space those virtual files take up
cannot be reallocated to the OS.

BOL has a GREAT explanation at
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/architec/8_ar_da2_1uzr.asp