Database Reference
In-Depth Information
LISTENER=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL=TCP)(HOST= 172.168.0.1 )(PORT=1521))
)
)
)
After restarting the TNS Listener, the local address corresponds to the configured IP
address.
$ netstat -tnlp|grep 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 25630/tnslsnr
It is no longer possible to connect to the TNS Listener on the loopback address or any
other IP address that is not explicitly configured.
$ telnet localhost 1521
Trying 127.0.0.1...
telnet: connect to address 127.0.0.1: Connection refused
$ tnsping 192.168.10.132:1521
TNS Ping Utility for Linux: Version 10.2.0.3.0 - Production on 08-SEP-2007 15:47:25
Copyright (c) 1997, 2006, Oracle. All rights reserved.
Used parameter files:
/opt/oracle/product/db10.2/network/admin/sqlnet.ora
Used HOSTNAME adapter to resolve the alias
Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=192.168.10.132))
(ADDRESS=(PROTOCOL=TCP)(HOST= 192.168.10.132)(PORT=1521)))
TNS-12541: TNS:no listener
With this configuration, the boot IP address is used in the bind call traced with strace :
$ strace -f -o /tmp/strace_boot_ip.out lsnrctl start
$ grep "bind.*1521" /tmp/strace_boot_ip.out
25689 bind(8, {sa_family=AF_INET, sin_port=htons(1521),
sin_addr=inet_addr("172.168.0.1")}, 16) = 0
Service IP Address
To complement the probe into the TNS Listener's undocumented features, let's see what happens
when the TNS Listener is configured with a host name that maps to a service IP address. The
alias IP address 172.168.0.11 of adapter eth1:1 that was defined above will serve as an example.
This IP address is assigned to the host name vip-dbserver1 in the configuration file /etc/hosts .
$ grep 172.168.0.11 /etc/hosts
172.168.0.11 vip-dbserver1.oradbpro.com vip-dbserver1
 
Search WWH ::




Custom Search