I am running a 2-node SQL Server 2016 AlwaysOn Availability Group. I would like to create a non-clustered index online in SSMS for one of the availability databases in the AlwaysOn Availability Group. For this operation, it is very important that the index create be Online; in other words, the table should not become locked and both reads and writes should continue without interruption or error during this time. Also, the cluster should not go into an unhealthy state where replication stops.
Here was my plan for doing this:
Go into SQL Server Management Studio (SSMS) on the master node, go to the database, table and then Indexes section in Object Explorer and right-click on Indexes and choose New Index - Non-Clustered
Add the appropriate field to the Index Key columns screen
Go to Options - and set "Allow online DML processing" to "True"
Click OK
Is the above approach the best way to do this? Will this actually create the index online? While the index is being created, will the cluster remain in a healthy and replicated state, will the index get created on the secondary automatically, and will the incoming reads and writes continue to happen without errors?
Any help with this is greatly appreciated!