Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 delete huge log file

Author  Topic 

eia72
Starting Member

9 Posts

Posted - 2006-02-15 : 23:52:25
how to delete a very huge log file, to free up some harddisk space

shallu1_gupta
Constraint Violating Yak Guru

394 Posts

Posted - 2006-02-16 : 00:00:40
you can shrink your log file ..
Use
DBCC SHRINKFILE
Or
DBCC SHRINKDATABASE to shrink the complete database.
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-02-16 : 05:10:32
Hi eia72, Welcome to SQL Team!

You need to fix the cause of the problem too.

If you deleted an exceptional amount of data then SHRINK to get back to "normal running size"

If you are not running TLog backups (and do not want to) then change the Database Recovery Model to SIMPLE (and then SHRINK), or start doing TLog backups if you need them, and do a one-time SHRINK to get the filesize back to "normal"

Otherwise shrinking won't help you because the files will just grow back to that size in normal operation, and the Grow process a) uses a lot of CPU resources [which may cause timeouts etc.] and b) will fragment your files.

If you use the SHRINK tool in Enterprise Manager (you don't have to "run" it, just review the figures) you can see how much "slack" you have in your database.

Kristen
Go to Top of Page

Kristen
Test

22859 Posts

Posted - 2006-02-16 : 05:11:28
Also see:

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=55210&SearchTerms=shrink

Kristen
Go to Top of Page
   

- Advertisement -