Implementing Database Mirroring

Posted on 2008-11-11
Last Modified: 2012-08-14

Can anyone please tell me how to implement database mirroring step by step.

I have 2 servers
Server01 for production
Server02 for mirroring
Both server are configured the same.
   -- SQL 2005 64bit SP 2

Question by:Anvie
    LVL 1

    Accepted Solution

    1. Make sure all your Servers are running under the same account under Services
    2. Go to your primary server's Microsoft SQL Management Studio.
    3. Right click the database you wish to mirror and click backup (This is a two part step. Pay close attention).
    4. Do a FULL backup of your database to any place. Wait for this to finish.
    5. Do a Transaction log backup.
    6. Go to your mirror server's Microsoft SQL Management Studio.
    7. The database should not exist here yet. Right click Databases and click Restore Database...
    8. Type the database name in the "To Database" text box.
    9. Click From Device and get add your main bak file.
    10. Check the Restore box and then click Options at the top left.
    11. On the Recovery state set RESTORE WITH NORECOVERY (The second radio button).
    12. Once that is done. Repeat the Recovery steps for the transaction file backup. (It also needs NORECOVERY on options).
    13. Go back to the Primary Server's Management Studio and right click the database to be mirrored.
    14. Select Tasks and then Mirroring.
    15. Configure Security. Make sure Encrypt data is off on all of the server connections (Another issue I had during setup. My witness server had "Encrypt data sent through this endpoint" set to on and it broke. See the note below on how to remove Encrypt data if it is prepopulated and you can't uncheck it.
    16. Leave the Security boxes blank.
    17. Before strating mirroring make sure that server accounts on all servers have connect permission.

    Author Comment

    Thanks for the complete process.

    I followed everything you said and it works fine until I click start mirroring. i got this error:

    TCP//ServerName.DomainSegment:POrt connot be reached or not exist. is there a way to find this domain segment information. like Select @@ServerName or select @@version?


    Author Closing Comment

    Thanks again!

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
    For both online and offline retail, the cross-channel business is the most recent pattern in the B2C trade space.
    Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.
    Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

    730 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now