Stop log file groth

  • I have one database in sql server. I am inserting thousand of recored per day. My log file is getting big and big. Is there any way to protact that so it can get shrink after transation get comminted to database. I am doing manual shinking operation every week.

  • You can schedule a manual shrinking, (along with the backup) to take place more often. 

    Thousands of records per day should not cause too great a difficulty.  Might there be something in your code that is causing more transactions than necessary? Is the box too small?  You may want to post this in Administration as well to see what those fella's may know. 

    I wasn't born stupid - I had to study.

  • Have a look in Books Online for DBCC SHRINKFILE and Recovery Models.

  • Are you backing up your transaction log? This will remove the inactive entries for the transactions that have completed.

    See BOL Truncating the Transaction Log for more info

  • not that I would recommend it on a production system but you could put the database into the simple recovery model which would then prevent the transaction log from being filled up (it would be truncated every time a checkpoint occured).

    If you do this you would only be able to restore the system to the last full backup but it would solve your problem if you're not worried about loosing anything since the backup took place.

    Depending upon the size of the database I would schedule a weekly full backup, nightly differential backups and a transaction log backup every hour to a couple hours.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply