Clear/Purge Log files

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Carlos (wt_know_at_hotmail.com)
Date: 05/19/04


Date: Wed, 19 May 2004 08:52:17 +0800

The MDF file is 800 MB but the LDF file is 5 GB. I run the "shrink database"
but this does not seems to reduce the mdf or ldf filesize.

What I did is detach the database, delete the ldf file, re-attach the
database to create a new ldf file. If I do not do so, the application cannot
work (hang!) because the ldf file is too huge and it takes ages to commit a
transaction. Is there a "better" way to control the ldf file like
auto-purging ? Should I restrict the log file size to a specific filesize
like 500MB ? Does this mean it will auto-purge each time it reach 500MB for
the ldf file ?

Thanks



Relevant Pages

  • Re: .LDF files and SharePoint Portal
    ... So when you take a backup of the database, ... I have some questions about .LDF files and Sharepoint. ... Is it safe to delete the data in the .LDF file or will it cause ...
    (microsoft.public.sharepoint.portalserver)
  • Re: Crash Recovery
    ... You can't apply an LDF file to a restored database backup. ... >> How to restore the BAK file. ...
    (microsoft.public.sqlserver.server)
  • Re: Humongous transaction LOG!!!
    ... Just to be clear on this, truncating the Log doesn't shrink the size of the ... it will soon need to use the same amount of space in the .ldf file & it's ... To shrink the .ldf file you can use dbcc shrinkfile. ... This is strange since the size of the backup database is about ...
    (microsoft.public.sqlserver.server)
  • Re: Missing log file...
    ... This will attach the database with MDF file and will create a new LDF file. ... Stop sql server and rename the existing MDF to a new one and copy the ...
    (microsoft.public.sqlserver.server)
  • Re: error attaching single db .mdf file
    ... with specifying the MDF file only. ... THis will create a new database with exiting mdf and new ldf file. ... This command will fail in below scenarios:- ...
    (microsoft.public.sqlserver.server)