Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

MSSQL Large Transaction Log

Posted on 2013-06-20
4
Medium Priority
?
440 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 2000 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
Familiarize people with the process of utilizing SQL Server functions from within Microsoft Access. Microsoft Access is a very powerful client/server development tool. One of the SQL Server objects that you can interact with from within Microsoft Ac…
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…

662 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