SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2012 Forums
 SQL Server Administration (2012)
 Back up log, not truncating log file
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

masterdineen
Aged Yak Warrior

United Kingdom
548 Posts

Posted - 01/18/2013 :  16:52:57  Show Profile  Reply with Quote
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

United Kingdom
548 Posts

Posted - 01/18/2013 :  17:39:24  Show Profile  Reply with Quote
sorry. Iam using developer 2008
Go to Top of Page

robvolk
Most Valuable Yak

USA
15678 Posts

Posted - 01/18/2013 :  17:43:04  Show Profile  Visit robvolk's Homepage  Reply with Quote
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

United Kingdom
548 Posts

Posted - 01/18/2013 :  17:53:18  Show Profile  Reply with Quote
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

USA
15678 Posts

Posted - 01/18/2013 :  18:01:47  Show Profile  Visit robvolk's Homepage  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000