miércoles, 21 de octubre de 2015

Azure SQL Geo-Replication Change Role Procedure

In the case of one Azure SQL Database gets degraded, if we have configured the Geo-Replication as shown in this post Azure SQL Geo-Replication Configuration, we can change the role of the replicated DB with this procedure and use it as the main DB.

1.  For activating the Secondary DB of the Geo-Replication, go to SQL databases in Ibiza Portal.


     2. Open the Primary DB and go to Geo-Replication

  
       3. On the Secondary DB, clic the 3 points on the right and select Stop Now



      4. One message appears indicating that the replication will stop and the Secondary DB will be converted in a stand-alone DB, press YES




      5. Using the command Get-AzureSqlDatabaseCopy we can verify the non-replicated status of the DB, it must not return any information.



Azure SQL Geo-Replication Configuration


We can use the Azure SQL Geo-Replication feature as DB disaster recovery plan. We make a copy any DB in another Azure Region.

1. For activating DB Geo-Replication, go to SQL databases in Ibiza Portal.



2. Select the DB > All Settings > Geo-Replication



3. Choose the Target Region where the DB will be replicated (the best option is to select the recommended one)


4. Create a new DB server filling the name of the server, the admin and the password. Select to create V12 server, and check the option to allow Azure services to access server, and press OK.


5. After the creation of the new server, in the “Create secondary” slide appears the new created server. In the lower left corner, press CREATE.


6. In the Geo-Replication slide appears the new Secondary server initializing.



7. When the process is finished, the status of the new replication DB appears as Non-Readable.


8. Now there are two DB with the same name in two different servers, each one in one Location.



9. In the configuration of both DB, appears the corresponding Geo-Replication role.




10. To verify the status of the copy between both DB, use the command Get-AzureSqlDatabaseCopy


11. Now that we have configured the Geo-Replication, in disaster case we can activate the replicated DB following the instructions in this post Azure SQL Geo-Replication Change Role Procedure