Forums before death by AOL, social media and spammers... "We can't have nice things"
|    comp.databases.ms-sqlserver    |    Notorious Rube Goldberg contraption    |    19,505 messages    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
|    Message 17,583 of 19,505    |
|    Erland Sommarskog to vardan.hakopian@gmail.com    |
|    Re: Log file is getting bigger    |
|    22 Jul 09 22:32:35    |
      eb3be144       From: esquel@sommarskog.se              hayko98 (vardan.hakopian@gmail.com) writes:       > I have 2 databases:PRD and DEV.data files are about 6GB ( Simple       > recovery mode).Once a week i am backing up PRD,then restoring in       > DEV.After restoring in DEV i am deliting old(older than 3 months)       > data.After deliting DEV's log file becomes 30GB.Any idea why log file       > is getting this big after recovery mode is set to Simple?              First make sure that you still have simple recovery after restoring       the production copy.              If you delete all data in a table in a single statment, all that data       will be logged. Try deleting the data in reasonable batches, and throw in       a CHECKPOINT to make sure:               SELECT @batchsize = 50000        SELECT @rowc = @batchsize        WHILE @rowc = @batchsize        BEGIN        DELETE TOP(@batchsize) tbl WHERE ...        SELECT @rowc = @@rowcount        CHECKPOINT        END              --       Erland Sommarskog, SQL Server MVP, esquel@sommarskog.se              Links for SQL Server Books Online:       SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx       SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx       SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx              --- SoupGate-Win32 v1.05        * Origin: you cannot sedate... all the things you hate (1:229/2)    |
[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]
(c) 1994, bbs@darkrealms.ca