rrebuilding indexes by one connection and select or update statements by other connection on the same database work?

  • hi,

    I had check db integrity followed by rebuilding indexes job scheduled and at the same time a SPID(connection) is performing update or select operations on that database. what is the solution for the job to succeed other than killing that SPID ?

  • It create a dead lock between re-index table and update or select table.

    but you can reduce the load to change the DB to simple recorvery mode first and after re-index change back to Full recovery mode.

    Do not forget to take the full backup after you change the recovery mode.

  • Mathew M.Varghese (7/24/2011)


    It create a dead lock between re-index table and update or select table.

    Blocking, yes. Deadlocks, it shouldn't

    but you can reduce the load to change the DB to simple recorvery mode first and after re-index change back to Full recovery mode.

    Terrible advice. There's no good reason to switch to simple, break the log chain and leave yourself at risk of dataloss. If the log growth is a problem (nothing to do with locking) then bulk-logged recovery can be used for the duration

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Hi GilaMonster,

    If using enterprise edition it's possible to rebuild indexes online without bloking the access to that index right?

    Best regards,

  • Yes. It's mostly online, not fully online, but it will mostly keep the index available.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 5 posts - 1 through 4 (of 4 total)

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