Orphan logins fix

  • I have SQL database which is in Standby mode. This database is a secondary database in Logshipping. I have some Server level logins and I would like to sync it with the Standby database. I tried lot and it doesn't allow me to map the database to the logins.

    Does anyone have any idea how to sync logins in this case?

  • Drop the logins. Recreate them with the same SID (security identifier) as they have on the log shipping primary.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • Thanks for your reply. Thiese logins are Windows logins so no idea how to deal with that.

  • You can't update the database when the database is in Standby/Read-only mode.

    BTW, As long as the SID for Logins in your primary and Secondary Server are same, you should be good.

  • If they are Windows logins, nothing to worry...Windows got you covered. SID remains same.

  • Windows logins shouldn't be able to be orphaned, their SIDs come from the AD.

    Those logins exist and have matching users on the log shipping primary?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • OK thanks. i checked and the user is in the database as well as under the logins. but the login is not mapped. so how do i map that login.

  • That's on the primary?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 8 posts - 1 through 7 (of 7 total)

You must be logged in to reply to this topic. Login to reply