Hi:
If replication and rebuild index happen at the same time, which one
will fail ?
Please advice
JCVoonThis really depends on a few factors. Firstly, how do you rebuild your
indexes? DBCC DBREINDEX and DBCC INDEXDEFRAG are considered offline and
online operations respectively, due to the different locking behaviour. In
SQL Server 2005 this corresponds to ALTER INDEX ALL on tablename REBUILD
WITH (ONLINE = ON) and ALTER INDEX ALL on tablename REBUILD WITH (ONLINE =OFF), or the old DBCC syntax can be used as well. The online options should
be compatible with the distribution or merge agent running while the offline
is less likely. It really all depends on the QUERYTIMEOUT parameter's value
and how this realtes to the time taken to rebuild the table indexes.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)|||It depends on which one starts first. index rebuild requires an exclusive
lock on the table. If the rebuild starts first, replication will not be able
to update it until the rebuild finishes. If the replication is updating the
table when the index rebuild attempts to run, it will fail because it can not
get an exclusive lock.
Regards
John
"jcvoon" wrote:
> Hi:
> If replication and rebuild index happen at the same time, which one
> will fail ?
> Please advice
> JCVoon
>
No comments:
Post a Comment