Sql server ошибка 1418

SQL Server database mirroring error 1418 can occur due to several reasons, This tutorial will guide you in fixing this error without hassles.

Database Mirroring Error 1418

SQL Server comes with several inbuilt features for proper maintenance or availability of the database that supports failover clustering. One of them is SQL Server Database Mirroring, which is a disaster recovery and high availability technique that works only with databases using a full recovery model.

Though mirroring helps in increasing availability and data protection, the users encounter a common error while using the Mirroring feature, known as SQL Server Database Mirroring Error 1418. The blog discusses what is Microsoft SQL Server error 1418 Mirroring and how to resolve it.

SQL Server Database Mirroring Error 1418

The SQL Server Database Mirroring is a feature that involves two SQL Server instances where a copy of a single database is created on the same or different machines. One SQL Server instance that acts as a primary instance is called principal and other one is a mirrored instance called the mirror. One of the common Microsoft SQL Server error 1418 associated with mirroring that displays the following error message:

“The server network address cannot be reached or does not exist. Check the network address name and that the ports for the local and remote endpoints are operational.”

This error happens when the server network endpoint did not respond because the specified server network cannot be reached or it does not exist.

How to Troubleshoot Microsoft SQL Server Error 1418?

SQL Server Database Mirroring Error 1418 occurs due to connection problem between endpoints, the first thing we need to do is to check TCP/IP for the instance if it has been enabled or not.

Steps that need to be followed are:

  • Check if the system Firewall has not block SQL Server port.
  • Go to Computer Management → Service and Application → SQL Server 2005 Configuration → Network Configuration.
  • See if the TCP/IP protocol is enabled or not in Network Configuration and make sure that SQL SERVER port is by Default 1433.
  • Now check if TCP/IP protocol is enabled or not in Client Configuration Tab under Computer Management → Service and Application → SQL Server 2005 Configuration.

If the error cannot be resolved still, follow the below steps:

Manual Solutions Available for Users

  1. Service Accounts Verification
    • CONNECT permissions to partner’s endpoints is required by SQL Server Service account
    • It is recommended that we use domain accounts for all partners.
    • For Local service, certificate authentication should be used.
    • For Network service, computer account should be used.
    • See the SQL log for errors.
  2. Ports Verification
    While configuring network for a database mirroring session, database-mirroring endpoint of each server instance should be used only by database mirroring process. If another process is listening on the port assigned to database mirroring endpoint, the database mirroring processes of the other server instances cannot connect to the endpoint.

    • Use the netstat command to display all the ports on which Windows-based server is listening.
    • Use Telnet to test if the port is open and something is listening.
    • Ensure no other SQL instances are connected on the server.
    • Check if Firewall is allowing traffic both directions & not blocking the port
  3. Ensure all instances can access every other partner
    • Ping each partner from one another.
    • To trace the path of the IP, use tracert to each partner
    • Double check the ports if ping or tracert fails
  4. Verify Endpoints
    • Ensure that all endpoints are started.
    • Make sure all endpoints are using same encryption algorithm.
    • Ensure that OS supports chosen encryption algorithm on all partners.

Automated Solution if the Issue Arises Due to Database File Corruption

In case, the above-mentioned manual solutions do not work, then the problem is in the database. Evidently, the corruption in SQL databases is a well-known issue & this can also cause the mirroring SQL server error 1418. Simply download the repair & recovery tool that IT experts suggests to get rid of the corruption issues.

Download Now Purchase Now

After downloading the tool, follow these five simple steps to get a detailed solution.

Step-1. Launch the Tool and Navigate to the Open button to start fixing error 1418.

click on open button

Step-2. Select Quick or Advance Scan to detect corruption.

set quick or advance scan options

Step-3. Preview the Database Objects and proceed further.

preview database objects

Step-4. Choose the Export settings accordingly as you prefer.

set export settings

Step-5. Finally, Click on Export to fix the SQL error 1418.

fix sql server database mirroring error 1418

Conclusion

The primary aim of this blog is to study the common error encountered by SQL database users while performing mirroring operations. Evidently, we hope now users can easily solve their Microsoft SQL Server Error 1418. This error restricts the server network endpoint from responding as the specified server network cannot be reached or it does not exist. It further suggests a solution for users to overcome SQL Server Database Mirroring Error 1418 using the steps defined in the blog.

  • Remove From My Forums
  • Question

  • Hi  Support,

    I am trying to mirroring a database in sql server. I created a database and took a backup of it and restored on the another instance(i am using same server but with different instances). But after doing all operations and click on start mirroring, then it
    showing following error.

    The server network address «TCP://indserver.xxxx.local:5022» can not be
    reached or does not exist. Check the network address name and reissue the command. (Microsoft SQL Server, Error: 1418)

    I followed mirroring steps in this «http://www.codeproject.com/Articles/31325/Step-by-Step-SQL-Mirroring-the-ASPState-Database» Here it says, create an user on both principal and mirror server with the same credentials in STEP 3.So please provide
    me solution for above error.

Answers

  • Hi Pankaj Sharma,

    According to your error message, we need to verify if you backup your database with full recovery model and restore this database to a mirror instance with NORECOVERY option. You need also verify all instances can access every other partner and make sure
    endpoints are running properly, you have granted the SQL Service Account CONNECT permission to the listener on the other machine.

    If after trying this you are still getting a 1418 error, here’s a blog post with a couple of other things to check for:

    http://blogs.msdn.com/grahamk/archive/2008/12/08/database-mirroring-error-1418-troubleshooter.aspx

    Regards,
    Sofiya Li


    Sofiya Li
    TechNet Community Support

    • Proposed as answer by

      Monday, May 5, 2014 6:18 AM

    • Marked as answer by
      Sofiya Li
      Friday, May 9, 2014 2:06 AM

    • Proposed as answer by
      Sofiya Li
      Monday, May 5, 2014 3:33 AM
    • Marked as answer by
      Sofiya Li
      Friday, May 9, 2014 2:06 AM
title description author ms.author ms.date ms.service ms.subservice ms.topic ms.custom helpviewer_keywords

Troubleshoot Always On Availability Groups Configuration (SQL Server)

Troubleshoot typical problems with configuring server instances for Always On availability groups in SQL Server.

MashaMSFT

mathoma

05/17/2016

sql

availability-groups

troubleshooting

seo-lt-2019

troubleshooting [SQL Server], deploying

Availability Groups [SQL Server], troubleshooting

Availability Groups [SQL Server], configuring

Troubleshoot Always On Availability Groups Configuration (SQL Server)

[!INCLUDE SQL Server]

This topic provides information to help you troubleshoot typical problems with configuring server instances for [!INCLUDEssHADR]. Typical configuration problems include [!INCLUDEssHADR] is disabled, accounts are incorrectly configured, the database mirroring endpoint doesn’t exist, the endpoint is inaccessible (SQL Server Error 1418), network access doesn’t exist, and a join database command fails (SQL Server Error 35250).

[!NOTE]
Ensure that you are meeting the [!INCLUDEssHADR] prerequisites. For more information, see Prerequisites, Restrictions, and Recommendations for Always On Availability Groups (SQL Server).

In This Topic:

Section Description
Always On Availability Groups Isn’t Enabled If an instance of [!INCLUDEssNoVersion] is not enabled for [!INCLUDEssHADR], the instance doesn’t support availability group creation and can’t host any availability replicas.
Accounts Discusses requirements for correctly configuring the accounts under which [!INCLUDEssNoVersion] is running.
Endpoints Discusses how to diagnose issues with the database mirroring endpoint of a server instance.
Network access Documents the requirement that each server instance that is hosting an availability replica must be able to access the port of each of the other server instances over TCP.
Listener Documents how to establish the IP address and port of the listener and make sure it is running and listening for incoming connections
Endpoint Access (SQL Server Error 1418) Contains information about this [!INCLUDEssNoVersion] error message.
Join Database Fails (SQL Server Error 35250) Discusses the possible causes and resolution of a failure to join secondary databases to an availability group because the connection to the primary replica isn’t active.
Read-Only Routing is Not Working Correctly
Related Tasks Contains a list of task-oriented topics in [!INCLUDEssnoversion] Books Online that are relevant to troubleshooting an availability group configuration.
Related Content Contains a list of relevant resources that are external to [!INCLUDEssNoVersion] Books Online.

Always On Availability Groups Is Not Enabled

The [!INCLUDEssHADR] feature must be enabled on each of the instances of [!INCLUDEssnoversion].

If the Always On Availability Groups feature isn’t enabled, you’ll get this error message when you try to create an Availability group on SQL Server.

The Always On Availability Groups feature must be enabled for server instance 'SQL1VM' before you can create an availability group on this instance. To enable this feature, open the SQL Server Configuration Manager, select SQL Server Services, right-click on the SQL Server service name, select Properties, and use the Always On Availability Groups tab of the Server Properties dialog. Enabling Always On Availability Groups may require that the server instance is hosted by a Windows Server Failover Cluster (WSFC) node. (Microsoft.SqlServer.Management.HadrTasks)

The error message clearly indicates that the AG feature isn’t enabled and also directs you how to enable it. There are two scenarios where you can get in this state besides the obvious one where AG wasn’t enabled in the first place.

  1. If SQL Server was installed and the Always On Availability Groups feature was enabled before you installed the Windows Failover Clustering feature, you may get this error when you attempt to create an Always On AG.
  2. If you remove an existing Windows Failover Clustering feature and rebuild it while SQL Server still has Always On configured, when you attempt to use AG again this error may occur.

In such cases you can take the following steps to resolve it:

  1. Disable the AG feature
  2. Restart SQL Server service
  3. Enable the AG feature back
  4. Again restart the SQL Service

For more information, see Enable and Disable Always On Availability Groups (SQL Server).

Accounts

The accounts under which [!INCLUDEssNoVersion] is running must be correctly configured.

  1. Do the accounts have the correct permissions?

    1. If the partners run under the same domain account, the correct user logins exist automatically in both master databases. This simplifies the security configuration and is recommended.

    2. If two server instances run under different accounts, then each account must be created in master on the remote server instance, and that server principal must be granted CONNECT permissions to connect to the database mirroring endpoint of that server instance. For more information, see Set Up Login Accounts for Database Mirroring or Always On Availability Groups (SQL Server). You can use the following query on each instance to check if the logins have CONNECT permissions:

    SELECT 
      perm.class_desc,
      prin.name,
      perm.permission_name,
      perm.state_desc,
      prin.type_desc as PrincipalType,
      prin.is_disabled
    FROM sys.server_permissions perm
      LEFT JOIN sys.server_principals prin ON perm.grantee_principal_id = prin.principal_id
      LEFT JOIN sys.tcp_endpoints tep ON perm.major_id = tep.endpoint_id
    WHERE 
      perm.class_desc = 'ENDPOINT'
      AND perm.permission_name = 'CONNECT'
      AND tep.type = 4    
  2. If [!INCLUDEssNoVersion] is running under a built-in account, such as Local System, Local Service, or Network Service, or a nondomain account, you must use certificates for endpoint authentication. If your service accounts are using domain accounts in the same domain, you can choose to grant CONNECT access for each service account on all the replica locations or you can use certificates. For more information, seeUse Certificates for a Database Mirroring Endpoint (Transact-SQL).

Endpoints

Endpoints must be correctly configured.

  1. Make sure that each instance of [!INCLUDEssNoVersion] that is going to host an availability replica (each replica location) has a database mirroring endpoint. To determine whether a database mirroring endpoint exists on a given server instance, use the sys.database_mirroring_endpoints catalog view:

    SELECT name, state_desc FROM sys.database_mirroring_endpoints  

    For more information on creating endpoints, see either Create a Database Mirroring Endpoint for Windows Authentication (Transact-SQL) or Allow a Database Mirroring Endpoint to Use Certificates for Outbound Connections (Transact-SQL).

  2. Check that the port numbers are correct.

    To identify the port currently associated with database mirroring endpoint of a server instance, use the following [!INCLUDEtsql] statement:

    SELECT type_desc, port FROM sys.tcp_endpoints;  
    GO  
  3. For [!INCLUDEssHADR] setup issues that are difficult to explain, we recommend that you inspect each server instance to determine whether it’s listening on the correct ports.

  4. Make sure that the endpoints are started (STATE=STARTED). On each server instance, use the following [!INCLUDEtsql] statement:

    SELECT state_desc FROM sys.database_mirroring_endpoints  
    

    For more information about the state_desc column, see sys.database_mirroring_endpoints (Transact-SQL).

    To start an endpoint, use the following [!INCLUDEtsql] statement:

    ALTER ENDPOINT Endpoint_Mirroring   
    STATE = STARTED   
    AS TCP (LISTENER_PORT = <port_number>)  
    FOR database_mirroring (ROLE = ALL);  
    GO  
    

    For more information, see ALTER ENDPOINT (Transact-SQL).

    [!NOTE]
    In some cases, if the endpoint is started but the AG replicas are not communicating, you may try to stop and restart the endpoint. You can use ALTER ENDPOINT [Endpoint_Mirroring] STATE = STOPPED followed by ALTER ENDPOINT [Endpoint_Mirroring] STATE = STARTED

  5. Make sure that the login from the other server has CONNECT permission. To determine who has CONNECT permission for an endpoint, on each server instance use the following [!INCLUDEtsql] statement:

    SELECT 'Metadata Check';  
    SELECT EP.name, SP.STATE,   
       CONVERT(nvarchar(38), suser_name(SP.grantor_principal_id))   
          AS GRANTOR,   
       SP.TYPE AS PERMISSION,  
       CONVERT(nvarchar(46),suser_name(SP.grantee_principal_id))   
          AS GRANTEE   
       FROM sys.server_permissions SP , sys.endpoints EP  
       WHERE SP.major_id = EP.endpoint_id  
       ORDER BY Permission,grantor, grantee;   
  6. Ensure correct server name is used in the endpoint URL

    For server name in an endpoint URL, it’s recommended to use fully qualified domain name (FQDN), although you can use any name that uniquely identifies the machine. The server address can be a Netbios name (if the systems are in the same domain), a fully qualified domain name (FQDN), or an IP address (preferably, a static IP address). Using the fully qualified domain name is the recommended option.

    If you’ve already defined an Endpoint URL, you can query it by using:

    select endpoint_url from sys.availability_replicas

    Next, compare the endpoint_url output to the server name (NetBIOS name or FQDN).
    To query the server name, run the following commands in a PowerShell on the replica locally:

    $env:COMPUTERNAME
    [System.Net.Dns]::GetHostEntry([string]$env:computername).HostName

    To validate the server name on a remote computer, run this command from PowerShell.

    $servername_from_endpoint_url = "server_from_endpoint_url_output"
    
    Test-NetConnection -ComputerName $servername_from_endpoint_url

    For more information, see Specify the Endpoint URL When Adding or Modifying an Availability Replica (SQL Server).

[!NOTE]
To use Kerberos authentication for the communication between availability group (AG) endpoints, register a Service Principal Name for Kerberos Connections for the database mirroring endpoints used by the AG.

Network Access

Each server instance that is hosting an availability replica must be able to access the port of each of the other server instance over TCP. This is especially important if the server instances are in different domains that don’t trust each other (untrusted domains). Check if you can connect to the endpoints by following these steps:

  • Use Test-NetConnection (equivalent to Telnet) to validate connectivity. Here are examples of commands you can use:

    $server_name = "your_server_name"
    $IP_address = "your_ip_address"
    $port_number = "your_port_number"
    
    Test-NetConnection -ComputerName $server_name -Port $port_number
    Test-NetConnection -ComputerName $IP_address -Port $port_number
  • If the Endpoint is listening and connection is successful, you will see «TcpTestSucceeded : True». If not, you’ll receive a «TcpTestSucceeded : False».

  • If Test-NetConnection (Telnet) connection to the IP address works but to the ServerName it doesn’t, there’s likely a DNS or name resolution issue

  • If connection works by ServerName and not by IP address, then there could be more than one endpoint defined on that server (another SQL instance perhaps) that is listening on that port. Though the status of the endpoint on the instance in question shows «STARTED», another instance may actually have the port bound and prevent the correct instance from listening and establishing TCP connections.

  • If Test-NetConnection fails to connect, look for Firewall and/or Anti-virus software that may be blocking the endpoint port in question. Check the firewall setting to see if it allows the endpoint port communication between the server instances that host primary replica and the secondary replica (port 5022 by default).
    Run the following PowerShell script to examine for disabled inbound traffic rules

  • If you’re running [!INCLUDEssNoVersion] on Azure VM, additionally you would need to ensure Network Security Group (NSG) allows the traffic to endpoint port. Check the firewall (and NSG, for Azure VM) setting to see if it allows the endpoint port communication between the server instances that host primary replica and the secondary replica (port 5022 by default)

    Get-NetFirewallRule -Action Block -Enabled True -Direction Inbound |Format-Table
  • Capture the output from Get-NetTCPConnection cmdlet (equivalent of NETSTAT -a) and verify the status is a LISTENING or ESTABLISHED on the IP:Port for the endpoint specified

Listener

For correct configuration of an Availability Group listener follow «Configure a listener for an Always On availability group»

  1. Once the listener is configured you can validate the IP address and port it is listening on by using the following query:

    $server_name = $env:computername  #replace this with your sql instance "serverinstance"
    
    sqlcmd -E -S$server_name -Q"SELECT dns_name AS AG_listener_name, port, ip_configuration_string_from_cluster 
    FROM sys.availability_group_listeners"
  2. You can also find the listener information together with the SQL Server ports using this query:

    $server_name = $env:computername      #replace this with your sql instance "serverinstance"
    
    sqlcmd -E -S($server_name) -Q("SELECT  convert(varchar(32), SERVERPROPERTY ('servername')) servername, convert(varchar(32),ip_address) ip_address, port, type_desc,state_desc, start_time 
    FROM sys.dm_tcp_listener_states 
    WHERE ip_address not in ('127.0.0.1', '::1') and type <> 2")
  3. If you need to establish connectivity to the listener and suspect a port is blocked, you can perform a test using the PowerShell Test-NetConnection cmdlet (equivalent to telnet).

    $listener_name = "your_ag_listener"
    $IP_address = "your_ip_address"
    $port_number = "your_port_number"
    
    Test-NetConnection -ComputerName $listener_name -Port $port_number
    Test-NetConnection -ComputerName $IP_address -Port $port_number
  4. Finally, check if the listener is listening on the specified port:

    $port_number = "your_port_number"
    
    Get-NetTCPConnection -LocalPort $port_number -State Listen

Endpoint Access (SQL Server Error 1418)

This [!INCLUDEssNoVersion] message indicates that the server network address specified in the endpoint URL can’t be reached or doesn’t exist, and it suggests that you verify the network address name and reissue the command.

Join Database Fails (SQL Server Error 35250)

This section discusses the possible causes and resolution of a failure to join secondary databases to the availability group because the connection to the primary replica isn’t active. This is the full error message:

Msg 35250 The connection to the primary replica is not active. The command cannot be processed.

Resolution:

Summary of steps is outlined below.

For detailed step-by-step instructions, refer to Engine error MSSQLSERVER_35250

  1. Ensure the endpoint is created and started.
  2. Check if you can connect to the endpoint via Telnet and ensure no firewall rules are blocking connectivity
  3. Check for errors in the system. You can query the sys.dm_hadr_availability_replica_states for the last_connect_error_number that may help you diagnose the join issue.
  4. Ensure the endpoint is defined so it correctly matches the IP/port that AG is using.
  5. Check whether the network service account has CONNECT permission to the endpoint.
  6. Check for possible name resolution issues
  7. Ensure your [!INCLUDEssNoVersion] is running a recent build (preferably the latest build to protect from running into fixed issues.

Read-Only Routing is Not Working Correctly

  1. Ensure that you have set up read-only routing by following Configure read-only routing document.

  2. Ensure Client Driver Support

    The client application must use a client provider that support ApplicationIntent parameter. See Driver and client connectivity support for availability groups

    [!NOTE]
    If you are connecting to a distributed network name (DNN) Listener, the provider must also support MultiSubnetFailover parameter

  3. Ensure connection string properties are set correctly

    For read-only routing to work properly, your client application must use these properties in the connection string:

    • A database name that belongs to the AG
    • An availability group listener name
      • If you’re using DNN, you must specify DNN listener name and DNN port number <DNN name,DNN port>
    • ApplicationIntent set to ReadOnly
    • MultiSubnetFailover set to true is required for Distributed network name (DNN)

    Examples

    This example illustrates the connection string for .NET System.Data.SqlClient provider for a virtual network name (VNN) listener:

    Server=tcp:VNN_AgListener,1433;Database=AgDb1;ApplicationIntent=ReadOnly;MultiSubnetFailover=True

    This illustrates the connection string for .NET System.Data.SqlClient provider for a distributed network name (DNN) listener:

    Server=tcp:DNN_AgListener,DNN_Port;Database=AgDb1;ApplicationIntent=ReadOnly;MultiSubnetFailover=True

    [!NOTE]
    If you are using command line programs like SQLCMD, ensure that you specify the correct switches for server name. For instance, in SQLCMD you must use the upper case -S switch that specifies server name, not the lower case -s switch which is used for column separator.

    Example: sqlcmd -S AG_Listener,port -E -d AgDb1 -K ReadOnly -M

  4. Ensure that the availability group listener is online. To ensure that the availability group listener is online run the following query on the primary replica:

    SELECT * FROM sys.dm_tcp_listener_states;

    If you find the listener is offline, you can attempt to bring it online using a command like this:

    ALTER AVAILABILITY GROUP myAG RESTART LISTENER 'AG_Listener';
  5. Ensure READ_ONLY_ROUTING_LIST is correctly populated. On Primary replica, ensure that the READ_ONLY_ROUTING_LIST contains only server instances that are hosting readable secondary replicas.

    To view the properties of each replica you can run this query and examine the connectivity endpoint (URL) of the read only replica.

    SELECT replica_id, replica_server_name, secondary_role_allow_connections_desc, read_only_routing_url 
    FROM sys.availability_replicas;   

    To view a read-only routing list and compare to the endpoint URL:

    SELECT * FROM sys.availability_read_only_routing_lists;

    To change a read-only routing list you can use a query like this:

    ALTER AVAILABILITY GROUP [AG1]   
    MODIFY REPLICA ON  
    N'COMPUTER02' WITH   
    (PRIMARY_ROLE (READ_ONLY_ROUTING_LIST=('COMPUTER01','COMPUTER02')));  

    For more information see Configure read-only routing for an availability group — SQL Server Always On

  6. Check that READ_ONLY_ROUTING_URL port is open. Ensure that the Windows firewall is not blocking the READ_ONLY_ROUTING_URL port. Configure a Windows Firewall for database engine access on every replica in the read_only_routing_list and any for clients that will be connecting to those replicas.

    [!NOTE]
    If you are running [!INCLUDEssNoVersion] on Azure VM, you must take additional configuration steps. Ensure that the network security group (NSG) of each replica VM allows traffic to the endpoint port and the DNN port, if you are using DNN listener. If you are using VNN listener, you must ensure the load balancer is configured correctly.

  7. Ensure that the READ_ONLY_ROUTING_URL (TCP://system-address:port) contains the correct fully qualified domain name (FQDN) and port number. See:

    • Calculating read_only_routing_url for Always On
    • sys.availability_replicas (Transact-SQL)
    • ALTER AVAILABILITY GROUP (Transact-SQL)
  8. Ensure proper SQL Server Networking configuration in the [!INCLUDEssNoVersion] Configuration Manager.

    Verify on every replica in the read_only_routing_list that:

    • [!INCLUDEssNoVersion] remote connectivity is enabled
    • TCP/IP is enabled
    • The IP addresses are configured correctly

    [!NOTE]
    You can quickly verify all of these are properly configured if you can connect from a remote machine to a target secondary replica’s [!INCLUDEssNoVersion] instance name using TCP:SQL_Instance syntax.

See: Configure a Server to Listen on a Specific TCP Port (SQL Server Configuration Manager) and View or Change Server Properties (SQL Server)

Related Tasks

  • Creation and Configuration of Availability Groups (SQL Server)

  • Create a Database Mirroring Endpoint for Windows Authentication (Transact-SQL)

  • Specify the Endpoint URL When Adding or Modifying an Availability Replica (SQL Server)

  • Manually Prepare a Secondary Database for an Availability Group (SQL Server)

  • Troubleshoot a Failed Add-File Operation (Always On Availability Groups)

  • Management of Logins and Jobs for the Databases of an Availability Group (SQL Server)

  • Manage Metadata When Making a Database Available on Another Server Instance (SQL Server)

Related Content

  • View Events and Logs for a Failover Cluster

  • Get-ClusterLog Failover Cluster Cmdlet

  • SQL Server Always On Team Blog: The official SQL Server Always On Team Blog

See Also

Transport Security for Database Mirroring and Always On Availability Groups (SQL Server)
Client Network Configuration
Prerequisites, Restrictions, and Recommendations for Always On Availability Groups (SQL Server)

PROCEDURE:

The following are the steps that I did to configure the mirror:

1.- On PRINCIPAL.domain.com, I did a full backup for each database that we need to mirror on the other server. (Previusly, I checked that recovery method for each database are configured to FULL)

2.- Then, on MIRROR.domain.com, I restored all the backups with NORECOVERY option selected. Until now, all it’s ok. Databases are showed with «Restoring…» status.

3.- When I finished to restore all the databases, I try to configure mirror on PRINCIPAL.domain.com

4.- I select a database, I ran «Configure Security…» wizard. I select the options, the endpoint configuration finished without errors or warnings; On this moment appears the option to START MIRRORING. I selected and appear this error message:

TITLE: Database Properties
——————————

An error occurred while starting mirroring.

——————————
ADDITIONAL INFORMATION:

Alter failed for Database ‘SharePoint_AdminContent_0376bde9-ea3e-4609-be1a-401236010f8d’.  (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.0.1600.22+((SQL_PreRelease).080709-1414+)&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://NABONIDUS.infrasoftcorp.com:5022» 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.00.1600&EvtSrc=MSSQLServer&EvtID=1418&LinkId=20476

——————————
BUTTONS:

OK
——————————

5.- So, on MIRROR.domain.com, now the database appears with «In Recovery…», but the mirror is not function.

End of the procedure.

SOME IMPORTANT ISSUES:

A.- When I ran the «Configure Security…» wizard, the Summary page shows the settings that I selected and that you can see below. (You can see that PRIMARY is configured to use encryption, but MIRROR don’t. By the way, I’m unabled to change this setting, when PRINCIPAL page appears, the Encription option is grayed and checked). I don’t know if this is the root cause of the problem:

———————————
Click Finish to perform the following actions:

On the principal server instance, PRIMARY.domain.com
Modify the following properties of the mirroring endpoint:
Name: Mirroring
Listener Port: 5022
Encryption: Yes
Role: Partner
On the mirror server instance, MIRROR.domain.com
Modify the following properties of the mirroring endpoint:
Name: Mirroring
Listener Port: 5022
Encryption: No
Role: Partner
———————————

B.- I checked firewall on servers. On both, the Windows Firewall is disabled.

C.- I can ping PRIMARY from MIRROR, and viceversa.

D.- I can TELNET on 5022 TCP port (both servers)

I will appreciate all help that you can provide me. I have very little experience working with SQL.

Are you stuck with SQL Server Mirroring Error 1418? We’ll help you fix this Mirroring Error.

The Database mirroring helps in creating redundant copies of a database and increasing the availability of a SQL Server database.

Here at Bobcares, we often receive requests to fix the Mirroring Error 1418  as a part of our Server Management Services.

Today, let’s see how our Support Engineers fix the mirroring error 1418 for our customers.

What is SQL Server Mirroring 1418 Error?

The SQL Server Database Mirroring includes two SQL Server instances.

One instance acts as a primary instance and it is Principal instance. And the other one is a mirror instance.

The SQL Server Mirroring 1418 error occurs when the server network endpoint is not responding. Usually, it doesn’t respond because the specified server network cannot reach or it does not exist.

 SQL Server Mirroring Error 1418

How to fix SQL Server Mirroring Error 1418?

Recently one of our customers contacted us with the error. Let’s discuss how our Support Engineers resolve the error for our customers.

The Mirroring Error 1418 mainly occurs due to the connection problems between the endpoints. We follow the below steps to fix the SQL Server Mirroring Error 1418.

1. We make sure that the system Firewall is not blocking the SQL Server port.

2.Then we go to Computer Management > Service and Application > SQL Server 2005 Configuration > Network Configuration > Enable TCP/IP protocol.

Also, we make sure that SQL SERVER port is 1433.

3. Then we check that the TCP/IP protocol is enabled or not. We go to Computer Management > Service and Application > SQL Server 2005 Configuration > Client Configuration > Enable TCP/IP protocol.

If the error doesn’t resolve by the above method, then we try the below methods also.

1. Service Accounts Verification

Sometimes the Mirroring 1418 error occurs due to the incorrect service account.

Firstly we Connect permissions to partner’s endpoints which are required by the SQL Server Service account.

We use domain accounts for all partners.

For the Local service, the certificate authentication is used and in the Network service, the computer account should be used.

2. Ports Verification

The database mirroring endpoint of each server instance is used only by the database mirroring process.

If any other processes are listening to the port assign to database mirroring endpoint then the other server instances cannot connect to the endpoint.

So we check that the Firewall is not blocking the port and allowing the traffic on both directions.

3. Verify Endpoints

We make sure that all endpoints are started.

All the endpoints must use the same encryption algorithm. We make sure that they are all using the same.

Also, we ensure that all the instances can access every other partner by Ping each partner from one another.

[Need assistance in SQL Server Mirroring Error 1418? – We can help you.]

Conclusion

In short, the Mirroring Error 1418 happens when the server network endpoints don’t respond. Also, we’ve discussed how our Support Engineers fix the error for our customers.

PREVENT YOUR SERVER FROM CRASHING!

Never again lose customers to poor server speed! Let us help you.

Our server experts will monitor & maintain your server 24/7 so that it remains lightning fast and secure.

GET STARTED

var google_conversion_label = «owonCMyG5nEQ0aD71QM»;

We got error 1418 while configuring Database Mirroring on one of the SQL Server database instance. The error details are given below:

The server network address “TCP://ServerName.abc.local:5022″ cannot 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)

Reason behind Error 1418

Main reason behind database mirroring error 1418 is because the specified server network address cannot be reached or does not exist. The server network address cannot be reached because of multiple reasons. Some of them are given below.

fix error 1418

  • Principal, Mirror and Witness servers are not talking to each other.
  • Wrong network address name, mirror server instance name or port number.
  • Mirror database is not ready for mirroring.
  • Principal or mirror server instance is behind a firewall.
  • You are using local system account to run SQL Server services and not using certificates for authentication.
  • SQL Server services are running with different domain accounts on Principal and Mirror server and service accounts don’t have enough permission on endpoints.
  • Different endpoint encryption value set on Principal, Mirror and Witness server.
  • Endpoints are not started on the partner servers.
  • Principal server instance is not listening on the port assigned to its database mirroring endpoint.

We need to verify each option mentioned above carefully to fix this error.

Solution

The solution of this issue may vary case to case depending on the nature of issue. To fix this issue we need to find out the main root cause behind error 1418. The root cause may be anything that is given in above section. Here I will describe each probable reason given above and its solution to fix this issue. Make sure to go through with each point given in this article.

Principal, Mirror and Witness Servers Should be Accessible

Make sure that SQL Server Instances installed on Principal, Mirror & Witness servers are accessible to each other. If remote login for any SQL Server instance is not enabled then you might get this issue. You can enable remote connectivity by enabling TCP/IP and Named Pipes protocols in SQL Server Configuration Manager. Each system must access the ports of the other SQL Server instances over TCP. You can try telnet the SQL Server ports of other partners.

Verify Correct System Details 

Sometimes we entered wrong details that end up with throwing errors. Make sure to verify the network address name, mirror server instance name and its port numbers are correct. You can recheck all the details whether you have entered them correctly or not.

Mirror Database Preparation

Verify that the mirror database is ready for database mirroring. We should prepare mirror database before configuring or during configuring database mirroring. It is suggested to keep identical drive path for mirror database files. Below are the steps you should take care for preparing your mirroring database.

  • Run full backup and subsequent transactional log backup of the Principal database and copy it to the Mirror server.
  • Restore database with same name in norecovery state on Mirror server with the copied backup files from above step. You must ensure that restored database on mirror server should be in restoring mode before starting database mirroring configuration.
Firewall/Ports

One of the probable reason to get error 1418 is partner servers are behind firewall. Make sure that the principal server instance and destination mirror server instance is not behind a firewall and they should talk to each other. Principal server, Mirror server and witness server should be accessible to each other.

Verify that SQL Server port and endpoint ports are enabled and accessible via telnet. If not or you are not able to telnet any of the partner instance from any server participating in mirroring then you should ask your network admins to open these ports to establish the connectivity over given port.

Endpoints

Make sure that endpoint has been created on principal, mirror and witness servers. Verify that the endpoints are started on each partner server instances. You can check endpoint status by running below T-SQL query on each instance.

SELECT state_desc FROM sys.database_mirroring_endpoints

If either endpoint is not started, execute below ALTER ENDPOINT statement to start it.

#Change the name of your endpoints. Here endpoint name is Mirroring
ALTER ENDPOINT Mirroring
STATE = STARTED
AS TCP (LISTENER_PORT = <port_number>)
FOR database_mirroring (ROLE = ALL);
GO

Recheck that the principal server instance is listening on the port assigned to its database mirroring endpoint and the mirror server instance is listening on its port. If a partner is not listening on its assigned port, modify the database mirroring endpoint to listen on a different port.

Sometimes this issue got fixed by dropping the existing endpoint and recreate it again on partner servers.

Service Accounts

Do not use local system account to run SQL Server services. If you don’t have any choice and want to use local system then ensure to use certificates for authentications.

Make sure that service accounts that you are using to run SQL Server services must have CONNECT permission to mirroring endpoints. Also, if you are configuring database mirroring between two domains then the login of one account must be created in master database on the other computer, and that login must be granted CONNECT permissions on the endpoint.

It’s always advisable to use same service accounts to run SQL Server services on all three Instances on Principal, Mirror and Witness server.

You can comment us your experience about fixing this issue. We will update this article with your solution that you have used to fix this issue.

I hope you like this article. Please follow us on our Facebook page and Twitter handle to get latest updates.

Read More:

  • Fix Error 15141: The server principal owns one or more endpoints and cannot be dropped
  • Fix AOAG Error 35250: Joining database on Secondary Replica resulted in an error
  • How to Upgrade or Patch Availability Group Instances?
  • SQL Server Always On Interview Questions and Answers
  • Author
  • Recent Posts

Manvendra Deo Singh

I am working as a Technical Architect in one of the top IT consulting firm. I have expertise on all versions of SQL Server since SQL Server 2000. I have lead multiple SQL Server projects like consolidation, upgrades, migrations, HA & DR. I love to share my knowledge. You can contact me on my social accounts for any consulting work.

Manvendra Deo Singh

Summary

Article Name

Fix Error 1418: The server network address cannot be reached or does not exist.

Description

We got error 1418 while configuring Database Mirroring on one of the SQL Server database instance. The error details are given below: The server network address “TCP://ServerName.abc.local:5022″ cannot 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)

PROCEDURE:

The following are the steps that I did to configure the mirror:

1.- On PRINCIPAL.domain.com, I did a full backup for each database that we need to mirror on the other server. (Previusly, I checked that recovery method for each database are configured to FULL)

2.- Then, on MIRROR.domain.com, I restored all the backups with NORECOVERY option selected. Until now, all it’s ok. Databases are showed with «Restoring…» status.

3.- When I finished to restore all the databases, I try to configure mirror on PRINCIPAL.domain.com

4.- I select a database, I ran «Configure Security…» wizard. I select the options, the endpoint configuration finished without errors or warnings; On this moment appears the option to START MIRRORING. I selected and appear this error message:

TITLE: Database Properties
——————————

An error occurred while starting mirroring.

——————————
ADDITIONAL INFORMATION:

Alter failed for Database ‘SharePoint_AdminContent_0376bde9-ea3e-4609-be1a-401236010f8d’.  (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.0.1600.22+((SQL_PreRelease).080709-1414+)&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://NABONIDUS.infrasoftcorp.com:5022» 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.00.1600&EvtSrc=MSSQLServer&EvtID=1418&LinkId=20476

——————————
BUTTONS:

OK
——————————

5.- So, on MIRROR.domain.com, now the database appears with «In Recovery…», but the mirror is not function.

End of the procedure.

SOME IMPORTANT ISSUES:

A.- When I ran the «Configure Security…» wizard, the Summary page shows the settings that I selected and that you can see below. (You can see that PRIMARY is configured to use encryption, but MIRROR don’t. By the way, I’m unabled to change this setting, when PRINCIPAL page appears, the Encription option is grayed and checked). I don’t know if this is the root cause of the problem:

———————————
Click Finish to perform the following actions:

On the principal server instance, PRIMARY.domain.com
Modify the following properties of the mirroring endpoint:
Name: Mirroring
Listener Port: 5022
Encryption: Yes
Role: Partner
On the mirror server instance, MIRROR.domain.com
Modify the following properties of the mirroring endpoint:
Name: Mirroring
Listener Port: 5022
Encryption: No
Role: Partner
———————————

B.- I checked firewall on servers. On both, the Windows Firewall is disabled.

C.- I can ping PRIMARY from MIRROR, and viceversa.

D.- I can TELNET on 5022 TCP port (both servers)

I will appreciate all help that you can provide me. I have very little experience working with SQL.

Понравилась статья? Поделить с друзьями:
  • Sql server ошибка 10054
  • Sql server wmi provider error
  • Sql server sql error codes
  • Sql server setup has encountered the following error
  • Sql server raise error