Databases Reference
In-Depth Information
C:\oracle\admin\network\admin\sqlnet.ora
Used HOSTNAME adapter to resolve the alias
Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=ten.oradbpro.com))
(ADDRESS=(PROTOCOL=TCP)
(HOST=169.254.212.142)(PORT=1521)))
OK (10 msec)
When using the easy connect format with
tnsping
, the
instance_service_name
is optional.
If specified, it is not verified by
tnsping
.
IP=FIRST Disabled
Let's investigate what happens when
IP=FIRST
is disabled. The following tests were performed
with Oracle10
g
, since Oracle9
i
does not support
IP=FIRST
. However, an Oracle9
i
TNS Listener
has the same behavior as an Oracle10
g
or Oracle11
g
TNS Listener without
IP=FIRST
. The test
system's host name is dbserver1.oradbpro.com. This host name maps to the boot IP address
172.168.0.1.
$ ping -c 1 `hostname`
PING dbserver1.oradbpro.com (172.168.0.1) 56(84) bytes of data.
64 bytes from dbserver1.oradbpro.com (172.168.0.1): icmp_seq=0 ttl=64 time=0.011 ms
Host Name
For this demonstration, the TNS Listener configuration in
listener.ora
contained the host
name of the test system.
LISTENER=
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST=dbserver1.oradbpro.com)(PORT=1521))
)
)
)
Coming back to the digression on UNIX network programming with sockets, let's take a
look at the
bind
calls the TNS Listener makes when
IP=FIRST
is disabled. On Linux,
strace
may
be used to trace the
bind
system calls the TNS Listener makes. The basic syntax for starting and
tracing a process with
strace
is as follows:
strace -f -o output_file
command
arguments
The switch
-f
tells
strace
to trace across forks (creation of a child process) and
-o
is for
specifying the output file where
strace
writes the system calls it captured. So let's start a TNS
Listener under the control of
strace
.
$ strace -f -o /tmp/strace_no_ip_first.out lsnrctl start