Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Why logs so big


Why logs so big

Author
Message
JimS-Indy
JimS-Indy
Old Hand
Old Hand (347 reputation)Old Hand (347 reputation)Old Hand (347 reputation)Old Hand (347 reputation)Old Hand (347 reputation)Old Hand (347 reputation)Old Hand (347 reputation)Old Hand (347 reputation)

Group: General Forum Members
Points: 347 Visits: 444
I have a small db at my client site (SS2012,MS Server 2008) with an Access front end. It does some importing through Access (imports Excel workbooks created by the corporate server....) These are necessarily big, and they are replaced into a table on each import because the corporate server doesn't provide a key column. No big deal, I work through it, but I can't quite figure out why my log file is so big....

On Mondays, the log file should get big, because all the imports are run on Mondays. But then, every morning at 3 AM, I have a backup sequence that backs up the entire instance, then (I thought...) truncates the log files. Yet, here it is Tuesday and the log files are huge (twice the size of the db....)

My best guess is that I never truncate the space occupied by the logs, just delete the logs themselves.... I guess that's OK, but it seams like a lot of wasted space....

Log file...6330 MB, DB file...3682 MB

Backiup script (SQL Server Agent Job...)

https://picasaweb.google.com/lh/photo/2rlN0nnxNR-sWWefPJZkudMTjNZETYmyPJy0liipFm0?feat=directlink

Jim
John Mitchell-245523
John Mitchell-245523
SSCertifiable
SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)SSCertifiable (7.4K reputation)

Group: General Forum Members
Points: 7414 Visits: 15114
Jim

Truncating the log only removes none, some or all of the entries from it; it doesn't shrink it. You should consider backing up your log instead of truncating it, so that you don't lose your log chain and hence your ability to restore to a point in time in the event of a disaster. You might also consider doing your updates in small batches. This, combined with regular log backups, should limit the growth of your log file.

For more details and a better explanation, start with this.


John
GilaMonster
GilaMonster
SSC-Forever
SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)

Group: General Forum Members
Points: 47198 Visits: 44367
Take a read through this: http://www.sqlservercentral.com/articles/Administration/64582/


Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


JimS-Indy
JimS-Indy
Old Hand
Old Hand (347 reputation)Old Hand (347 reputation)Old Hand (347 reputation)Old Hand (347 reputation)Old Hand (347 reputation)Old Hand (347 reputation)Old Hand (347 reputation)Old Hand (347 reputation)

Group: General Forum Members
Points: 347 Visits: 444
John and Gail both referred me to the same resource. But I think the maintenance plan I included in the link shows that I do back up the log...every time I back up the db...daily.

So, if I want to shrink the log space once (to see if its current size is an anomaly...) how do I do that?

Never mind...I figured it out. But the shrunken logfile is still pretty large. Is that normal? It's now just a gig larger than the 4 gig data file....

Jim
GilaMonster
GilaMonster
SSC-Forever
SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)SSC-Forever (47K reputation)

Group: General Forum Members
Points: 47198 Visits: 44367
Start by backing the log up more frequently. See the article I referenced about how often and why you back logs up. If you don't need to back the logs up, then consider simple recovery model

After a log backup, you can just shrink the log. Use the UI if you want. Shrink to a sensible size, not 0. Maybe half the size of the DB.


Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search