|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: 2 days ago @ 10:44 AM
Points: 213,
Visits: 835
|
|
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
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Yesterday @ 5:53 AM
Points: 5,204,
Visits: 11,158
|
|
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"
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Wednesday, April 17, 2013 3:15 PM
Points: 389,
Visits: 351
|
|
Perry is correct, ACID property holds good here.
EnjoY!
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 8:47 AM
Points: 37,739,
Visits: 30,012
|
|
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 2008, MVP 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
|
|
|
|
|
SSC Veteran
      
Group: General Forum Members
Last Login: 2 days ago @ 10:44 AM
Points: 213,
Visits: 835
|
|
| Thank you so much all for the reply! So it rolls back even for the job fails for some reason?
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Yesterday @ 5:53 AM
Points: 5,204,
Visits: 11,158
|
|
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"
|
|
|
|
|
SSC-Dedicated
           
Group: General Forum Members
Last Login: Today @ 8:47 AM
Points: 37,739,
Visits: 30,012
|
|
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 2008, MVP 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
|
|
|
|
|
SSCertifiable
       
Group: General Forum Members
Last Login: Yesterday @ 5:53 AM
Points: 5,204,
Visits: 11,158
|
|
yes, that goes without saying!
-----------------------------------------------------------------------------------------------------------
"Ya can't make an omelette without breaking just a few eggs"
|
|
|
|