Alternatives for TCP/IP connections
The following topic describes some ways to bypass port and IP address lookups for TCP/IP connections.
IP addresses for TCP/IP connections
#address hostname alias
555.12.12.12 smoke
98.555.43.21 odyssey
12.34.56.555 knight sales
#dbservername nettype hostname servicename options
sales ontlitcp 12.34.56.789 sales_ol
#dbservername nettype hostname servicename options
sales ontlitcp knight sales_ol
Using an IP address might speed up connection time in some circumstances. However, because computers are usually known by their host name, using IP addresses in the host name field makes it less convenient to identify the computer with which an entry is associated.
- Windows Internet Name Service
- Domain Name Server
Wildcard addressing for TCP/IP connections
- You are using TCP/IP connections.
- The computer where the database server is located uses multiple network-interface cards (NICs).
If the preceding conditions are met, you can use an asterisk (*) as a wildcard in the hostname field that the database server uses. When you enter a wildcard in the hostname field, the database server can accept connections at any valid IP address on its host computer.
#address hostname alias
123.45.67.81 texas1
123.45.67.82 texas2
If the client application
and database server share the sqlhosts information,
you can specify both the wildcard and a host name or IP address in
the hostname field (for example, *texas1
or *123.45.67.81
).
The client application ignores the wildcard and uses the host name
(or IP address) to make the connection, and the database server uses
the wildcard to accept a connection from any IP address.
The wildcard format allows the listen thread of the database server to wait for a client connection using the same service port number on each of the valid network-interface cards. However, waiting for connections at multiple IP addresses might require more processor time than waiting for connections with a specific host name or IP address.
#dbservername nettype hostname servicename options
texas_srvr ontlitcp *texas1 pd1_on
#dbservername nettype hostname servicename options
texas_srvr ontlitcp *123.45.67.81 pd1_on
#dbservername nettype hostname servicename options
texas_srvr ontlitcp *texas2 pd1_on
#dbservername nettype hostname servicename options
texas_srvr ontlitcp *123.45.67.82 pd1_on
#dbservername nettype hostname servicename options
texas_srvr ontlitcp * pd1_on
*host
instead
of *
).The connectivity information
used by a client application must contain an explicit host name or
IP address. The client applications on iowa can use any of
the following host names: texas1
, *texas1
, 123.45.67.81
,
or *123.45.67.81
. If there is a wildcard (*) in the hostname
field,
the client application ignores it.
The client application on kansas can
use any of the following host names: texas2
, *texas2
, 123.45.67.82
,
or *123.45.67.82
.
Port numbers for TCP/IP connections
For the TCP/IP network protocol, you can use the actual TCP listen port number in the service name field.
1543
, you can write an entry in the sqlhosts file
as follows:#dbservername nettype hostname servicename options
sales ontlitcp knight 1543
Using
the actual port number might save time when you make a connection
in some circumstances. However, as with the IP address in the hostname
field,
using the actual port number might make administration of the connectivity
information less convenient.