Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

orphaned users in sql server Expand / Collapse
Author
Message
Posted Wednesday, July 24, 2013 2:21 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, December 26, 2013 9:50 PM
Points: 1, Visits: 13
hi this is reddi Krishna i created a new login at server level and mapped to user level permissions after i have executed the below command

select *from sys.sysusers and select *from sysusers

by executing both these commands i got the same sid no. after i deleted the login which i had created server level login. after i execute the following command

sp_change_users_login 'report'

by executing this command i got below created user name and sid.

nikil 0x191792319FBF2A4788077A5F20567D7D

so,from this what can i do for getting identification of orphaned users
please reply as early as possible
Post #1476920
Posted Wednesday, July 24, 2013 3:02 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 1:31 PM
Points: 2,389, Visits: 2,924
Start by reading about the "sp_change_users_login" at http://msdn.microsoft.com/en-us/library/ms174378.aspx

The option 'report' has resulted in a list of users within the current database that do not have a link to a login. By using the 'auto_fix' or the 'update_one' option, you can (re-)establish this link.
exec sp_change_users_login 'auto_fix', 'nikil'



** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
Post #1476931
Posted Thursday, July 25, 2013 5:04 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, October 3, 2014 2:10 AM
Points: 141, Visits: 200
Alternatively, you could transfer the logins and passwords from the original server to the target server. This can have the advantage of not having to deal with orphaned users after a database has been restored to a different server. It involves creating a couple of stored procedures in the original server's master database - see article http://support.microsoft.com/kb/918992 for details.
Post #1477433
Posted Friday, July 26, 2013 1:21 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Saturday, October 11, 2014 12:31 AM
Points: 115, Visits: 239
After executing the below 1st command, we got the list of orphan logins, it listed out and i selected one of the users to auto_fix. But unfortunately it throws below error. Hope we also need to give the password to fix this. If any one has complete knowledge could you share?
sp_change_users_login 'report'

sp_change_users_login 'auto_fix', 'kumar'

Msg 15600, Level 15, State 1, Procedure sp_change_users_login, Line 214
An invalid parameter or option was specified for procedure 'sys.sp_change_users_login'.


Thanks,
I’m nobody but still I’m somebody to someone………….
Post #1477888
Posted Friday, July 26, 2013 6:34 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Wednesday, September 17, 2014 1:16 PM
Points: 25, Visits: 129
The most likely reason is no login named "Kumar" exists, so the [sp_change_users_login] proc can't successfully un-orphan the user.

See if you have a login named 'kumar'. If not, create one and try the auto_fix again.
Post #1477965
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse