December 13, 2012 at 11:35 am
It is common place for us to restore a backup when moving from a QA/Staging server to a Production server. When I do this, however, I sometimes have to drop by application's login and database user and run a script to re-create them. Sometimes, the Enforce Password Policy checkbox is checked after a backup/restore. What's the best way to make sure that I don't have to drop/re-create the login/user?
December 13, 2012 at 12:18 pm
Not corruption.
When the logins were created on the QA server they were not created with the same SID as the production server. Hence when the backup is restored, the SID in the database for the user does not match the SID of the login. It's called orphaned users.
Best way to fix it permanently is to drop all logins, script the logins from production with their SIDs and then run that script on QA. Once that's done, any backup from production that's restored will have the same SID for user and login and the logins will automatically work,
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
Viewing 2 posts - 1 through 1 (of 1 total)
You must be logged in to reply to this topic. Login to reply