Wednesday, 10 September 2014

SQL Server - All Database Mirroring Errors, Troubleshooting and Resolution

Error: When you configure mirroring you might receive the below errror, One or more of the server network addresses lacks a fully qualified domain name (FQDN). Specify the FQDN for each server, and click start mirroring again

Solution: Assume that your principal server is A and mirror server is B and you have configured mirroring for Adventure Works database. The fully qualified computer name of each server can be found running the command prompt:  

IPCONFIG /ALL

Concatenate the "Host Name" and "Primary DNS Suffix". If you see something like:-

Host Name . . . : A            Primary Dns Suffix . . . .  . : corp.mycompany.com

Then the computer name is just A.corp.mycompany.com. Prefix 'TCP://' and append ':' and you then have the partner name.

-- Specify the partner from the mirror server
ALTER DATABASE [AdventureWorks] SET PARTNER = TCP://A.corp.mycompany.com:5022';

-- Specify the partner from the principal server

ALTER DATABASE [AdventureWorks] SET PARTNER = N'TCP://B.corp.mycompany.com:5022';


Error: 1412: Occurs if we have not restored T.Log backup along with FULL backup in mirror server before configuring mirroring.

Error: 1416, Database is not configured for database mirroring
You need to restore the Full backup from principal server using With NoRecovery option and also one T.log backup from principal server using With NoRecovery option and then start configuring mirroring.

Error: 1418(Can’t be reached) :Occurs due to the communication problems b/w the end points. Possible reasons are TCP/IP for the instance was not enabled, Duplicate end points exist, and Login was not created in their instance to mirroring.

Error: 1475: Occurs if any bulk operations are made in production server before enabling mirroring. To resolve this take T.Log backup from principal and restore in mirror then enable mirroring.

Error: 1478: Occurs If all T.Log Backups are not restored before starting mirroring

Error: 1498 This is a common error & everyone is known to this error. Database mirroring is officially supported from SQL Server 2005 SP1, hence in the RTM version database mirroring is disabled by default. You can use TRACE 1400 to enable in RTM version or else update your SQL Server with latest service pack.

Error: - The witness instance name must be distinct from both server instance that manage the database. The alter database set witness command failed (Microsoft sql server error:1429) 




Error: - If we select witness SQL Server instance in single machine. It does not allow to configure Witness server. Both Mirror and Witness server take same port as 5023 and the below error will come.



Error:- Occur when mirror DB is in In Recovery Mode. To Fix it Restore full backup and T. Log back up on Mirror Server.



Error: - After patching principal moved in suspended mode. And not coming in synchronized mode.

While patching patch, Mirroring failover must have done by SQL server Service account only. If DBA do failover by his/her own account before patching Mirroring will not move in suspended mode and will not come in synchronized mode. Then only reconfiguration is the option to run mirroring.

Error: principal moved in suspended mode and not move in synchronized mode.

If the log file size is full mirroring gets failed. To Fix it, release log file size.

Error: 1418- After configuring a mirroring. It asks to start mirroring. While starting Mirroring 1418 error occurs.
Bellow 3 instances are installed and all instance should run with same Service account (Not user account)



 Error: In My principal server while I start Mirror The server network address "TCP://NABONIDUS.infrasoftcorp.com: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. SQL Server 2008 - 1418.   

The solution to the above problem is very simple and as follows.

Fix/WorkAround/Solution: Try all the suggestions one by one.

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

Suggestion 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).

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

Suggestion 4: Make sure your firewall is turned off.

Suggestion 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.

Suggestion 6: Try the following command as one of the last options.

GRANT CONNECT ON ENDPOINT::Mirroring TO ALL

Suggestion 7: Delete the end points and recreate them.

Please comment if you know or faced any error of Mirroring.- Jainendra Verma


2 comments:

  1. when I was doing mirroring I found this error,i tried all the steps you have mentioned but it didn't work for me,what can be the solution. thank you for your unique information.
    TITLE: Database Properties
    ------------------------------

    An error occurred while starting mirroring.

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

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

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=11.0.3000.0+((SQL11_PCU_Main).121019-1325+)&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)

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

    Database "Adilastech" is not configured for database mirroring. (Microsoft SQL Server, Error: 1416)

    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=11.00.3128&EvtSrc=MSSQLServer&EvtID=1416&LinkId=20476

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

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

    ReplyDelete
  2. Hello sir, I get an 927 Error as shown below. Tried dropping & creating end points again. Its a lab testing scenario to set up mirroring with 3 instances(for automatic failover) on a single server.

    Fullbackup & logbackup files have been restored with NORECOVERY.
    Tried running the commands to alter database ..set partner='', which did not work.

    Database 'devdb' cannot be opened. It is in the middle of a restore. (.Net SqlClient Data Provider)

    ------------------------------
    For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=15.00.2080&EvtSrc=MSSQLServer&EvtID=927&LinkId=20476

    ------------------------------
    Server Name: MY-PC\PRODDB
    Error Number: 927
    Severity: 14
    State: 2
    Line Number: 1

    ReplyDelete