Re: Clear/Purge Log files
From: Dan Guzman (danguzman_at_nospam-earthlink.net)
Date: 05/19/04
- Next message: tram: "Re: Transaction log"
- Previous message: Carlos: "Clear/Purge Log files"
- In reply to: Carlos: "Clear/Purge Log files"
- Next in thread: Hari: "Re: Clear/Purge Log files"
- Reply: Hari: "Re: Clear/Purge Log files"
- Messages sorted by: [ date ] [ thread ]
Date: Tue, 18 May 2004 20:02:56 -0500
The way you manage your log file is driven by your database recovery plan.
If your recovery plan is to restore from your last full backup and not apply
transaction log backups, then change your database recovery model to SIMPLE.
This will keep your log size reasonable by removing committed transactions
from the log. The log will still need to be large enough to accommodate
your largest single transaction. If you want to reduce potential data loss,
you should use the BULK_LOGGED or FULL recovery model and backup your log
periodically.
The proper way to shrink files is with DBCC SHRINKFILE. See the Books
Online for details. You should not need to do this as part of routine
maintenance.
-- Hope this helps. Dan Guzman SQL Server MVP "Carlos" <wt_know@hotmail.com> wrote in message news:OueiitTPEHA.620@TK2MSFTNGP10.phx.gbl... > 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 > > >
- Next message: tram: "Re: Transaction log"
- Previous message: Carlos: "Clear/Purge Log files"
- In reply to: Carlos: "Clear/Purge Log files"
- Next in thread: Hari: "Re: Clear/Purge Log files"
- Reply: Hari: "Re: Clear/Purge Log files"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|