Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

I have SQL Server 2008 R2 Installed. It contains three instances.

  1. Default (MSSQLServer)
  2. FirstInstance
  3. SecondInstance

All these are Log On as Network Service..

Default Instance is Principa server FirstInstance is Mirror Second Instance is Witness Server

I initially took the Full Backup and Transactional Log Backup of my Principal Database. Restored it to the First Instance by keeping the same DataBase Name and Recovery State is No-Recovery

Finally, I started the Mirrioring and I am getting two error messages shown below.

Let me know if you need more information...Any help will be really appreciated

enter image description here

enter image description here

share|improve this question
1  
Do you have a firewall running on your machine? If so check that the ports are open. Also, check on both instances that you have endpoints under Server Objects->Endpoints->Database Mirroring. –  Mr.Brownstone Sep 7 '12 at 10:23
    
Did you check the endpoints? –  Mr.Brownstone Sep 7 '12 at 15:32

1 Answer 1

Try some basic connectivity tests.

  1. Verify that 5022, 5023 and 5024 are listening.
  2. Verify that the server name you are using is correct.

From the command line :

netstat -an

enter image description here

On my server, you can see that 5022 is listening.

Next make sure that you can connect to those ports via telnet

telnet fully-qualified-server-name 5022

As it mentions in the Note section of the Mirroring Properties GUI, just below the witness field, the server names have to be fully qualified tcp addresses.

enter image description here

You should just see a black screen. In this example I chose a name that would cause a connection failure. If you see "Could not open connection", then the server(s) defined as mirror, principal and witness aren't reachable or you are not using the right name.

The telnet client can be added under Features in Windows 2008.

In Windows 2008, when you right click on Computer, you can see the full computer name. You should be able to ping it as well from the command line. ex: ping myservername

Update

Please run the following queries on each SQL Server instance and put the results in your question. Many of these troubleshooting tips come from: http://msdn.microsoft.com/en-us/library/ms189127.aspx

Show tcp endpoints

SELECT type_desc, port FROM sys.tcp_endpoints;

Display status of mirroring endpoints

SELECT state_desc FROM sys.database_mirroring_endpoints;

Check that the ROLE is correct

SELECT role FROM sys.database_mirroring_endpoints;

Display permissions to endpoints

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; 
GO

The login for the service account from the other server instance requires CONNECT permission. 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 Transact-SQL statement.

Example output:

name    STATE   GRANTOR PERMISSION  GRANTEE
TSQL Local Machine  G   sqladmin    CO      public
TSQL Named Pipes    G   sqladmin    CO      public
TSQL Default TCP    G   sqladmin    CO      public
TSQL Default VIA    G   sqladmin    CO      public
Mirroring   G   SERVERNAME\Grantor  CO      SERVERNAME\Grantee

Grantor is the account that assigned (CO) connect permission, Grantee is the account that has connect permission

From the command line run ipconfig /all and note what Host Name returns.

share|improve this answer
    
I will get back to you very soon. +1 for the help. –  testing Sep 10 '12 at 12:26
    
Verify that 5022, 5023 and 5024 are listening. Yes it is listening. Verify that the server name you are using is correct. Yes it is correct. –  testing Sep 11 '12 at 8:46
    
updated my answer –  Craig Efrein Sep 11 '12 at 17:08

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.