question

skbarik avatar image
skbarik asked

Rebuilding Indexes

While Rebuilding Indexes,the Database remain Online or Offline ? If it goes Offline then how the users will access the data.Will they face a downtime or will be directed to secondary ?
rebuild
1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

sp_lock avatar image sp_lock commented ·
The database will stay online (from a SQL server sense), however depending on the edition or the reorg/rebuild process will determine on the impact to users. Even hardware would have an overall impact. Im not sure on the "....will be directed to secondary" statement. What HA/DR/Load balanced architecture do you have in place. What is your current index maint policy?
0 Likes 0 ·

1 Answer

·
Grant Fritchey avatar image
Grant Fritchey answered
Rebuilding indexes is a process that does not take the database offline. It does cause locks to the indexes while they are being rebuilt. This will lead to blocking of access to the index during that process. If you're using Enterprise level of SQL Server, you can do an ONLINE index rebuild which radically reduces that blocking process. This will not cause any kind of failover to a second server in a cluster, always on availability group, or mirror.
2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

skbarik avatar image skbarik commented ·
Thanks a Lot Grant Fritchey...for ur valuable information...
0 Likes 0 ·
Blackhawk-17 avatar image Blackhawk-17 commented ·
@skbarik - If Grant's answer satisfied you then it would be good to mark it as accepted so others searching for the same answer can find it quickly.
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.