Solved

How do I delete the MSSql log files?

Posted on 2008-10-02
6
832 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
  • 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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

825 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