Clearing MS SQL 2005 Transaction Logs
A while ago I migrated everything from mssql 2000 sp4 to mssql 2005. For the most part, everything went ok. Then it hit me, my site halted because my alloted space for my transaction logs was reached! to make things worse, the way to fix this in sql2k didn’t exist in 2k5. So, it was on to Google. After hours of research and testing, more testing, and then more testing, here’s a solution that I got to work.
1. Open MS SQL Server Management Studio
2. Expand Management > Maintenance Plans
3. Create a new plan called ‘Shrink Logs’
4. Create a new Subplan that occurs every day that Executes a T-SQL Statement task.
5. Enter in the following:
USE [DATABASENAME] GO DBCC SHRINKFILE (’LOGFILENAME’ , 0) GO
That’ll wipe out your transaction logs every night.
If you don’t want to wipe out your logs, DO NOT RUN THIS. You’ll have to figure something else out =)
Hope this saves you some time!
Discussion Area - Leave a Comment