Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

How big should T-Logs be?

Posted on 2010-09-16
12
Medium Priority
?
274 Views
Last Modified: 2012-05-10
Im guessings there isnt a definate answer to this. Im also guessing weather the DB is OLAP or OLTP would effect.

We have a database that is currently 14gb for the .mdf and 15gb for the .ldf is that right? I read that the log files could grow if a transaction is never closed?

the database is in full recovery mode we do full backsup every night, diff every 3 hours during work ours and then 30 mins for tlogs.

None of the other database we have run this high (Tlogs reach this size). Im just wondering if there is a problem and how would i find out if there was/fix it?

thanks for any input.

s
0
Comment
Question by:stebennettsjb
  • 5
  • 3
  • 2
  • +1
12 Comments
 
LVL 60

Expert Comment

by:chapmandew
ID: 33691805
So, your db is 14gb and your log file is 15?  
0
 

Author Comment

by:stebennettsjb
ID: 33691901
yep.
0
 
LVL 60

Expert Comment

by:chapmandew
ID: 33691924
and the log file itself continues to grow?  how often does it grow?
0
Get free NFR key for Veeam Availability Suite 9.5

Veeam is happy to provide a free NFR license (1 year, 2 sockets) to all certified IT Pros. The license allows for the non-production use of Veeam Availability Suite v9.5 in your home lab, without any feature limitations. It works for both VMware and Hyper-V environments

 

Author Comment

by:stebennettsjb
ID: 33692055
It seems to be staying at this size. the whole of our log folder doesnt seem to change to much gone i think its used 2gb in the last few days. It was just the sheer size i thought was strange.

0
 
LVL 60

Expert Comment

by:chapmandew
ID: 33692076
Could be that the db was created w/ a file that size.  I'd keep an eye on it.  It won't shrink itself, but if it gets larger you may have a problem.  Log files are not like data files, so long as you keep backing them up, the size of the file will not get larger if there are no long running transactions keeping others from being backed up.

0
 

Author Comment

by:stebennettsjb
ID: 33692290
in properties of the DB the orginal size of the log was 14.920kb and has auto growth at 10% now sits at 15,277,824kb

is there a way to see if there a long running transaction doing it?

thanks

s
0
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 33692516
It's no so much a long running transaction issue (unless the transaction is spanning over log backups).  How large are your 30 minute transaction log backups?  How large is your largest transaction log backup?

If your log backups are generally 1-2GB but occasionally you get a 10GB log backup, then your log should be 10GB + some extra space so it doesn't fill.  
0
 

Author Comment

by:stebennettsjb
ID: 33692560
well actually i just posted the backups as well.

Its setup to do full differential and log backups to the same file. So i cant tell you that unless someone knows how to?

Cheers

s
0
 
LVL 39

Expert Comment

by:BrandonGalderisi
ID: 33692577
Yeah.... that's PROBABLY not a good idea.
0
 

Author Comment

by:stebennettsjb
ID: 33692622
didnt think it was  :/ im new to SQL and looking at what our current setup is (/cry) to try and improve it.. backups was the major one where i found it rather strange to say the least.

0
 
LVL 70

Accepted Solution

by:
Scott Pletcher earned 2000 total points
ID: 33693423
You need to change the 10%.  That's way too much space to add to the log at once.  Use a fixed amount, like 200M (or 300M or 500M if you think you need it).

Run a DBCC OPENTRAN just to make sure you don't some old trans you don't know about forcing the log to remain "unbackedup" and thus unreuseable.
0
 
LVL 70

Expert Comment

by:Scott Pletcher
ID: 33693432
Log space *must* be preformatted and the db access pauses while the log is extended -- and a 1.5G+ extension will take a *long* time (barring exceptionally fast drives).
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Windocks is an independent port of Docker's open source to Windows.   This article introduces the use of SQL Server in containers, with integrated support of SQL Server database cloning.
When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question