If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Microsoft SQL Server > Log File Growing Uncontrollably

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old
Registered User
 
Join Date: May 2008
Posts: 97
Log File Growing Uncontrollably

Hi,
My log file was 2x the size of my actual Database which is obviously too large on a DEV box. I know that my data can be easily recovered so I actually do not even want/need a log file.

After doing some investigation I found that I should turn my database into "Simple Recovery Mode" and after this I used a few scripts to truncate my log file. Things at this point looked great!

Unfortunately my log File is still growing even with this 'simple recovery mode'. So how do I stop this craziness from occurring?

I even unchecked the box 'allow autogrowth' on the database! However, I eventually get errors when creating records in the system because it complains about running out of room in the log file.
Code:
 The transaction log for database 'ReportingDB' is full. To find out why space in the log cannot be reused, see the log_reuse_wait_desc column in sys.databases
Please help me stop this madness
Reply With Quote
  #2 (permalink)  
Old
Registered User
 
Join Date: May 2008
Posts: 97
86 views. Are there no experts on the SQL logging?

Any help would be appreciated
Reply With Quote
  #3 (permalink)  
Old
Registered User
 
Join Date: Oct 2009
Location: 221B Baker St.
Posts: 487
If this is becomming urgent/critical, suggest you open an issue with MS support. Yup, it is expensive, but gets answers . . .
Reply With Quote
  #4 (permalink)  
Old
Wage drone 24601
 
Join Date: Jan 2003
Location: Massachusetts
Posts: 5,391
Are you certain you have the right database set to simple recovery mode?
Code:
 select recovery_model_desc
from sys.databases
where name = 'your database name goes here'
You can also look for open transactions in the database with the DBCC OPENTRAN command, or even do what the error message says, and look at the log_reuse_wait_desc column in the sys.databases table.
Reply With Quote
  #5 (permalink)  
Old
Annie's Dog Walker
 
Join Date: Nov 2004
Location: on the wrong server
Posts: 8,416
is this new behavoir? has something new been recently deployed? I am going to go with MCrowly on this one. Someone is doing some large volume transaction(s), "heh why not just update all billion rows at once" or perhaps some long running large volume ETL operation that probably needs to be rewritten.
__________________
“If one brings so much courage to this world the world has to kill them or break them, so of course it kills them. The world breaks every one and afterward many are strong at the broken places. But those that will not break it kills. It kills the very good and the very gentle and the very brave impartially. If you are none of these you can be sure it will kill you too but there will be no special hurry.” Earnest Hemingway, A Farewell To Arms.
Reply With Quote
  #6 (permalink)  
Old
Registered User
 
Join Date: May 2008
Posts: 97
Quote:
Originally Posted by Thrasymachus View Post
is this new behavoir? has something new been recently deployed? I am going to go with MCrowly on this one. Someone is doing some large volume transaction(s), "heh why not just update all billion rows at once" or perhaps some long running large volume ETL operation that probably needs to be rewritten.
You are exactly right. We are testing DB queries and creating/inserting 5-10 Gb tables at a time. But having the db in Simple recovery mode. I understood that it would not use the transaction log in this scenario.

Could I turn off the transaction log? I haven't seen a simple way to do this.
Reply With Quote
  #7 (permalink)  
Old
Wage drone 24601
 
Join Date: Jan 2003
Location: Massachusetts
Posts: 5,391
Having the db in simple recovery mode does not turn off the log (that can not be done by design), it just does not keep the log records after a transaction has been committed. Check to see if you can configure the load to batch the inserts (say every 50-100,000 rows).
Reply With Quote
  #8 (permalink)  
Old
Registered User
 
Join Date: May 2008
Posts: 97
Thank you, I will use Batch Insert instead.
Reply With Quote
  #9 (permalink)  
Old
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 14,450
Dump your log file into oblivion, then do a full backup to maintain a safety net... Add a new log file that has an appropriate size to your database, and empty the existing log file into it. Drop the empty log file that you just evacuated. I recommend doing a second full backup at this point, even though it isn't strictly necessary. At this point you've restored sanity to your database files.

Logging can NEVER be turned off while SQL Server is running (except if the database is made read-only). Logging can be minimized, but there is no way to completely stop logging for a functional database.

The SIMPLE recovery mode will allow the CHECKPOINT to clear unused log rows. This is usually fine on a development database, but I don't recommend it on either QA or production databases.

-PatP
__________________
In theory, theory and practice are identical. In practice, theory and practice are unrelated.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On