SQLTeam.com | Weblogs | Forums

How to link user on a loggedship DB


#1

I need to execute the cmd sp_change_users_login

How can I do this with out breaking the log shipping?

Many thanks


#2

If you are on the main instance then the command should not be a problem.


#3

I am on the log shipped instance


#4

If you are on the logged shipped instance I can see no need to change the user login. The DB will be RO so I doubt you can do it anyway.

What I suspect you need to do is copy the login, including it's SID, from the main instance. You can use something like the following to get the CREATE command.

https://support.microsoft.com/en-gb/help/918992/how-to-transfer-logins-and-passwords-between-instances-of-sql-server

ie

  1. Delete the login on the logged shipped instance.
  2. Get the login info from the main instance.
  3. Create the login on the logged shipped instance using the same SID as the main instance.

The user will then point at the correct login SID so you will need to change nothing in your logged shipped DB.