Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

The Database Forum


You are currently viewing our The Database Forum as a guest. Please register to participate.
Login



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
Trades: 0
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!
 
 
Register now for full access!
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,023
Name: Forrest Croce
Location: Seattle, WA
Trades: 0
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.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
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 Search this Thread
Search this Thread:

Advanced Search

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

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





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



Page generated in 0.42296 seconds with 12 queries