Forum Discussion
Mirroring Azure SQL DB is not working
- 1 year ago
I heard back from MS Support about my similar issue. if you
GRANT SELECT, ALTER ANY EXTERNAL MIRROR, VIEW PERFORMANCE DEFINITION TO [User];for the managed identity that is accessing your Azure SQL DB from Fabric, the metadata will not become corrupted using my reproduction steps. This does not, however, correct a DB where metadata has already become corrupted.
Note that the difference between the grant statement above and the official documents is that the official docs do not mention the need for VIEW PERFORMANCE DEFINITION permission.
TimoW - This may or may not be helpful for your scenario, but I was able to isolate my issue and avoid it, though the issue is still problematic because there seems to be no recovery from a metadata corruption except to restore your source DB from a backup: https://community.fabric.microsoft.com/t5/Data-Engineering/Azure-SQL-Mirrored-DB-says-quot-metadata-tables-are-corrupted/m-p/4658153/highlight/true#M8686
How this applies to your scenario: I get metadata corruption intermittently when I stop and then restart replication. To avoid this issue, I never stop the replication and instead "Configure replication", make no changes, and then, "Apply changes". That predictably resumes my replication correctly. I haven't tested whether that will work for added/removed columns from a source DB.