Log in
::
Register
::
Not logged in
Home
Tags
Articles
Editorials
Stairways
Forums
Scripts
Videos
Blogs
QotD
Books
Ask SSC
SQL Jobs
Training
Authors
About us
Contact us
Newsletters
Write for us
Recent Posts
Recent Posts
Popular Topics
Popular Topics
Home
Search
Members
Calendar
Who's On
Home
»
SQL Server 2008
»
SQL Server Newbies
»
orphaned Users
orphaned Users
Rate Topic
Display Mode
Topic Options
Author
Message
brangaraja
brangaraja
Posted Wednesday, January 02, 2013 9:46 PM
Forum Newbie
Group: General Forum Members
Last Login: Monday, April 08, 2013 11:19 AM
Points: 3,
Visits: 55
hi can you please any one tell me what is exactly orphaned users and when will use this one and how to troubleshoot?
Thanks in Advance.
Regards,
Raja.
Post #1402166
Rama Chandra Gowtham. Peddada
Rama Chandra Gowtham. Peddada
Posted Wednesday, January 02, 2013 10:04 PM
Grasshopper
Group: General Forum Members
Last Login: Saturday, January 12, 2013 10:49 AM
Points: 14,
Visits: 129
Attaching and restoring databases from one server instance to another are common tasks executed by a DBA.If we move our database to another SQL Server instance through any process, the new server might or might not have the same logins and the SIDs of these logins would probably be different from the SIDs of these logins in the original server. What this means is that, the sysusers table in the moved database has SIDs that are not matched with the login info in the master database on this new server. Therefore we get orphaned users
Once the Database is restored on the new instance. Run the below commands to troubleshoot and fix the issue.
-Command to generate list of orphaned users
USE <DBNAME>
GO
sp_change_users_login @Action='Report'
GO
--Command to map an orphaned user
EXEC sp_change_users_login 'Auto_Fix', '<Username>'
GO
If a login name does not exists, you would have to create it first before doing the mapping. A quick way to do this is to use the following command which will create the login and then map the login to the user
--Command to map an orphaned user to a login that is not present but will be created
EXEC sp_change_users_login 'Auto_Fix', '<Username>', null,'<pwd>'
GO
Post #1402169
Bhuvnesh
Bhuvnesh
Posted Thursday, January 03, 2013 4:19 AM
SSCrazy
Group: General Forum Members
Last Login: Tuesday, March 26, 2013 8:41 AM
Points: 2,562,
Visits: 3,451
brangaraja (1/2/2013)
hi can you please any one tell me what is exactly orphaned users and when will use this one and how to troubleshoot?
For details see this link
http://www.mssqltips.com/sqlservertip/1590/understanding-and-dealing-with-orphaned-users-in-a-sql-server-database/
-------Bhuvnesh----------
While 1 = 1 (Learning SQL....)
Click to get fast response of your post
Post #1402286
Bhuvnesh
Bhuvnesh
Posted Thursday, January 03, 2013 4:21 AM
SSCrazy
Group: General Forum Members
Last Login: Tuesday, March 26, 2013 8:41 AM
Points: 2,562,
Visits: 3,451
Rama Chandra Gowtham. Peddada (1/2/2013)
Attaching and restoring databases from one server instance to another are common tasks executed by a DBA.If we move our database to another SQL Server instance through any process, the new server might or might not have the same logins and the SIDs of these logins would probably be different from the SIDs of these logins in the original server. What this means is that, the sysusers table in the moved database has SIDs that are not matched with the login info in the master database on this new server. Therefore we get orphaned users
Once the Database is restored on the new instance. Run the below commands to troubleshoot and fix the issue.
-Command to generate list of orphaned users
USE <DBNAME>
GO
sp_change_users_login @Action='Report'
GO
--Command to map an orphaned user
EXEC sp_change_users_login 'Auto_Fix', '<Username>'
GO
If a login name does not exists, you would have to create it first before doing the mapping. A quick way to do this is to use the following command which will create the login and then map the login to the user
--Command to map an orphaned user to a login that is not present but will be created
EXEC sp_change_users_login 'Auto_Fix', '<Username>', null,'<pwd>'
GO
you need to give credit to the main poster/blogger OR even paste his/her link.These are forum etiquettes
-------Bhuvnesh----------
While 1 = 1 (Learning SQL....)
Click to get fast response of your post
Post #1402288
anthony.green
anthony.green
Posted Thursday, January 03, 2013 4:35 AM
SSCertifiable
Group: General Forum Members
Last Login: Friday, April 12, 2013 3:51 AM
Points: 5,075,
Visits: 4,831
Also remember that sp_change_users_login is a depreciated command, it has been replaced by ALTER LOGIN and will be removed from a future release on SQL.
Want an answer fast? Try here
How to post data/code for the best help - Jeff Moden
Need a string splitter, try this - Jeff Moden
How to post performance problems - Gail Shaw
CrossTabs-Part1
&
Part2 - Jeff Moden
SQL Server Backup, Integrity Check, and Index and Statistics Maintenance - Ola Hallengren
Managing Transaction Logs - Gail Shaw
Troubleshooting SQL Server: A Guide for the Accidental DBA - Jonathan Kehayias and Ted Krueger
Post #1402294
Vikas Pathak
Vikas Pathak
Posted Friday, January 04, 2013 1:40 AM
Grasshopper
Group: General Forum Members
Last Login: Yesterday @ 1:24 AM
Points: 10,
Visits: 51
I hope this link will help you..
http://sqlscripthub.blogspot.in/2012/11/sqlworld.html
Post #1402746
« Prev Topic
|
Next Topic »
Permissions
You
cannot
post new topics.
You
cannot
post topic replies.
You
cannot
post new polls.
You
cannot
post replies to polls.
You
cannot
edit your own topics.
You
cannot
delete your own topics.
You
cannot
edit other topics.
You
cannot
delete other topics.
You
cannot
edit your own posts.
You
cannot
edit other posts.
You
cannot
delete your own posts.
You
cannot
delete other posts.
You
cannot
post events.
You
cannot
edit your own events.
You
cannot
edit other events.
You
cannot
delete your own events.
You
cannot
delete other events.
You
cannot
send private messages.
You
cannot
send emails.
You
may
read topics.
You
cannot
rate topics.
You
cannot
vote within polls.
You
cannot
upload attachments.
You
may
download attachments.
You
cannot
post HTML code.
You
cannot
edit HTML code.
You
cannot
post IFCode.
You
cannot
post JavaScript.
You
cannot
post EmotIcons.
You
cannot
post or upload images.
Copyright © 2002-2013 Simple Talk Publishing. All Rights Reserved.
Privacy Policy.
Terms of Use.
Report Abuse.