Mirroring failover : SQL Server 2008 R2

  • We use database mirroring ( high safety) for our HA needs.

    Our application uses db_datareader & db_datawriter role for running the applications.

    I had set up the application user account on mirror using the SID of primary.

    But when ever the fail-over happens, I have to explicitly assign the role to the new primary.(old mirror)

    Am i missing something? Is there any way that I should not involve myself when ever the fail-over happens?

    Environment :- SQL Server 2008 R2 Standard Edition.

  • Anybody...Please..

  • Neeraj Dwivedi (5/10/2013)


    We use database mirroring ( high safety) for our HA needs.

    Our application uses db_datareader & db_datawriter role for running the applications.

    I had set up the application user account on mirror using the SID of primary.

    But when ever the fail-over happens, I have to explicitly assign the role to the new primary.(old mirror)

    Am i missing something? Is there any way that I should not involve myself when ever the fail-over happens?

    Environment :- SQL Server 2008 R2 Standard Edition.

    If all you were given is the informatioin above, no access to the systems or anything else, do you think you could answer the question?

    Really need more informatiion about the systems, etc. if you want to get a good answer. I set up DB Mirroring and a previous employer, and I had to set it up such that on failover that the SQL users used by the application were synced to that servers logins for those users. This was automated so I didn't have to get involved.

    From your description of the problem I'm not sure what you are doing or why at the moment. Unfortunately I also don't have access to a mirrored system to do any exploratory testing.

  • So if I understand correctly, you have created a login and associated user on the Mirror that match those on the Primary; is that correct?

    On the mirror, did you also add the user as a member of the db_datareader and db_datawriter roles when you created it?

  • Yes, that's right and also using the same SID as of primary.

  • Lynn,

    Please let me know what information you want. I will provide as much as information I could give.

    It is standard mirroring set up with high safety.

    All the Servers are :-

    SQL Server is : Microsoft SQL Server 2008 R2 (SP1) - 10.50.2500.0 (X64)

    OS is - Windows Server 2008 R2 enterprises.

  • Sorry, not enough info and even if I had a sandbox to play in not enough to even try to emulate your environment.

  • Thank Lynn,

    At least you tried.

  • Lempster (5/10/2013)


    On the mirror, did you also add the user as a member of the db_datareader and db_datawriter roles when you created it?

    You didn't specifically answer my second question. Did you add the user to the two roles?

    Also, are you using a Witness server and failing over automatically or are you invoking a manual failover?

    Regards

    Lempster

  • Yes, I add the user to 2 roles in mirror and it is high safety and failing over automatically.

  • I have to ask again, please provide a step by step description of everything you have done, from setting up the mirror to testing the failover and what you have to do upon failover. Provide all the SQL you use (removing/replacing those things that are proprietary or sensitive).

  • Thank you very much Lynn for asking me to write the step by step script for you to replicate issue on your side.

    While I was doing that I just realized that the default database for the Application user being as "Master".

    So anytime the failover was happening the user was able to connect to Master but not the User DB.

    I corrected it and it started working as expected.

    Thanks you very much again.

  • Neeraj Dwivedi (5/13/2013)


    ...While I was doing that I just realized that the default database for the Application user being as "Master".

    So anytime the failover was happening the user was able to connect to Master but not the User DB.

    I corrected it and it started working as expected.

    Thanks you very much again.

    Glad you've resolved the issue, but if the login and user was scripted from Production, I don't see how you could have got into this situation in the first place.

    Regards

    Liam

  • Please find attached the step by step script to reproduce the issue. What I realized that unless you explicitly specify DEFAULT_DATABASE=your Mirrored DB, it does not work.

  • Thanks for providing the steps. If you had run step 3 on the Mirror, that would've prevented the issue I think - I will test it out when I get time.

    Regards

    Lempster

Viewing 15 posts - 1 through 15 (of 20 total)

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