log size

  • Hi, can some one tell me the difference between de log size (MB) and the space used?, how does the log size affect my database and how convenient is it to shrink it and how do I do it?.

    Thanks a lot

    Ana


    Ana

  • Generally you want to size it big enough so that it doesn't have to expand. For some db's that might be a couple megs, for others a couple hundred. You can shrink it using dbcc shrinkfile, though in SQL7 sometimes you have to work a little more due to how the virtual log segments work. Lots of discussion on here about logs, and a couple good scripts to help you shrink them.

    Andy

    http://www.sqlservercentral.com/columnists/awarren/

  • Actually, the size of the database has little impact on the size of the log - there are rules in the SQL Server Resource Guide, but they must be treated as guidelines. Take two examples:

    a) a large database used for reporting only - there are few if any transactions during the day, there is a loading process at night, but then the transaction log is dumped to tape, so a small peak and nothing more.

    b) a database containing one table of index and share prices that is being fed from an external source such as Reuters. The transaction count is going to be phenomenal unless the feeding application throttles the incoming stream of data.

    I know a lot about the second example, on the financial spread betting system I've written, I could easily be writing upwards of 600Mb of transaction log an hour during trading hours, and in the hour after the Dow opens the log file may exceed 1Gb!!

    In conclusion, you need to analyse the number of changes that are going to affect your data and work accordingly.

    Regards, Simon, UK

Viewing 3 posts - 1 through 2 (of 2 total)

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