HELP= Rebuild index & Update STATISTICS

  • Please advise, when you rebuild indexes if suppose the job failed due to some reason such as power outage, etc., what happens to the indexes? Does it get wiped from database?

    Same question for update stat, what happens to statistics if during the execution if there is a power outage or job fails. Does the stats gets wiped from database? Please advise how it works. Thanks

  • the index which is being rebuilt is stored in a temporary area and brought in when the rebuild has finished to replace the existing index. An outage shouldnt really have any affect. The database consistency overall could be supsect but sql server takes care of this when starting up the database (using the transaction log file).

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • Perry is correct, ACID property holds good here.

    EnjoY!
  • As with any data modification, if the transaction is not committed and there's a server failure, the changes will all be rolled back as part of the database restart-recovery.

    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
  • Thank you so much all for the reply! So it rolls back even for the job fails for some reason?

  • As Gail says "no commit, no dice" 😉

    it's also worth noting if the database is in simple or bulk-logged recovery the create\alter index is not fully logged!

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

  • Perry Whittle (3/19/2010)


    it's also worth noting if the database is in simple or bulk-logged recovery the create\alter index is not fully logged!

    Minimally logged, but that doesn't change the 'no commit, no change' rule.

    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
  • yes, that goes without saying!

    -----------------------------------------------------------------------------------------------------------

    "Ya can't make an omelette without breaking just a few eggs" 😉

Viewing 8 posts - 1 through 7 (of 7 total)

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