Database Reference
In-Depth Information
Thus, the ADDRESS entry in listener.ora becomes:
(ADDRESS=(PROTOCOL=TCP)(HOST=vip-dbserver1)(PORT=1521))
When assigned a host name that maps to a service IP address (i.e., not the boot IP address),
the TNS Listener binds specifically to that address and does not use INADDR_ANY . The output
from netstat shown here confirms this:
$ netstat -tnlp|egrep 'Proto|tns'
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 172.168.0.11:1521 0.0.0.0:* LISTEN 27050/tnslsnr
Further testing reveals that INADDR_ANY is also not used for non-boot IP addresses.
IP=FIRST Enabled
To enable IP=FIRST , the ADDRESS line in listener.ora must be modified as follows:
(ADDRESS=(PROTOCOL=TCP)(HOST=172.168.0.1)(PORT=1521) (IP=FIRST) )
After restarting the TNS Listener ( lsnrctl reload listener_name is not sufficient) with this
configuration, the bind call in the strace output file has changed. Where previously 0.0.0.0
( INADDR_ANY ) was used, there is now the IP address, which the system's host name resolves to.
bind(8, {sa_family=AF_INET, sin_port=htons(1521),
sin_addr=inet_addr("172.168.0.1")}, 16) = 0
The TNS Listener is again functional at the assigned address 172.168.0.1.
$ telnet 172.168.0.1 1521
Trying 172.168.0.1...
Connected to 172.168.0.1.
Escape character is '^]'.
Connection closed by foreign host.
The TNS Listener closes the connection to telnet after a few minutes. Type Ctrl+C, Ctrl+D,
and hit return to abort the connection. The program telnet then responds with “Connection
closed by foreign host.” as in the preceding code example. Now that IP=FIRST is in effect,
attempting to contact the TNS Listener on any address other than the boot IP address fails.
$ telnet 77.47.1.187 1521
Trying 77.47.1.187...
telnet: connect to address 77.47.1.187: Connection refused
$ telnet localhost 1521
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
# netstat -tnlp | egrep 'Proto|tns'
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 172.168.0.1:1521 0.0.0.0:* LISTEN 27916/tnslsnr
 
Search WWH ::




Custom Search