Sunday, June 09, 2013

Another Possible Cause of ORA-12537

I have changed the names of the database and server in this example.

I had a new Oracle 11.1 database, which I was trying to access remotely using an Oracle 11.2 listener:
 
Solaris > sqlplus /@XXXXXX
 
SQL*Plus: Release 11.2.0.1.0 Production on Tue Nov 6 18:25:48 2012
 
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
 
ERROR:
ORA-12537: TNS:connection closed
 
The following errors appeared in the listener log:
 
<msg time='2012-11-06T18:25:48.133+00:00' org_id='oracle' comp_id='tnslsnr'
type='UNKNOWN' level='16' host_id='xxx-xxxxxx-xxxx'
host_addr='99.99.9.999'>
<txt>TNS-12518: TNS:listener could not hand off client connection
TNS-12547: TNS:lost contact
  TNS-12560: TNS:protocol adapter error
   TNS-00517: Lost contact
    Solaris Error: 32: Broken pipe
</txt>
</msg>
 
There is more than one possible reason for this. On this occasion the entry for the new database in the listener parameter file was as follows:
 
(SID_DESC =
 (SID_NAME = XXXXXX)
 (ORACLE_HOME = /oracle/app/oracle/product/11.1.0)
)
 
I added an extra line like this:
 
(SID_DESC =
  (SID_NAME = XXXXXX)
  (ORACLE_HOME = /oracle/app/oracle/product/11.1.0)
  (ENVS="LD_LIBRARY_PATH=/oracle/app/oracle/product/11.1.0/lib")
)
 
I restarted the listener:
 
Solaris > lsnrctl reload listener_11
 
LSNRCTL for Solaris: Version 11.2.0.1.0 - Production on 06-NOV-2012 18:40:10
 
Copyright (c) 1991, 2009, Oracle.  All rights reserved.
 
Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=xxx-xxxxxx-xxxx)(PORT=1529)))
The command completed successfully
Solaris >
 
Then I was able to connect to the database remotely:
 
Solaris > sqlplus /@XXXXXX
 
SQL*Plus: Release 11.2.0.1.0 Production on Tue Nov 6 18:42:27 2012
 
Copyright (c) 1982, 2009, Oracle.  All rights reserved.
 
Connected to:
Oracle Database 11g Enterprise Edition Release 11.1.0.6.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
 
SQL>

1 comment:

  1. Hello Andrew,
    I faced with same issue. In my environment I using 12.1.0.2 listener and 11.2.0.3 database.
    I traced tnslsnr process (truss -w 2 -fp ) and found that libodm11.so not found in path:

    5474: execve("/pub/home/m.velikikh/oracle/product/11.2.0.3.7/bin/oracle", 0x10035E860, 0x1003B6D30) argc = 2
    5474: sysinfo(SI_MACHINE, "sun4v", 257) = 6
    5474: mmap(0x00000000, 56, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFFFFFFFF7F700000
    5474: mmap(0x00000000, 8192, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFFFFFFFF7F500000
    5474: mmap(0x00000000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFFFFFFFF7F400000
    5474: mmap(0x00000000, 8192, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANON, -1, 0) = 0xFFFFFFFF7F300000
    5474: memcntl(0xFFFFFFFF7F600000, 27880, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
    5474: memcntl(0x100000000, 6619808, MC_ADVISE, MADV_WILLNEED, 0, 0) = 0
    5474: resolvepath("/usr/lib/sparcv9/ld.so.1", "/lib/sparcv9/ld.so.1", 1023) = 20
    5474: resolvepath("/pub/home/m.velikikh/oracle/product/11.2.0.3.7/bin/oracle", "/pub/home/m.velikikh/oracle/product/11.2.0.3.7/bin/oracle", 1023) = 57
    5474: stat("/pub/home/m.velikikh/oracle/product/11.2.0.3.7/bin/oracle", 0xFFFFFFFF7FFFF3D8) = 0
    5474: open("/var/ld/64/ld.config", O_RDONLY) Err#2 ENOENT
    5474: stat("/pub/home/m.velikikh/oracle/product/12.1.0.2/lib/libodm11.so", 0xFFFFFFFF7FFFE900) Err#2 ENOENT
    5474: stat("/opt/SUNWcluster/lib/sparcv9/libodm11.so", 0xFFFFFFFF7FFFE900) Err#2 ENOENT
    5474: stat("/pub/home/velikikh/oracle/product/11.2.0.3.7/lib/libodm11.so", 0xFFFFFFFF7FFFE900) Err#2 ENOENT
    5474: stat("/opt/ORCLcluster/lib//libodm11.so", 0xFFFFFFFF7FFFE900) Err#2 ENOENT
    5474: stat("/lib/64/libodm11.so", 0xFFFFFFFF7FFFE900) Err#2 ENOENT
    5474: stat("/usr/lib/64/libodm11.so", 0xFFFFFFFF7FFFE900) Err#2 ENOENT
    5474: open("/usr/lib/locale/ru_RU.UTF-8/LC_MESSAGES/SUNW_OST_SGS.mo", O_RDONLY) Err#2 ENOENT
    5474: open("/usr/lib/locale/ru_RU.UTF-8/LC_MESSAGES/SUNW_OST_OSLIB.mo", O_RDONLY) Err#2 ENOENT
    5474: write(2, 0xFFFFFFFF7F7407C0, 76) = 76
    5474: l d . s o . 1 : o r a c l e : f a t a l : l i b o d m 1 1
    5474: . s o : o p e n f a i l e d : N o s u c h f i l e o
    5474: r d i r e c t o r y\n
    5474: lwp_self() = 1

    As you see libodm11.so searched first in ORACLE_HOME=/pub/home/m.velikikh/oracle/product/12.1.0.2
    And after in standard OS places.
    I added (ENVS = "LD_LIBRARY_PATH=/pub/home/m.velikikh/oracle/product/11.2.0.3.7/lib")
    line into listener.ora and that's resolve my issue.

    Best regards,
    Mikhail.

    ReplyDelete