Re: adding rowids to a frag'd table
Posted in 2009
> Hey Guys, > > Thanks for the responses. You are doing well to have been out of it for a > while! > > I'm in a trans so I can lock the table in excluse to avoid blowing the > locks. > > It's a test system. There is little or no activity on the box. If the > physical log is filling and forcing a checkpoint it shouldn't cause a long > trans. Right? It should flush dirty pages back to disk, pull more pages > in, etc. But, if the table is raw, why would/should it pull before images. > It's raw, no logging, no rollback, etc. Isnt' that the point of raw? > > Is there a way to avoid blowing locks without the explicit trans? > consistency rules still require logging before-images of changing pages. raw merely blocks transactional logging. So, if your machine happens to crap out mid-process, the physical log will ensure the spaces are not inconstent (where inconsistent = trashed) but the lack of logging means your table changes are lost. Actually I'm wondering what will happen to the junk in such a situation. The 1/2 finished new table is just rubbish and should be thrown away in the event of a fast recovery. Presumably that's accounted for. Which leads me to wonder - maybe the old table is logless, but that doesn't mean the new table being layed down is unlogged. Who can confirm or reject that possibility? Maybe the new table would be switched to logless only when it's constructed and ready to take the place of the old allocations. If that's the case, maybe you need to manually create the target table (raw), stuff rows into it yourself (no logging activity) and then drop the old one, rename the new one, reinstate it's mode and indexes.