Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

LDF file grows to 5 Gig

Status
Not open for further replies.
Oct 16, 2006
21
BE
hello,

I have a question about resizing the LDF file of a database.
the size of my mdf file is around 500MB big and my LDF file is around 5 gig.

In the file properties it's specified a restricted file growth to 2 Gig

How can I shrink the LDF file and prevent it from growing bigger then 2 gig, or is this not needed?

thank you
 
First, the reason your log file is so large is because your not backing it up. If you back it up it won't grow out of control. You should backup your log file throughout the day. This will allow you to recover the database to a point in time. If you don't have a need to restore the database to a point in time change your recovery model of the database to simple. This will cause the log to truncate on checkpoint. To shrink your current log file run..

DBCC SHRINKFILE(db_log_name, truncateonly)

- Paul
- If at first you don't succeed, find out if the loser gets anything.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top