6 Replies Latest reply on Nov 18, 2011 9:28 AM by ray_h

    ORA-12537: TNS:connection closed

      Oracle DB: on Linux x86

      I've just installed a database patch, which seems to have gone well. A pre-requisite for this was shutting down the database.
      Following install, I restarted the database but now cannot connect to it unless I'm connecting internally.

      When I attempt to connect normally, I get this:
      sqlplus ray@bvclone
      SQL*Plus: Release Production on Wed Nov 9 16:04:12 2011

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

      Enter password:
      ORA-12537: TNS:connection closed

      I've looked at a number of threads on this, none of which seem to help.

      Both tnsnames.ora and listener.ora are looking at the same port (1521)

      The only clue I have is that tnsping gives different results when run as different users:

      As oracle on Linux:
      tnsping bvclone
      OK (0 msec)

      As myself on Linux:
      tnsping bvclone

      TNS Ping Utility for Linux: Version - Production on 09-NOV-2011 16:09:51

      Copyright (c) 1997, 2009, Oracle. All rights reserved.

      Used parameter files:

      Used HOSTNAME adapter to resolve the alias
      Attempting to contact (DESCRIPTION=(CONNECT_DATA=(SERVICE_NAME=))(ADDRESS=(PROTOCOL=TCP)(HOST=nn.nnn.nn.nnn)(PORT=1521)))
      TNS-12535: TNS:operation timed out

      I can see that the service name is missing, which suggests I'm missing something blindingly obvious here....any thoughts on what this could be would be much appreciated.


      Edited by: 896276 on 09-Nov-2011 08:22

      Edited by: 896276 on 09-Nov-2011 08:22
        • 1. Re: ORA-12537: TNS:connection closed
          Did you change the port number or anything which has made your old TNS entry obsolete?

          Normally, TNS-12535: TNS:operation timed out happens when you are blocked by firewall from accessing the database port from your client.

          If this does not hold true in your case, you may want to check if all SQLNET adapters are fine (after the upgrade).

          $ORACLE_HOME/bin> adapters

          and check if TCP/IP is there.

          If that's fine, check if you have exceeded the number of processes at database level.

          select MAX_UTILIZATION, CURRENT_UTILIZATION, LIMIT_VALUE from v$resource_limit where

          If nothing works, stop the listener, bounce the database and then restart the listener.
          • 2. Re: ORA-12537: TNS:connection closed
            Thanks Venkat.

            Unfortunately, none of the above worked (yes, even after a listener/database stop/restart).

            I should have mentioned that there are 6 databases being hosted on this one machine, so wonder if that's got something to do with it?

            I feel the tnsping result from another user is the problem - how can the service name not be shown? I'm guessing my tns/listener configuration must be wrong somehow, but I've no idea how.

            Any ideas welcomed, I've hit a brick wall with this one.
            • 3. Re: ORA-12537: TNS:connection closed
              post the following when you logged in as your user:

              $echo $TNS_ADMIN

              post the tnsnames.ora
              • 4. Re: ORA-12537: TNS:connection closed
                Managed to solve the problem (with another pair of eyes) - it appears that the patch install had somehow changed the permissions of the tnsnames.ora file, thus denying read-access to anyone other than the oracle user.

                Permissions altered, listeners stopped and started, and all's well.

                Thanks to all of you who took the time to read/respond.
                • 5. Re: ORA-12537: TNS:connection closed
                  Hi 896276,

                  I am having same problem.

                  how and where did you given permission for the tnsnames.ora file..

                  Ahmed S
                  • 6. Re: ORA-12537: TNS:connection closed
                    Hello there.

                    Somehow the permissions on this file had changed so that only oracle could read them. I suspect it's something I did as opposed to the patch.

                    In my case I just needed to chmod gou+r tnsnames.ora. You'll find it in $ORACLE_HOME/network/admin

                    Hope this helps.