Grant access to SQL logins on a standby database

  • Hello,

    I have a user called 'Reportuser' in the primary DB server. I created the same user in the reporting server master db.

    When I restore my DB in Standby/Readonly state to the reporting server, the 'ReportUser' stop functioning.

    After the restore from primary server to Reporting server, the user 'reportuser' losses the mapping and is not associated with any DBs. When I try to add I get a msg stating that the user cannot be modified since the DB is in Stanby/Readonly mode.

    Any suggestions?

  • Hi Ammad,

    The Reportuser user in the restored database has been orphaned.  This link should tell you all you need to do to fix it:

    http://vyaskn.tripod.com/troubleshooting_orphan_users.htm

    Cath

  • The logins are always stored in the Master database irrespective of the database and the SID of the Reportuser should be different.  That should have caused the issue.

  • I've run across the same problem with Log Shipping, but sp_help_revlogin makes it easy.  Just create the procedure on the primary database server (in master) and run it in Query Analyzer.  Then copy the results and paste into a QA window that is connected to the Secondary database server.  Next delete all user accounts except the one you want and run it.  This will match up the logins with the user accounts.  You can find the procedure here.

    http://support.microsoft.com/kb/246133

  • if the SQL Server logins already exists on the destination server you should use

    sp_change_users_login 'Report' to verify which are orphaned

    and sp_change_users_login 'UPDATE_ONE', 'user','user' to remap to


    * Noel

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply