Solved

How do I delete the MSSql log files?

Posted on 2008-10-02
6
836 Views
Last Modified: 2012-05-05
I have recently set my MSSql database properties for the Recovery Model to "Options" 'Simple" to limit their growth. I am completely out of disk space because of heses two log files:
C:\Program Files\Microsoft SQL Server\MSSQL\Data\CSSDemoInstanceCSSDemo_LDF
C:\Program Files\Microsoft SQL Server\MSSQL\Data\CSSInstanceCSS_LDF

How do I delete the information in these files, that I don't need, so I can free up more space?

0
Comment
Question by:cssc1
[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
  • 3
6 Comments
 
LVL 60

Accepted Solution

by:
chapmandew earned 250 total points
ID: 22624194
if you've set to simple, you'll need to shrinkthem.


dbcc shrinkfile('CSSDemoInstanceCSSDemo_LDF', 0)
0
 
LVL 60

Expert Comment

by:chapmandew
ID: 22624197
btw..you can't delete them as they are required by sql to function.
0
 
LVL 41

Assisted Solution

by:graye
graye earned 250 total points
ID: 22626327
There may be some good business reasons to why you would want your database in the "Full" recovery model.   So later, if you decide to switch back to the "Full" recovery model, there are some simple steps you can use to curb the growth of log files.
The bottom line is this....   you control the growth of the log files with periodic log backups, and you control the size of the log files with a shrink operation.
http://home.hot.rr.com/graye/Articles/SQL_LogMaintenance.htm 
0
 
LVL 60

Expert Comment

by:chapmandew
ID: 22626352
>>and you control the size of the log files with a shrink operation

If you keep well enough control of backing up the log files, you shouldn't really need to shrink them.
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

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

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

730 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