Trouble shooting DB mirroring shouldn't be this difficult...

Answered Trouble shooting DB mirroring shouldn't be this difficult...

  • 21. března 2012 21:44
     
     

    OK, I have gone through enough google searches, forum searches and I still have no solution. We need to setup DB mirroring to include our BB BE environment in our yearlyDR plan. To do this, instead of playing on our production server, we decided to use 2 DEV servers and setup DB mirroring. Boy, did we know what we were getting into. At the outset, the concept looks pretty simple and when we tried to "start" DB mirroring, it chokes with the following error. When we looked in the SQL Log, we see the error message "Database mirroring has been terminated for database ....." We have gone around in circles for atleast 2 days and we were wondering if anyone has any ideas on what may be wrong here before we involve MicroSoft. We use Domain id on both the primary and backup servers. TIA

    TITLE: Database Properties
    ------------------------------

    An error occurred while starting mirroring.

    ------------------------------
    ADDITIONAL INFORMATION:

    Alter failed for Database 'DB_MIRRORING_TEST'.  (Microsoft.SqlServer.Smo)

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1617.0+((KJ_RTM_GDR).110422-1901+)&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Alter+Database&LinkId=20476

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

    An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)

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

    The server network address "TCP://<servername>:1433" can not be reached or does not exist. Check the network address name and that the ports for the local and remote endpoints are operational. (Microsoft SQL Server, Error: 1418)

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1617&EvtSrc=MSSQLServer&EvtID=1418&LinkId=20476

    ------------------------------
    BUTTONS:

    OK
    ------------------------------


    Jagannathan Santhanam

Všechny reakce

  • 21. března 2012 22:01
     
      Obsahuje kód

    Hi,

    How did you configure mirroring? Did you use TSQL DDL statements? If so can you post the code? Did you configure the endpoints?

    http://msdn.microsoft.com/en-us/library/ms189127.aspx

    This code will check your endpoints. Run this and post the results.

    SELECT perm.class_desc, perm.permission_name, endpoint_name = e.name, perm.state_desc,
     grantor = prin1.name, grantee = prin2.name
    FROM master.sys.server_permissions perm
     INNER JOIN master.sys.server_principals prin1 ON perm.grantor_principal_id = prin1.principal_id
     INNER JOIN master.sys.server_principals prin2 ON perm.grantee_principal_id = prin2.principal_id
     LEFT JOIN master.sys.endpoints e ON perm.major_id = e.endpoint_id
    WHERE  perm.class_desc = 'ENDPOINT'


    Sean Massey | Consultant, iUNITE

    Feel free to contact me through My Blog, Twitter or Hire Me.
    Please click the Mark as Answer button if a post solves your problem!

  • 22. března 2012 1:58
     
     

    I ran your SQL and here are the results:

    Primary Server:
    ===============
    ENDPOINT CONNECT TSQL Local Machine GRANT sa public
    ENDPOINT CONNECT TSQL Named Pipes GRANT sa public
    ENDPOINT CONNECT TSQL Default TCP GRANT sa public
    ENDPOINT CONNECT TSQL Default VIA GRANT sa public
    ENDPOINT CONNECT Mirroring GRANT CCC\jsanthanam CCC\servicesql

    Mirror Server:
    ==============
    I can't run the sQL on the mirrored server since the DB is in recovery mode and does not show up in SQL Management Studio. Let me know.


    Jagannathan Santhanam

  • 22. března 2012 3:11
     
     

    The endpoints can be checked on the mirror instance as well with the code.

    You still should be able to see the mirror copy of the database even though it will not serve connections you still should be able to see it.


    Sean Massey | Consultant, iUNITE

    Feel free to contact me through My Blog, Twitter or Hire Me.
    Please click the Mark as Answer button if a post solves your problem!

  • 22. března 2012 15:18
     
     
  • 22. března 2012 15:56
    Přispěvatel
     
     Odpovědět Obsahuje kód

    Hello,

    Your issue seems to be that the port specified in the mirroring partner was 1433 which is probably incorrect as that's the default tcp endpoint. You'll need to switch this to the port created for your mirroring payload:

    I didn't have a chance to check this, it's from memory so it may not work but you'll get the idea. You'll also want to check the roles specified when creating the endpoint (for example you didn't give your partner the role of witness).

    SELECT e.[name], e.endpoint_id, e.[state], is_encryption_enabled, connection_auth_desc, port FROM
    	sys.database_mirroring_endpoints e 
    	INNER JOIN sys.tcp_endpoints t
    		ON t.endpoint_id = e.endpoint_id

    -Sean

  • 27. března 2012 11:15
     
     

    Hi,

    This is because you're using incorrect port in mirroring configuration. Default tcp port for mirroring is 5022.

    The server network address "TCP://<servername>:1433" can not be reached or does not exist. Check the network address name and that the ports for the local and remote endpoints are operational. (Microsoft SQL Server, Error: 1418)


    Regards, Vishal Srivastava

  • 27. března 2012 12:58
     
      Obsahuje kód

    While configuring the database mirroring session, you need to provide the Port number, where your database Mirroring endpoint is listening to. Modify the script as follows, my database mirroring endpoint is listening on Port 7048:

    USE [master];  
    GO  
    ALTER DATABASE [TestDB]  
    SET PARTNER = 'TCP://ServerA:7048;  
    GO 

    Recently, I have created a SQL CMD script to setup database mirroring in a Lab environment, here is a link for the same: http://sudeeptaganguly.wordpress.com/2012/03/06/database-mirroring-with-sqlcmd/

    Hope, this may help :)


    SKG: Please Marked as Answered, if it resolves your issue.

  • 4. května 2012 19:22
     
     
    All - Thanks for all of your replies. The problem seems to be the port#. We are asked by RIM (black berry) to use the default port# 1433. Once we changed the port # to 5022, it started working. 

    Jagannathan Santhanam