Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2012 Forums
 SQL Server Administration (2012)
 Back up log, not truncating log file

Author  Topic 

masterdineen
Aged Yak Warrior

550 Posts

Posted - 2013-01-18 : 16:52:57
Hello there

this must be a simple thing. But i have a log file of 30 gig from developing and heavy updating.

so i backed up the transaction log via ssms.

i made sure that Truncate the transaction log is selected.

but once the back finished.

i looked at the log file within the data folder.

and it still says 30 gig.

what am i doing wrong?

masterdineen
Aged Yak Warrior

550 Posts

Posted - 2013-01-18 : 17:39:24
sorry. Iam using developer 2008
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2013-01-18 : 17:43:04
Backing up the log does not physically shrink the log file. You need to use DBCC SHRINKFILE in order to reduce the size.

If this is strictly a development server you could set your database to Simple recovery, this will reduce or prevent the log from growing in the first place.
Go to Top of Page

masterdineen
Aged Yak Warrior

550 Posts

Posted - 2013-01-18 : 17:53:18
I thought when you backup the transaction log. the log is then truncated

or is that only with log shipping?
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2013-01-18 : 18:01:47
Truncating the log is a misnomer. Backing up the log clears the internal contents of the log file, but performs no physical modifications beyond that.

If you want to know more about how the transaction log works in SQL Server:

http://msdn.microsoft.com/en-us/library/ms189085%28v=sql.105%29.aspx
http://www.sqlskills.com/blogs/paul/category/transaction-log/
Go to Top of Page
   

- Advertisement -