Oracle error 12537

ORA-12537: TNS:connection closed. Cause: "End of file" condition has been reached; partner has disconnected. Action: None needed; this is an information message.

ORA-12537 Overview

There’re several possible causes to raise ORA-12537:

  1. Incorrect File Permission
  2. White or Black List

ORA-12537 Caused by Incorrect File Permission

Incorrect file permission will prevent connections from being established. That is to say, potentially successful connections will be interrupted by ORA-12537 due to wrong file permissions, specifically, the execution permission. As a result, we saw the error on the client side.

For Single-instance

One simple change can reproduce ORA-12537:

[oracle@primary ~]$ ll $ORACLE_HOME/bin/oracle
-rwsr-s--x. 1 oracle oinstall 239952653 Sep 11 20:36 /u01/app/oracle/product/11.2.0/dbhome_1/bin/oracle
[oracle@primary ~]$ chmod u-x $ORACLE_HOME/bin/oracle
[oracle@primary ~]$ ll $ORACLE_HOME/bin/oracle
-rwSr-s--x. 1 oracle oinstall 239952653 Sep 11 20:36 /u01/app/oracle/product/11.2.0/dbhome_1/bin/oracle

In the above, I removed the user execution permission on $ORACLE/bin/oracle. Now let’s try to make a connection from outside.

C:Usersedchen>sqlplus hr/hr@db11g

SQL*Plus: Release 11.2.0.4.0 Production on Tue Mar 4 19:25:51 2019

Copyright (c) 1982, 2013, Oracle.  All rights reserved.

ERROR:
ORA-12537: TNS:connection closed

Enter user-name:

What we saw in listener.log can prove that the connection was established, but somehow the listener cannot hand out the connection due to permission problem.

[oracle@primary ~]$ tail -f $ORACLE_BASE/diag/tnslsnr/$(hostname -s)/listener/trace/listener.log
...
Tue Mar 04 19:25:51 2019
04-MAR-2019 19:25:51 * (CONNECT_DATA=(SERVICE_NAME=ORCL)(CID=(PROGRAM=D:instantclientsqlplus.exe)(HOST=MACHINE_NAME)(USER=edchen))) * (ADDRESS=(PROTOCOL=tcp)(HOST=10.1.12.123)(PORT=51385)) * establish * ORCL * 12518
TNS-12518: TNS:listener could not hand off client connection
 TNS-12546: TNS:permission denied
  TNS-12560: TNS:protocol adapter error
   TNS-00516: Permission denied
    Linux Error: 13: Permission denied

Further reading: Where is Oracle Listener Log Location

Errors in stack are all around permission problems and pointed to Linux error at the bottom.

Solution

That is, the solution is to add group permission to the file, which can rescue incoming connections from ORA-12537. Therefore, our action should be inspecting all the file permissions in $ORACLE, especially in $ORACLE_HOME/bin.

For RAC Database

After installing 11g RAC, we can test the database access, it would be successful via SCAN. But when we directly access on specific node, we found the connection failed on the second node with an error:

ORA-12537:TNS:connection closed

Generally speaking, the listener belongs to user grid, and the database belongs to user oracle in a RAC environment. Two users belong to a very special group oinstall. When we connected to the listener of the second node, the listener was acknowledged that it had no permission to access database. This could be the root cause of ORA-12537.

Let’s check some files’ permission from user grid‘s point of view.

  1. On the first node.
  2. $ ls -al $ORACLE_HOME/bin/oracle
    -rwsr-s--x   1 oracle     asmadmin   534683872 Mar 12 16:08

  3. On the second node.
  4. $ ls -al $ORACLE_HOME/bin/oracle
    /oracle/database/product/11.2.0/dbhome_1/bin/oracle not found

That is to say, user grid can access oracle‘s files on the first node, but not on the second node. So we checked the following directories by user oracle on the second node:

$ cd $ORACLE_BASE
$ ls -l
total 2
drwx------   3 oracle     oinstall        96 Mar 12 16:02 admin
drwx------   3 oracle     oinstall        96 Mar 12 16:02 cfgtoollogs
drwxrwxr-x  11 oracle     oinstall      1024 Mar 12 16:00 diag
drwxr-xr-x   3 oracle     oinstall        96 Mar 12 16:09 product
$ cd product
$ ls -l
total 0
drwx------   3 oracle     oinstall        96 Mar 12 16:09 11.2.0

As you can see, it show that $ORACLE_BASE/product do have group permission, but $ORACLE_BASE/product/11.2.0 do not. As a result, grid cannot access the database files. That’s why we received ORA-12537 while connecting to the database.

Solution

Therefore, we should add group permission for grid to access on this directory in a cascading fashion:

$ chmod 755 11.2.0
$ ls -l
total 0
drwxr-xr-x   3 oracle     oinstall        96 Mar 12 16:09 11.2.0

Now, connections are back to work. No more ORA-12537 are thrown.

Theoretically, two nodes should have symmetric structures with same permissions at the beginning. So I think it might be a bug, because I didn’t create the directory «11.2.0», OUI did.

ORA-12537 Caused by White or Black List

As I said in the above, ORA-12537 is meant for interrupting potentially successful connections. Here is another error pattern of ORA-12537.

In some cases, DBA explicitly blocks or allows some nodes listed in sqlnet.ora to limit the access to the database, which is essentially a black or white list in terms of network security. For example, we can implement a white list in sqlnet.ora like this:

TCP.VALIDNODE_CHECKING=yes
TCP.INVITED_NODES=(weblogic1.example.com, weblogic2.example.com, 10.10.0.0/16)

Solution

Make sure you are in the white list. Otherwise you might get ORA-12537 when you connect to the database.

For those who want to implement black lists, TCP.EXCLUDED_NODES parameter should be in sqlnet.ora.

Further reading: TNSPING Errors Collections

If Fatal NI connect error 12537 appears in the alert logfile, following is how it would appear. There is another similar Fatal NI connect error 12547 discussed here.

Fatal NI connect error 12537, connecting to:

 (LOCAL=NO)

  VERSION
INFORMATION:

            TNS
for Linux: Version 11.2.0.4.0 — Production

            Oracle
Bequeath NT Protocol Adapter for Linux: Version 11.2.0.4.0 — Production

            TCP/IP
NT Protocol Adapter for Linux: Version 11.2.0.4.0 — Production

  Time:
15-MAY-2017 09:52:12

  Tracing
not turned on.

  Tns error
struct:

    ns main
err code: 12537

TNS-12537: TNS:connection closed

    ns
secondary err code: 12560

    nt main
err code: 0

    nt
secondary err code: 0

    nt OS
err code: 0

opiodr aborting process unknown ospid (24830) as a
result of ORA-609

Mon May 15 10:19:04 2017

Warning: VKTM detected a time drift.

Time drifts can result in an unexpected behavior
such as time-outs. Please check trace file for more details.

Mon May 15 11:27:57 2017

Warning: VKTM detected a time drift.

Time drifts can result in an unexpected behavior
such as time-outs. Please check trace file for more details.

Mon May 15 11:51:06 2017

***********************************************************************

Fatal NI connect error 12537, connecting to:

 (LOCAL=NO)

  VERSION
INFORMATION:

            TNS
for Linux: Version 11.2.0.4.0 — Production

            Oracle
Bequeath NT Protocol Adapter for Linux: Version 11.2.0.4.0 — Production

            TCP/IP
NT Protocol Adapter for Linux: Version 11.2.0.4.0 — Production

  Time:
15-MAY-2017 11:51:06

  Tracing
not turned on.

  Tns error
struct:

    ns main
err code: 12537

TNS-12537: TNS:connection closed

    ns
secondary err code: 12560

    nt main
err code: 0

    nt
secondary err code: 0

    nt OS
err code: 0

opiodr aborting process unknown ospid (24273) as a
result of ORA-609

This is because of
connection closed by the database server because client could not complete the
request of session and database server dropped the connection/session. This
happens during initial phase of session when client and server processes are
communicating and shaking hands after authentication of the client. There can
be other reasons for this also. One reason could be that client itself aborted
(i.e. client rebooted, or network disconnection), another reason could be that
database server was too busy and could not complete connection request timely
and client disconnected before session could be established. There could be
several of other reasons.

Adding parameter
SQLNET.INBOUND_CONNECT_TIMEOUT in sqlnet.ora file and INBOUND_CONNECT_TIMEOUT_
listener_name
in listener.ora file can help us eradicating these errors. Values of
these parameters are in number of seconds. Suppose if we set the values to 60,
it would mean that database/listener would wait for 60 seconds time during
which client can be authenticated before dropping the session request and
logging error in the alert log file (as shown above). After setting these
parameters, reload the listener (lsnrctl reload <listener_name>).

If adding these
parameters does not solve your problem, you may seek help of oracle support by
submitting trace files (after enabling sql trace).

These errors could also
be suppressed by adding following parameter in the sqlnet.ora file

DIAG_ADR_ENABLED = OFF

—Reload
the listener after adding above line.
lsnrctl reload <listener_name>

 Now these
errors should not appear in alert log file, and should go to sqlnet.log instead
that can be further used for investigating about these errors.

Popular Posts — All Times

  • This error means that you are trying to perform some operation in the database which requires encryption wallet to be open, but wallet is …

  • Finding space usage of tablespaces and database is what many DBAs want to find. In this article I will explain how to find out space usage …

  • ORA-01653: unable to extend table <SCHEMA_NAME>.<SEGMENT_NAME> by 8192 in tablespace <TABLESPACE_NAME> This error is q…

  • You may also want to see this article about the ORA-12899 which is returned if a value larger than column’s width is inserted in the col…

  • This document explains how to start and stop an Oracle cluster. To start and stop Grid Infrastructure services for a standalone insta…

  • If you want to know how we upgrade an 11g database to 12c using DBUA,   click here .  For upgrading 12.1.0.1 to 12.1.0.2 using DBUA,   …

  • If database server CPU usage is showing 100%, or high 90%, DBA needs to find out which session is hogging the CPU(s) and take appropriate …

  • By default AWR snapshot interval is set to 60 minutes and retention of snapshots is set to 8 days. For better and precise investigation of…

  • SWAP space recommendation from Oracle corp. for Oracle 11g Release 2 If RAM is between 1 GB and 2 GB, SAWP should be 1.5 times the s…

  • This article explains how to install a 2 nodes Oracle 12cR1 Real Application Cluster (RAC) on Oracle Linux 7. I did this installation on O…

oracle tutorial webinars

ORA-12537: TNS: Connection Closed Error

Oracle’s ability to be customized with deep mechanics in regards to the construction of company databases is one of many reasons that it has become so prevalent in corporations today. Due in part to the complex nature of Oracle database structures, occasionally errors can arise, some of which carry a string of causes and additional problems. The ORA-12537 connection closed error is an example of one of these types of issues that is associated with an assortment of causes and potential outcomes. Let us look at some of these initial triggers for the error and see what can be done to counter them so databases can be returned to full functionality.

The Problem

The ORA-12537 is defined as an informational error, a message error triggered alongside a secondary error that typically offers the true programming issue. Oracle docs describes the cause as “a normal end-of-file condition being reached; partner has been disconnected”. It can occasionally relate to configuration issues in the sqlnet.ora, listerner.ora files or the protocol.ora. Furthermore, the error can derive from the firewall in a network being disconnected due to idling connections.

Another potential cause is that a path name is too long for the Oracle TNS client. Just as well, there is a common bug in Oracle known as 1566794: CONNECTIONS FAIL WITH ORA-12537 WHEN USE_SHARED_SOCKET IS SET IN 8.1.7. The resolution to this condition is to set the USED_SHARED_SOCKET parameter to FALSE.

The error can also occur if the user has listed a 10g database SID with a 9i listener, which can create the problem because of invalid inter-version connections. Additionally, the user can generate an ORA-12537 error in Oracle Apps 11i due to an eBusiness Suite security feature.

One final cause of the error is when the Tnsping Net Service name fails with the TNS-12537. This occurs because the Sqlnet.ora file parameter TCP.VALIDNODE_CHECKING is enabled and TCP.INVITEDNODES is set to a specific IP’s of the client machine. These parameters are enable by default in the Oracle Apps Installation.
The Solution

An initial step for taking on this error is to of course check your records and see what events transpired just prior to the occurrence of the event. From there, the user should attempt to verify that all service names match between the listener and the remote client connect strings. In the event that the firewall was disconnected to due idleness, check the idling parameters across your system and adjust them to reflect the networks usage.

For a path name that is too large, install the exe in a shorter named directory. The user can also modify the TNS Names entry so that it is a bit shorter, they can remove parameters from the entry that are largely unnecessary and they could replace domain names with IP addresses in the event that they shorten things up. When the error is prompted by the aforementioned eBusiness Suite security feature, the solution is to edit your sqlnet.ora file to include the client IP address in the tcp.invited_nodes = (hostname, etc.).

Lastly, to correct the TNSping Net Service name fails error, the user can disable these parameters in the Sqlnet.ora. The user can also add the client machine’s IP address in the TCP.INVITEDNODES list.
Looking forward

As can be seen from above, there are numerous causes of the ORA-12537. With that said, the user can make a couple of adjustments to offset this error. Maintaining an awareness of parameters that are enabled and noting idle times across the network can go a long way in preventing not just this error, but a number of problems within Oracle. Another slight modification to be made is keeping the programming as neat and concise as possible. Working to eliminate long strings of domain names and code is a strong discipline to instill in the database programming process. For more information about these methods, it would is advised to speak with a licensed Oracle consultant.

May 7, 2020

Hi,

Sometimes You can get “ORA-12537: TNS:connection closed” error.

Details of error are as follows.

TNS-00584: Valid node checking configuration error

Cause: Valid node checking specific Oracle Net configuration is invalid.

Action: Ensure the hosts specified in the “invited_nodes” and “excluded_nodes” are valid.

For further details, turn on tracing and reexecute the operation.

   (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=<hostname>)(PORT=1521)))
    TNS-12532: TNS:invalid argument
    TNS-12560: TNS:protocol adapter error
    TNS-502: Invalid argument
    32-bit Windows Error: 515: Unknown error

                                                                          
    Error listening on: (ADDRESS=(PROTOCOL=TCP)(Host=<hostname>)(Port=1562))
    TNS-12560: TNS:protocol adapter error 
    TNS-00584: Valid node checking configuration error


   Connecting to (ADDRESS=(PROTOCOL=TCP)(Host=hostname)(Port=1521))
   TNS-12537: TNS:connection closed
   TNS-12560: TNS:protocol adapter error
   TNS-00507: Connection closed

This error is related with the Permission or ownership or group permission, so check them if they are ok or not.

Check permission.

[[email protected] ~]$ ll $ORACLE_HOME/bin/oracle
-rwsr-s--x. 1 oracle oinstall 239952653 Sep 11 20:36 /u01/app/oracle/product/12.1.2/dbhome_1/bin/oracle

Revoke the user execution permission from $ORACLE/bin/oracle as follows.

[[email protected] ~]$  chmod 6751 $ORACLE_HOME/bin/oracle


[[email protected] ~]$ ll $ORACLE_HOME/bin/oracle
-rwSr-s--x. 1 oracle oinstall 239952653 Sep 11 20:36 /u01/app/oracle/product/12.1.2/dbhome_1/bin/oracle

Or the second case of this error is as follows.

There is an invalid hostname in the TCP.INVITED_NODES list in the sqlnet.ora file.

Oracle no longer  allows  the listener to startup if an invalid hostname or ip address is specified in the invited_nodes list.  The listener will not start if any of the hosts or ip addresses are note resolvable.   The only solution to this issue is to ensure that all the hostnames and ip addresses in the invited nodes list are resolvable using ping or nslookup from the host where the listener is starting.

In some cases, the localhost might cause this behavior.

To solve this error, go to sqlnet.ora and check and fix the right INVITED_NODES IP as follows,

[[email protected] ~]$ cd $ORACLE_HOME/network/admin
[[email protected] admin]$ vi sqlnet.ora 


  TCP.INVITED_NODES=(localhost, <IP ADDRESS>)



TCP.VALIDNODE_CHECKING = YES

TCP.INVITED_NODES = (192.168.63.34,192.168.63.35,192.168.63.36)

Do you want to learn more details about RMAN, then read the following articles.

https://ittutorial.org/rman-backup-restore-and-recovery-tutorials-for-beginners-in-the-oracle-database/

 1,770 views last month,  1 views today

About Mehmet Salih Deveci

I am Founder of SysDBASoft IT and IT Tutorial and Certified Expert about Oracle & SQL Server database, Goldengate, Exadata Machine, Oracle Database Appliance administrator with 10+years experience.I have OCA, OCP, OCE RAC Expert Certificates I have worked 100+ Banking, Insurance, Finance, Telco and etc. clients as a Consultant, Insource or Outsource.I have done 200+ Operations in this clients such as Exadata Installation & PoC & Migration & Upgrade, Oracle & SQL Server Database Upgrade, Oracle RAC Installation, SQL Server AlwaysOn Installation, Database Migration, Disaster Recovery, Backup Restore, Performance Tuning, Periodic Healthchecks.I have done 2000+ Table replication with Goldengate or SQL Server Replication tool for DWH Databases in many clients.If you need Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS Consultancy and Training you can send my email adress [email protected].-                                                                                                                                                                                                                                                 -Oracle DBA, SQL Server DBA, APPS DBA,  Exadata, Goldengate, EBS ve linux Danışmanlık ve Eğitim için  [email protected] a mail atabilirsiniz.

          ORA-609 with
TNS-12537: TNS:connection closed

We almost time receive an error such as ora-609 which shows
in alert log as

TNS- TNS-12537: TNS:connection closed
        ns secondary err code: 12560
        nt main err code: 0
        nt secondary err code: 0
        nt OS err code: 0
    opiodr aborting process unknown ospid (12345) as a result of
ORA-609

This error means could not attach to incoming
connection, so our database process was aborted or closed because incoming
connection was not passed to it by listener. In our case we found sqlnet error
stack as shown below

 TNS-12537: TNS:connection
closed

It means the dedicated process didn’t have a client connection
anymore to work.

As we all know the process of client connections:

1. First
Client initiates a connection to the
database so it connects to the listener.

2. Then
listener starts a dedicated DB process that will receive this connection or
session.

3. After
that, this dedicate process is started and listener passes the connection from
the client to this process.

4. Then
the sever process takes the connection from the listener to continue the
handshake with the client.

5. After
that Server process and client exchange messages or information required for
establishing a session or user logon.

6. Then
the session is opened now.

In
our case, it may be when the dedicated process tries to communicate with the
client it finds that connection was closed.

Solution or
Work around:

We
can eliminate this error by increasing the value of SQLNET.INBOUND_CONNECT_TIMEOUT
in sqlnet.ora file. 

By default the SQLNET.INBOUND_CONNECT_TIMEOUT value is 60
seconds.

The
sqlnet.ora file can be found in RDBMS_HOME/network/admin.

For example:

$ cd $ORACLE_HOME/network/admin

$vi sqlnet.ora

And change the value of SQLNET.INBOUND_CONNECT_TIMEOUT as:

SQLNET.INBOUND_CONNECT_TIMEOUT=300

Then
save the file.

There are many more possibilities which can cause this error
such as:

1. This can happen suppose our client closed the
connection immediately after initiating it.

2. This may occur
when firewall kill the connection.

3. Sometimes, it may happen because of Database, OS or network
performance problem.

4. This error may occur when some client crashes.

Hope this may also useful here:

Hope this may useful and helpful.
Please let us know for any concerns either by below comments or write to @contact us:
https://ora-data.blogspot.in/

Regards,
ora-data Team

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Ora 12570 network session unexpected packet read error
  • Ora 12560 tns ошибка адаптера протокола как исправить
  • Ora 12560 tns protocol adapter error ошибка
  • Ora 12560 tns protocol adapter error sqlplus windows
  • Ora 12547 tns lost contact error

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии