How to grant a login access to that db when that db is in "StandBy /ReadOnly" mode?

  • Hi, how do grant a login access to that db when that db is in "StandBy /ReadOnly" mode (after a trans log restore each hour). When I tried, I gets "Failed to update database...because the database is read-only".

    If i flips it a ALTER DATABASE db_name WITH RECOVERY and then grants it, it will work, but my subsequent T-log restores (append) no longer works.

    Thanks.

  • The only ways I can think of are:

    Grant them the permissions on the source database.

    Make them sysadmin on the server where the read-only database is located.

    Neither is a really a good choice.

  • Yes .Jones is right...

    I've recently done this.Create a login in source server and map the user to the source database.After one hour the user will get updated in stand-by database but it will be an orphan.

    Create a login in the standby server by using the source server's SID.

    Create login with SID=' '

    It will get automatically mapped to the standby Db's user.

  • 1. Create a login on the source server, give all the permissions you need on the standby database

    2. Disable the login on the source server, so nobody can use it to connect

    3. Create a login on the destination server with the same SID and it will automaticaly map when you restore the database and get all the permissions you granted in step 1 on the source database

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

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