Login failed for user AG secondary replica

Copper Contributor

 

When i perform the restore and AG secondary replica received the following  error 

 

Login failed for user 'DSPDomain\dsp_sql'. Reason: Failed to open the explicitly specified database 'PS_Data Analysis'. [CLIENT: <local machine>]

Login failed for user 'DSPDomain\gshpv-sql02$'. Reason: Could not find a login matching the name provided. [CLIENT: <local machine>]

 

can you please assist  to resolve the issue

2 Replies
Hello,

Note that Logins are not replicated automatically from Primary to replicas so you have to create it manually to all the replicas

do not create the login on replicas manually. use below script. you should run it on the primary and the output will be the script that has to be applied to the replicas. It will help you to transfer logins, passwords (for sql logins ( and all the hashes)

https://learn.microsoft.com/en-us/troubleshoot/sql/database-engine/security/transfer-logins-password...

Also you are referencing the account DSPDomain\gshpv-sql02$ . make sure it is created as Login on the replica after you run the scripts


Regards
Javier
Thank you for your prompt response. After adding the service account has successfully resolved the issue.