Solved

MSSQL Large Transaction Log

Posted on 2013-06-20
4
429 Views
Last Modified: 2013-06-20
Hi,

I'm dealing with a MSSQL server whose transaction log has grown to 20GB where as the actual database file is only 7MB!

Its really difficult to administer because it keep eating up the harddisk space.

Is there any way to prevent this from happening?
Whats the cause? Only one user is connected to this server.
How can I clear the transaction log?

Thanks
Dan
0
Comment
Question by:DanJourno
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 5

Expert Comment

by:AbhishekJha
ID: 39261984
Truncate the transaction log.

Refer below link for more information about truncating transaction log

http://msdn.microsoft.com/en-us/library/aa174538(v=sql.80).aspx
0
 
LVL 9

Accepted Solution

by:
sarabhai earned 500 total points
ID: 39261986
Take a full backup and then backup for log only with truncate_only option

set database auto shrink on

Please read below link

http://www.techrepublic.com/blog/datacenter/help-my-sql-server-log-file-is-too-big/448
0
 
LVL 32

Expert Comment

by:Ephraim Wangoya
ID: 39262061
The first step is to shrink it to your desirable size.
Now to keep it manageable, there are two options

1. Change the database recovery model to SIMPLE
2. Schedule regular transaction log backups

These will ensure the log does not grow too large
Remember to avoid truncating your log, this breaks your log transaction sequence and sql server does need to grow the log file at times depending on how much data you edit.
0
 
LVL 8

Expert Comment

by:didnthaveaname
ID: 39262069
I really would advise against auto shrink...  I would, however, argue that if your transaction logs are that large with a db that small, you're probably in full recovery model and you don't need to be.  The article that sarabhai posted has directions in how to set your recovery model to simple an then you'll just want to set up a backup (full and/or differential in simple recovery model, the transaction logs are circular and only there for maintaining db consistency, acidity and integrity) schedule via sql server agent or maintenance plan.

Sql server agent - http://support.microsoft.com/kb/2019698

Maintenance plan - http://technet.microsoft.com/en-us/sqlserver/dd430301.aspx
0

Featured Post

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

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

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
What if you have to shut down the entire Citrix infrastructure for hardware maintenance, software upgrades or "the unknown"? I developed this plan for "the unknown" and hope that it helps you as well. This article explains how to properly shut down …
Familiarize people with the process of retrieving data from SQL Server using an Access pass-thru query. Microsoft Access is a very powerful client/server development tool. One of the ways that you can retrieve data from a SQL Server is by using a pa…
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

624 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