Solved

How big should T-Logs be?

Posted on 2010-09-16
12
264 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
 

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
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
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 69

Accepted Solution

by:
ScottPletcher earned 500 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 69

Expert Comment

by:ScottPletcher
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Creating and Managing Databases with phpMyAdmin in cPanel.
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

758 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

Need Help in Real-Time?

Connect with top rated Experts

20 Experts available now in Live!

Get 1:1 Help Now