March 19, 2008 at 3:21 am
I Have 2 questions as a result of a few issues I has with a db earlier this week.
1. After I performed a restore of a 30 Gb database into a test database the LDF logs of the test dataabse grew to 11GB. Is there a way to restore a database without logging?
2. I also performed a ShrinkDatabase last week that took 30 mins. This week it only took 30 secs. I assume the initial shrink did a lot of work and any subsequent shrinks will have less to do (depending on the activity in the database)?
Regards
Steve
March 19, 2008 at 3:39 am
Hi Steve,
Unfortunately, if the database you've backed up has an 11 GB log file then there's no way to restore a database without logging. You could shrink the log file down before taking the backup though.
Your assumption on the shrink database is correct. Essentially the shrink database command move pages from the end of the database file to the front of it. And once that is done it reclaims the unused space. It's the first step though that takes the longs (moving all those data pages) After the initial shrink operation, as most pages were placed at the front of the file then there's less work to do on subsequent shrinks.
Incidentally, try to avoid performing shrink operations too often as it will introduce fragmentation.
March 19, 2008 at 3:54 am
Thanks for the great reply.
With the increase in log file size - the live log files (I have 2 ldfs) only total 3GB in size, but when I restored they increased to 11GB!!??
March 19, 2008 at 3:59 am
Steve Hindle (3/19/2008)
Thanks for the great reply.With the increase in log file size - the live log files (I have 2 ldfs) only total 3GB in size, but when I restored they increased to 11GB!!??
Hmm, can't say I've seen that before unless I've been doing an upgrade (say from 2000 to 2005). Note that even though the logs might only occupy 3 GB the actual file size could be bigger (the empty space in a log still contributes to the total log size), but it sounds like you're referring to the actual file sizes anyway.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply