Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
MadhavBitra
Starting Member
1 Post |
Posted - 2010-01-29 : 06:13:42
|
Hi All,I have been facing a problem with one of my database;while updating a table contains 50,000 records, the log is growing from 4MB to 14GB. i don't have a clue why it's happening.I have tried the below options but veined.CHECKDB,CHECKALLOC,CHECKTABLE,REINDEX.Could any one suggest me the cause and resolution?Thanks in Advance, |
|
Kristen
Test
22859 Posts |
Posted - 2010-01-29 : 06:26:50
|
When you do an UPDATE the whole transaction is stored in the log. This transaction cannot be removed / truncated / backed up etc. until it completes. The transaction is essential in case SQL Server has to ROLLBACK your update.Presumably your update on 50,000 is generating 14GB of logging information (maybe there are triggers that are firing requiring additional logging).Either do the update in batches, and backup the Tlog in between, or allow the Tlog to grow, make a backup, and then shrink it back to its normal size.Do not shrink the log if this is anything other than a one-off update (I'm surprised that your normal Tlog is only 4MB, that's very little for normal operations - unless the DB is read only!) |
|
|
|
|
|
|
|