|
sql
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
user accounts after restore in SQL 2000We have 2 SQL servers: PROD and TEST. Obviously, the TEST is a test
environment for PROD. Both of them identical and have same user accounts with same permissions. When there is a need to backup PROD and restore it to TEST are there any manipulations with user accounts need to be done? My superior says that after restoring database in TEST, user accounts have to be deleted by opening Database/Users (quote: not from Security/Logins), then they have to be deleted from Security/Logins, and finally, they have to be recreated from Database/Users/New Database user and same permissions as before applied. He says that after restoring a database, user accounts "don't get linked to the database properly". I think that there is nothing to worry about after restoration since those accounts already existed on TEST, so they all should work just fine. Can someone knowledgeable give some "scientific" explanation to this? Check out sp_change_users_login in the BOL.
-- Tom ---------------------------------------------------- Thomas A. Moreau, BSc, PhD, MCSE, MCDBA SQL Server MVP Columnist, SQL Server Professional Toronto, ON Canada www.pinpub.com "Vasya" <Va***@discussions.microsoft.com> wrote in message We have 2 SQL servers: PROD and TEST. Obviously, the TEST is a testnews:34FBBCBF-1D87-4D06-AB3A-6F0CF9654A61@microsoft.com... environment for PROD. Both of them identical and have same user accounts with same permissions. When there is a need to backup PROD and restore it to TEST are there any manipulations with user accounts need to be done? My superior says that after restoring database in TEST, user accounts have to be deleted by opening Database/Users (quote: not from Security/Logins), then they have to be deleted from Security/Logins, and finally, they have to be recreated from Database/Users/New Database user and same permissions as before applied. He says that after restoring a database, user accounts "don't get linked to the database properly". I think that there is nothing to worry about after restoration since those accounts already existed on TEST, so they all should work just fine. Can someone knowledgeable give some "scientific" explanation to this? I did. The key word is "MAY".
If you restore a database on a different instance of SQL Server than the one on which the backup was created, you MAY need to run sp_change_users_login to update user login information. For more information, see sp_change_users_login. May or may not. The instance is different, but it has absolutely same account as the server on which the backup was created... After restoring, I can see that the account is there with correct permissions... Will it work? "Account" doesn't really have a meaning within SQL Server. You have logins,
which allow you to connect to the server, and users, which control permissions within a database. Users and Logins are linked via Security Identifiers (SIDs). When you restore a database to a new environment, the users and corresponding permissions permissions exist as they were on the source server. The users are no longer linked to particular logins, even if the logins and users have the same names. This is intentional to avoid accidentally granting access to a restored database. sp_change_users_logins allows you to link an existing database user to a server login and is specifically intended for use in cross-server restores -- Show quoteHide quoteGeoff N. Hiten Senior Database Administrator Microsoft SQL Server MVP .. "Vasya" <Va***@discussions.microsoft.com> wrote in message news:4098ED48-5B7C-4AA0-A244-89AB3EE547ED@microsoft.com... >I did. The key word is "MAY". > > If you restore a database on a different instance of SQL Server than the > one > on which the backup was created, you MAY need to run sp_change_users_login > to > update user login information. For more information, see > sp_change_users_login. > > May or may not. The instance is different, but it has absolutely same > account as the server on which the backup was created... After restoring, > I > can see that the account is there with correct permissions... Will it > work?
Other interesting topics
Difference between 2000 and 2005. Maybe a bug?
Sql Server 2005 - SMS "Modify Table option" times out when trying to 'alter' very large table sql2k log backup SQLExpress Rename Cluster Instance - New Hardware - Keep Name Moving the SQL 2005 System Tables SQL Server CPU Spikes Object search query??? query performance with large tables linked server to Excel |
|||||||||||||||||||||||