SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


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


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

Author
Message
alanspeckman
alanspeckman
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2134 Visits: 768
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??
RTaylor2208
RTaylor2208
SSCertifiable
SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)

Group: General Forum Members
Points: 6960 Visits: 1313
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
alanspeckman
alanspeckman
SSCrazy
SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)SSCrazy (2.1K reputation)

Group: General Forum Members
Points: 2134 Visits: 768
The logins match on both servers.
RTaylor2208
RTaylor2208
SSCertifiable
SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)SSCertifiable (7K reputation)

Group: General Forum Members
Points: 6960 Visits: 1313
For the SQL Logins (opposed to the windows logins) do they have the same SID?

MCITP SQL 2005, MCSA SQL 2012
george sibbald
george sibbald
SSC Guru
SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)

Group: General Forum Members
Points: 59028 Visits: 13706
are you connected to the master database when you issue the command?

---------------------------------------------------------------------
george sibbald
george sibbald
SSC Guru
SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)SSC Guru (59K reputation)

Group: General Forum Members
Points: 59028 Visits: 13706
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

---------------------------------------------------------------------
Andreas Kreuzberg
Andreas Kreuzberg
SSCrazy
SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)SSCrazy (2.5K reputation)

Group: General Forum Members
Points: 2454 Visits: 1328
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
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search