Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sp_DatabaseRestore: Option to fixup orphan database users #3267

Closed
sqlslinger opened this issue May 1, 2023 · 0 comments
Closed

sp_DatabaseRestore: Option to fixup orphan database users #3267

sqlslinger opened this issue May 1, 2023 · 0 comments

Comments

@sqlslinger
Copy link
Contributor

sqlslinger commented May 1, 2023

Is your feature request related to a problem? Please describe.
A cross-server database restore needs to fixup database_principals that do not link correctly to server_principals.

Describe the solution you'd like
New Option @FixOrphanUsers BIT = 1. If 1, once restore is complete, sets database_principals.principal_id to the value of server_principals.principal_id where database_principals.name = server_principals.name.

Describe alternatives you've considered
Alternatively, this could be a separate procedure. But it really only has utility after a cross-server database restore, so it seems to be a natural fit in a restore procedure.

Are you ready to build the code for the feature?
Yes, the code is not difficult and we have coded it in existing procedures.

sqlslinger added a commit to sqlslinger/SQL-Server-First-Responder-Kit that referenced this issue May 1, 2023
Implements issue BrentOzarULTD#3267
Fix database_principals that do not match server_principals after a cross-server restore.
sqlslinger added a commit to sqlslinger/SQL-Server-First-Responder-Kit that referenced this issue May 1, 2023
sqlslinger added a commit to sqlslinger/SQL-Server-First-Responder-Kit that referenced this issue May 3, 2023
Implements issue BrentOzarULTD#3267
Fix database_principals that do not match server_principals after a cross-server restore.
sqlslinger added a commit to sqlslinger/SQL-Server-First-Responder-Kit that referenced this issue May 8, 2023
Implements issue BrentOzarULTD#3267
Fix database_principals that do not match server_principals after a cross-server restore.
sqlslinger added a commit to sqlslinger/SQL-Server-First-Responder-Kit that referenced this issue May 10, 2023
Implements issue BrentOzarULTD#3267
Fix database_principals that do not match server_principals after a cross-server restore.
sqlslinger added a commit to sqlslinger/SQL-Server-First-Responder-Kit that referenced this issue May 15, 2023
Implements issue BrentOzarULTD#3267
Fix database_principals that do not match server_principals after a cross-server restore.
@BrentOzar BrentOzar added this to the 2023-06 Release milestone Jun 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants