locked
Database Mirroring RRS feed

  • Question

  • I encountered following error while starting mirroring:

    database does not exist on the mirror server instance. You must restore a backup of the principal database on the mirror server instance before starting mirroring.

    But I have already restored the database in the mirror server and the database is present there. Why is it showing this error?

    Tuesday, March 13, 2018 10:20 AM

All replies

  • Hi Curendra,

    Please first make sure that you have met the following requirements:

    1. The principal and mirror server instances must be running on the same version and edition of SQL Server.

    2. The database must use the full recovery model and the mirror database must be in the RESTORING state.

    3. The name of the mirror database must be the same as the name of the principal database.

    If you have met all the above requirement, please check the permission of the account used for creating mirroring on the mirror server, please check the SQL Server log to get more information related to it.

    Best Regards,

    Teige


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    • Proposed as answer by AV111 Wednesday, March 14, 2018 3:02 AM
    Wednesday, March 14, 2018 1:51 AM
  • check pre request mention by Teige  refer following step by step.

    Make sure that after restoring full backup do for log backup also.

    Any query let us know

    https://www.mssqltips.com/sqlservertip/2464/configure-sql-server-database-mirroring-using-ssms/



    https://social.technet.microsoft.com/wiki/contents/articles/37872.sql-server-installation-on-centos-linux.aspx

    Wednesday, March 14, 2018 3:02 AM
  • Hi Teige,

    I configured everything as you mentioned. Now the following error is encountered: 'the server network address <>:5022 cannot be reached or does not exist'

    Thank you.

    • Edited by Curendra Wednesday, March 14, 2018 4:25 AM
    Wednesday, March 14, 2018 4:25 AM
    1. Make sure the name of the mirror database is the same as the name of the principal database.
    2. Check the paths of the mirror database files are identical to the paths of the principal database files.
    Wednesday, March 14, 2018 5:46 AM
  • Hi Robin,

    Paths of the files also need to same for both principal and mirror databases?

    Wednesday, March 14, 2018 5:50 AM
  • Yes.
    Wednesday, March 14, 2018 10:12 AM
  • Hi Robin,

    I have made everything same in both principal and secondary servers. but in the end the error is:

    Thursday, March 15, 2018 5:06 AM
  • check following points step by step.

    1. Make sure that on Mirror Server the database is restored with NO RECOVERY option (This is the most common problem).

    2. Make sure that from Principal the latest LOG backup is restored to mirror server. (Attempt this one more time even though the full backup has been restored recently).

    3. Check if you can telnet to your ports using command TELNET ServerName Ports like “telnet SQLServerName 5023”.

    4. Make sure your firewall is turned off.

    5. Verify that the endpoints are started on the partners by using the state or state_desc column the of the sys.database_mirroring_endpoints catalog view. You can start end point by executing an ALTER ENDPOINT statement.
    6. Try the following command as one of the last options.

    GRANT CONNECT ON ENDPOINT::Mirroring TO ALL

     7. Delete the end points and recreate them.

    refer


    https://social.technet.microsoft.com/wiki/contents/articles/37872.sql-server-installation-on-centos-linux.aspx

    Friday, March 16, 2018 2:34 AM
  • Hello Av,

    I did everything but still the error persists. 

    Friday, March 16, 2018 4:30 AM