Reply
How to clear or Reduce Log file size in MSSQL?
Old 01-20-2007, 04:22 PM How to clear or Reduce Log file size in MSSQL?
Banned

Posts: 9
How to clear or Reduce Log file size in MSSQL?

any help on this...
vishalvasani is offline
Reply With Quote
View Public Profile Visit vishalvasani's homepage!
 
When You Register, These Ads Go Away!
Old 01-20-2007, 05:41 PM Re: How to clear or Reduce Log file size in MSSQL?
ForrestCroce's Avatar
Half Man, Half Amazing

Posts: 3,024
Name: Forrest Croce
Location: Seattle, WA
First, the question is whether to empty the t-logs. Those are like backups; if your server crashes and leaves the database in a bad way, you can play changes forward and recreate it up to the point of failure. If you don't need this type of functionality, or the space is more important to you, the steps are below ... I just wanted to point out the trade-off so you can make a good decision before you take my advice and (possibly) shoot yourself in the foot.

You can use DBCC to shrink the transaction logs. How depends on what version ( 97, 2000, 2005 ). There's a dbcc option called "backup log" and a modifier "with truncate_only" which will empty the .ldf file for a given database. Check Books Online ( the SQL Server help file ) or MSDN.com for more info.

Or ... if you're using the UI, either Enterprise Manager or Management Studio, you can right click on the node for the particular database, go to the "All Tasks" sub menu, and there should be options to shrink the entire database, the data file, or the log file. You can do all of this with the mouse and avoid dealing with DBCC syntax.

Also, you might want to change your recovery model to "simple" ( it's probably set to "full" now ), which will cause the t-logs to fill more slowly.

Finally, if you really don't need them, you can use SQL Agent to run a job nightly to clear out your transaction logs for you.
ForrestCroce is offline
Reply With Quote
View Public Profile Visit ForrestCroce's homepage!
 
Reply     « Reply to How to clear or Reduce Log file size in MSSQL?
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Webmaster Resources Marketplace:
Software Development Company | Webhosting.UK.com | Text Link Brokers 


   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12168 seconds with 12 queries