Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am setting up a mirror in Amazon EC2 and I have all servers with dedicated IPs. When i try to connect my mirror to my principal with the following command

alter database DB_NAME set partner = 'TCP://'

(IP changed from real for security) I get an error saying

The server network address "TCP://" can not be reached or does not exist. Check the network address name and reissue the command.

I am sure the server exists and is visible from the other server. I recall having issues when the endpoint server name is not the same that the server knowns for itself in @@SERVERNAME, Does anyone think this could be the issue?

Given that we don't have any domain setup, nor ActiveDirectory the only way i can think of using the actual server names is to setup a hosts file, but I find that solution will end up being hard to manage and very ugly.

Any options or ideas?

share|improve this question
up vote 3 down vote accepted

With SQL DB mirroring and replication, if @@servername doesn't match the actual hostname, you WILL have issues. This typically will happen if a server is renamed after SQL is installed. Also, the servers need to be able to communicate via hostname, whatever handles that is up to you (DNS, hosts files, WINS, etc)

If your hostname does not match the @@servername query, there is a simple, non-destructive script to fix. In the example, "oldhost" will be the name that the query returns. After running the script, you will need to restart the SQL services.

exec sp_dropserver 'oldhost\instance'
exec sp_addserver 'currenthostname\instance',local
share|improve this answer
OK.. so I basically need to rename my SQL Servers to the server name and then connect through hosts files? Would that solution work? – Jorge Guzman Apr 28 '11 at 19:26
See my addition. – DanBig Apr 28 '11 at 19:31
Thank you, this is what i needed to know. – Jorge Guzman Apr 28 '11 at 19:42

Your Answer


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.