Wednesday, October 30, 2019

ORA-12546: TNS:permission denied

I recently faced this error message while trying to connect with the database (running on my local Windows host) using a TNS service. Although connecting without TNS service was working fine, however, connection was failing with ORA-12546 when I tried to connect using TNS service. Following is what I faced.
SQL> host tnsping salman12

TNS Ping Utility for 64-bit Windows: Version 12.1.0.2.0 - Production on 23-OCT-2019 13:48:57

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

Used parameter files:
d:\oracle\product\12.1.0\dbhome_1\network\admin\sqlnet.ora


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = SALMQURE-SG)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = salman12)))
OK (140 msec)

SQL> conn c##salman/salman@salman12
ERROR:
ORA-12546: TNS:permission denied

There could be several different reasons of this error as I found after searching on google. I am sharing one of the causes of this error. For my case, I was actually connected to a VPN using Cisco AnyConnect and this was causing the whole issue. After I disconnected from the VPN, I was able to connect with the database using TNS service. For your case, an antivirus, a firewall or permissions on oracle software files may also cause this error message.   

4 comments:

  1. But isn't there a fix for when the VPN is connected? Cisco AnyConnect appears to be the cause of my error as well, but I need to be able to connect to the database from other machines that are on the network which is why the VPN connection is required.

    ReplyDelete
    Replies
    1. Other machines are in which network, same as your database network? In that case you should be able to connect if you are into this network using VPN. If "other machines" are in a different network (through VPN or by any other means), they would probably not able to connect. Your network admin may explain it to you in a better way.

      Delete
    2. Thanks for the quick reply. The other machines are in the same corporate network, but the machine with the databases is connected to the network through the VPN. Some of the other machines are also connected to the network through a VPN connection and some are on the network directly. But once the VPN is connected, unless I had a connection already established to the Oracle database, I get an ORA-12514, TNS:listener does not currently know of service requested in connect descriptor, but this appears to be because of the ORA-12546: TNS:permission denied error from the listener, which is the error I get if I run a "lsnrctl service" statement. If I am not connected to the VPN, then the local machine connects to the Oracle databases without any errors, and all seems fine (which seemed to be what you described). But then the machine is not attached to the network, so none of the other machines can connect to the Oracle databases.

      Delete
    3. This is quite expected behavior. I don't think connecting a database host/server with a VPN is a good idea, this is actually causing all this to you. I am not aware of any workaround for this. You may try consulting MOS if they give you a solution to bypass this using some parameter etc.

      Delete

Popular Posts - All Times