"Set Partner Failover" "User must be in the master database"?

  • I'm trying to switch roles in a mirroring session from mirror to principal using the following statement on the principal.

    alter database [dbname] Set Partner Failover;

    I get the following error message

    Msg 5001, Level16, State 1, Line 1

    User must be in the master database.

    The command executes fine on the original principal and failover to the mirror happens flawlessly.

    The command fails when executing on the 'mirror' server when that database has the Principal role.

    I am able to failback to the original principal using the GUI though.

    Any ideas why I get that message doing the role switch via T-SQL??

  • Are all your SQL logins that exist on the principal server available on the instance hsoting the mirror which are used by your mirrored database?

    MCITP SQL 2005, MCSA SQL 2012

  • The logins match on both servers.

  • For the SQL Logins (opposed to the windows logins) do they have the same SID?

    MCITP SQL 2005, MCSA SQL 2012

  • are you connected to the master database when you issue the command?

    ---------------------------------------------------------------------

  • george sibbald (11/20/2013)


    are you connected to the master database when you issue the command?

    as this has not received a response what I meant by this was you must be in the context of the master database when issuing the command

    alter database [dbname] Set Partner Failover

    that is what the error message

    Msg 5001, Level16, State 1, Line 1

    User must be in the master database.

    is referring to

    ---------------------------------------------------------------------

  • could this script fix this problem?

    use master

    alter database [dbname] Set Partner Failover

    i am not sure if it works for a mirror failover

Viewing 7 posts - 1 through 6 (of 6 total)

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