Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Restore Database

Author  Topic 

chriztoph
Posting Yak Master

184 Posts

Posted - 2010-04-07 : 02:54:33
Hi!

I just need a bit help in restoring a database.
This is the scenario,I successfully restored my database in my local the users need to re-map because my front-end cannot run because the database login cannot find.

i can solve this by re-maping the user of the database.

My question is,how can i configure the database that when i restore the database backup i don't to re-map the user of the database?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-04-07 : 16:53:48
Run sp_change_users_login to fix the orphaned users, or copy the logins over with the same sids as the primary server.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page

chriztoph
Posting Yak Master

184 Posts

Posted - 2010-04-07 : 20:27:43
what Action will i use?

i didn't get this one 'copy the logins over with the same sids as the primary server.'
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2010-04-07 : 20:52:24
Here's a script I wrote to copy all logins from one SQL instance to another: http://weblogs.sqlteam.com/tarad/archive/2008/06/24/How-to-transfer-SQL-logins-between-SQL-Server-2005-instances.aspx

The benefit of this script is that you get the passwords and sids so you never need to remap the logins after a restore. The logins aren't orphaned this way.



Otherwise, specify Update_One for the action.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -