My Oracle Support Banner

Listener Startup or Connections Hang in 11g (Doc ID 803838.1)

Last updated on FEBRUARY 20, 2019

Applies to:

Oracle Net Services - Version 11.1.0.7 to 12.1.0.2 [Release 11.1 to 12.1]
HP-UX PA-RISC (64-bit)
Generic UNIX

Symptoms

Beginning with Oracle RDBMS release 11g, the listener functionality bypasses the /etc/hosts file when resolving hostnames to IPs and instead query the DNS server.
This can introduce some delay in establishing a connection to a remote host compared with 10g.

SQL*Plus and tnsping show this behavior but this delay can appear also when opening a dblink or anytime TCP connections are established by the Oracle Network layer.

This happens even if  Name Server Switch configuration (nsswitch) specifies the hosts file prior to dns lookups:

/etc/nsswitch.conf 
hosts: files [NOTFOUND=continue] dns
    or only:
hosts: files



If we obtain truss/tusc trace for a SQL*Plus connection we find the following sequence of OS system calls:

On 10g after reading the nsswitch.conf file, library "libnss_files.so" is loaded then /etc/hosts is read and the socket is opened:

open("/etc/nsswitch.conf", O_RDONLY|0x800, 0666) = 5
ioctl(5, TCGETA, 0x9fffffffffffaca0) ERR#25 ENOTTY
read(5, "# \n# / e t c / n s s w i t c ".., 8192) = 92
read(5, 0x60000000001e6078, 8192) = 0
close(5) = 0
open("/usr/lib/hpux64/libnss_files.so.1", O_RDONLY|0x800, 0) = 5
fstat(5, 0x9fffffffffffa720) = 0
pread(5, "7fE L F 0202010101\0\0\0\0\0\0\0".., 1024, 0) = 1024
stat("/usr/lib/hpux64/", 0x9fffffffffff9cd0) = 0
open("/usr/lib/hpux64/libnss_files.so.1.bpd", O_RDONLY|0x800, 0) ERR#2 ENOENT
getuid() = 305 (305)
getgid() = 303 (303)
mmap(NULL, 85872, PROT_READ|PROT_EXEC, MAP_SHARED|MAP_SHLIB, 5, 0) = 0xc0000000008d8000
mmap(NULL, 3159, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_SHLIB, 5, 131072) = 0x9fffffffbf63d000
close(5) = 0
getuid() = 305 (305)
getgid() = 303 (303)
open("/etc/hosts", O_RDONLY|0x800, 0666) = 5
ioctl(5, TCGETA, 0x9fffffffffffac30) ERR#25 ENOTTY
read(5, "# / e t c / h o s t s \n# \n# ".., 8192) = 8192
lseek(5, 18446744073709549410, SEEK_CUR) = 5986
close(5) = 0
socket(AF_INET, SOCK_STREAM, 0) = 5
connect(5, 0x60000000001f0680, 16) = 0
getsockname(5, 0x9fffffffffffb750, 0x9fffffffffffb740) = 0
getsockopt(5, SOL_SOCKET, SO_SNDBUF, 0x9fffffffffffb890, 0x9fffffffffffb894) = 0
getsockopt(5, SOL_SOCKET, SO_RCVBUF, 0x9fffffffffffb890, 0x9fffffffffffb894) = 0
setsockopt(5, 0x6, TCP_NODELAY, 0x9fffffffffffb89c, 4) = 0

 

But on 11g after reading the nsswitch.conf  library "libnss_dns.so" is loaded then /etc/resolv.conf (which specifies available domain name servers) is read and much later a socket for TCP/IP (SOCK_STREAM) is opened. :

open("/etc/nsswitch.conf", O_RDONLY|0x800, 0666) = 5
ioctl(5, TCGETA, 0x9fffffffffffa360) ERR#25 ENOTTY
read(5, "# \n# / e t c / n s s w i t c ".., 8192) = 92
read(5, 0x60000000001c9058, 8192) = 0
close(5) = 0
open("/usr/lib/hpux64/libnss_dns.so.1", O_RDONLY|0x800, 0) = 5
fstat(5, 0x9fffffffffff9de0) = 0
pread(5, "7fE L F 0202010101\0\0\0\0\0\0\0".., 1024, 0) = 1024
stat("/usr/lib/hpux64", 0x9fffffffffff9390) = 0
open("/usr/lib/hpux64/libnss_dns.so.1.bpd", O_RDONLY|0x800, 0) ERR#2 ENOENT
getuid() = 305 (305)
getgid() = 303 (303)
mmap(NULL, 49440, PROT_READ|PROT_EXEC, MAP_SHARED|MAP_SHLIB, 5, 0) = 0xc00000000b054000
mmap(NULL, 800, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_SHLIB, 5, 65536) = 0x9fffffffbf68d000
close(5) = 0
getuid() = 305 (305)
getgid() = 303 (303)
getuid() = 305 (305)
getgid() = 303 (303)
open("/app/oracle/11.1.0.7/lib/libdl.so.1", O_RDONLY|0x800, 0) ERR#2 ENOENT
open("/app/oracle/11.1.0.7/lib32/libdl.so.1", O_RDONLY|0x800, 0) ERR#2 ENOENT
getuid() = 305 (305)
getgid() = 303 (303)
open("/usr/lib/hpux64/libdl.so.1", O_RDONLY|0x800, 0) = 5
fstat(5, 0x9fffffffffff9cf0) = 0
read(5, "7fE L F 0202010101\0\0\0\0\0\0\0".., 64) = 64
close(5) = 0
socket(AF_INET, SOCK_DGRAM, 0) = 5
ioctl(5, SIOCGIFNUM, 0x9fffffffffff9680) = 0
ioctl(5, SIOCGIFCONF, 0x9fffffffffff9690) = 0
socket(AF_INET6, SOCK_DGRAM, 0) = 6
ioctl(6, SIOCGLIFNUM, 0x9fffffffffff9684) = 0
ioctl(6, SIOCGLIFCONF, 0x9fffffffffff96a0) = 0
ioctl(5, SIOCGIFFLAGS, 0x9fffffffffff96b0) = 0
close(5) = 0
close(6) = 0
gettimeofday(0x9fffffffffff7dd0, NULL) = 0
getpid() = 22968 (22967)
open("/etc/resolv.conf", O_RDONLY|0x800, 0666) = 5
ioctl(5, TCGETA, 0x9fffffffffff7da0) ERR#25 ENOTTY
read(5, "d o m a i n t e s t . c o m \n".., 8192) = 453
read(5, 0x60000000001dddf8, 8192) = 0
close(5) = 0
................

.............

socket(AF_INET, SOCK_STREAM, 0) = 5
connect(5, 0x60000000001eba50, 16) = 0
getsockname(5, 0x9fffffffffff9da0, 0x9fffffffffff94c0) = 0
getsockopt(5, SOL_SOCKET, SO_SNDBUF, 0x9fffffffffffa000, 0x9fffffffffffa004) = 0
getsockopt(5, SOL_SOCKET, SO_RCVBUF, 0x9fffffffffffa000, 0x9fffffffffffa004) = 0
setsockopt(5, 0x6, TCP_NODELAY, 0x9fffffffffffa00c, 4) = 0


 

Changes

Nothing was changed in the configuration of the OS, only the upgrade from Oracle 10g to 11g was done.

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Changes
Cause
Solution
References

My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.