2

Let's assume someone has 5 different SQL Server instances running on a server. Initially all are using dynamic ports.

Is it safe to restrict one of those instances to use the static port 1433 while all others still use dynamic ports?

Normally, depending on startup order it could happen that one dynamic instance claims port 1433, so that the fixed port instance can't grab it later on. Would this possibly prevent the fixed port instance to run?

Or is there any internal mechanism in SQL Server that starts fixed port instances first, and dynamic port ones afterwards?

6

When a SQL Server named instance configured with dynamic port is started, the dynamic port is provided by windows. The dynamic port range is outside the range of well-known static ports, where port 1433 resides. The dynamic port range is between 49152 and 65535, as documented here.

At subsequent startups, the instances reuse the same dynamic port used during previous startups (the port is written in the registry). If the port is found to be in use, SQL Server asks the OS for a new port. This behaviour is documented in this page, in the "Dynamic Port Allocation" section.

To answer your question in a single sentence: the scenario you describe is impossible (in a supported version of Windows with ranges properly configured).

  • It's impossible on more recent versions of the Windows OS that haven't had their dynamic port settings altered. What about older versions of Windows? What about servers that, for whatever reason, have their dynamic port range configured to include 1433? – Anthony Grist May 20 '15 at 10:19
  • @AnthonyGrist "more recent versions of Windows" = "all supported versions of Windows". The article I linked describes how to set dynamic port ranges to avoid the issue. I'll update my answer to incorporate your comment. – spaghettidba May 20 '15 at 10:25
0

Yes it is possible to set one of the instances to run on port 1433. It is also safe as the dynamic ports will be set in the range of 49152 and 65535 as stated above.

You use the configuration manager to set one of the instances to start at port 1433 (clearing the configuration for the dynamic port) and it will run on that port afterwards.

enter image description here

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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