Force mirroring re-sync in a production database
•
Environment: cloud
Some tooltip text!
• 2 minutes to read
• 2 minutes to read
You have set up database mirroring and data was synchronizing as expected, but now it seems to have stopped. What do you do?
There is no GUI to check data in a mirror, so you must use SQL Server Management Studio to inspect the tables. Generally, it should be possible to do select * from <sometable>
in both the customer table and the mirror and get the same result.
If you notice that some tables are not updating as expected, it might be time to force a resynchronization.
This procedure is intended for a live system. If you want to debug mirroring in SOD, you can mock a user installing the application to trigger the Mirroring Task.
Pre-requisites
- your application is registered and has been deployed to the production environment
- you have a publicly available working service
- your application has been approved by the customer's tenant administrator
Restart synchronization
- Using SQL Server Management Studio, go to the
<context identifier>_mirroring
database table - For each table that you have identified as having a problem, set LSN to
-1
within the mirroring table. - Shortly thereafter, the Mirroring Task will send an authentication request, which your client must respond to. After successful authentication, SuperOffice will begin to deliver periodic updates to your mirroring service.
Hard reset the mirror
- Using SQL Server Management Studio, drop the
<context identifier>_mirroring
database table. - Shortly thereafter (the next mirroring cycle), the Mirroring Task will send an authentication request, which your client must respond to. After successful authentication, SuperOffice will begin to deliver periodic updates to your mirroring service.