I am sort of confused about orphaned users in database snapshots created on the partner server participating in database mirroring.

Server A acts as principal for database X, with server B as its mirror, having database snapshot configured for that database X for reporting purposes.

We recently had a failover. After that I fixed the orphaned users in database X on server A.

However, when I view the same for the database Snapshot on server B, they are not listed.

If i manually try to fix orphans on X-snapshot on server B, it throws the error

Failed to update database "X-snapshot" because the database is read-only

The snapshot job runs every 30 mins.

Please clarify or suggest how to fix the orphaned users in the snapshot

  • Most likely your login security identification number (SID) does not match between server A and B. Oct 5 '17 at 3:37

You can transfer the logins that are associated with orphaned users from server A to server B using the method explained in this KB article.

How to transfer logins and passwords between instances of SQL Server

Or you can use Copy-DbaLogin PowerShell command to do it.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.