Solved

How to truncate Log file - it is too large (10 GB)

Posted on 2006-07-23
7
254 Views
Last Modified: 2008-03-10
Hello,
 
      I am new to SQL Server.

      I have a small in-house developed package running on Microsoft SQL Server from last 1 year. I am using FIFO method for Material Management System in my code, which is deleting & adding desired rows in temporary tables based on conditions.

     My data file size is 308 MB, where as my log file size is continuously growing. (Currently it is 10GB). I am scared of file size growth, as I have few GBs left on hard disk. So please tell me what does log file contains? And how do I truncate the log file?

    Thanks in advance!
    ---Chitra
0
Comment
Question by:ChitraMarathe
[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
  • 2
7 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 250 total points
ID: 17165468
0
 
LVL 35

Expert Comment

by:David Todd
ID: 17165497
Hi,

If this is drastic, and things need to change NOW, then the quick patch is to detach the database, rename/move the log file, and reattach the database. SQL will create an empty logfile at the default (small) size.

This isn't a cure.

Its a trick to get on top of out-of-control log files.

Also use the Taskpad view in Enterprise Manager, as an easy way to see unused space.

Regards
  David
0
 
LVL 35

Expert Comment

by:David Todd
ID: 17165506
Hi,

detach the database with sp_detach_db mydatabase
rename/move/delete the log file ...
attach the database with sp_attach_db 'mydatabase', 'mydatabasedatafile.mdf'

Regards
  David
0
 
LVL 30

Expert Comment

by:nmcdermaid
ID: 17166046
... and then change your recovery model to 'simple'



but read the MS KB's for full info.
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Everyone has problem when going to load data into Data warehouse (EDW). They all need to confirm that data quality is good but they don't no how to proceed. Microsoft has provided new task within SSIS 2008 called "Data Profiler Task". It solve th…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

734 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