Forum Discussion

nlucero's avatar
nlucero
Advocate I
1 year ago
Solved

Azure SQL Mirrored DB says "metadata tables are corrupted" when stopping then restarting replication

I created a Mirrored SQL DB in fabric that connects to a source Azure SQL DB via a service principal. I was able to get the replication up and running as expected. It began mirroring tables as expect...
  • nlucero's avatar
    1 year ago

    I heard back from MS support. TL;DR: you need to grant VIEW PERFORMANCE DEFINITION to the managed identity fabric is using to connect to the db:

    GRANT SELECT, ALTER ANY EXTERNAL MIRROR, VIEW PERFORMANCE DEFINITION TO [User];

    The official docs only mention the need for `SELECT, ALTER ANY EXTERNAL MIRROR`.

     

    This does not fix a database that already has corrupted metadata, but it makes it so that the reproduction steps I mention in the first post do not generate a metadata corruption in the first place.

     

    I believe MS is planning to push a fix for this before the end of the month, but I don't know whether that will be just an update to the documentation or a code fix that makes the "ANY EXTERNAL MIRROR" permission sufficient.