ORA-12543: TNS:destination host unreachable

Connectivity errors are common questions on Oracle related forums and in many cases they are highly misunderstood by the poster of the questions and some responders.

This aim of this document is to show a method for diagnosis and resolution to a scenario in which an ORA-12543 is raised during the connection to a database.

Problem:

You attempt a connection to database through SQL*Plus and you receive the following error.

SQL*Plus: Release 11.2.0.1.0 Production on Wed Jun 30 11:06:18 2010

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

SQL> connect hr@proddb
Enter password:
ERROR:
ORA-12543: TNS:destination host unreachable

SQL>

Diagnosis process:

If you are unfamiliar with the error use the oerr utility to get more information on the error.

[oracle@ora2 ~]$ oerr ora 12543
12543, 00000, "TNS:destination host unreachable"
// *Cause: Contact can not be made with remote party.
// *Action: Make sure the network driver is functioning and the network is up.
[oracle@ora2 ~]$

An ORA-12543 most commonly indicates a problem either resolving the host name given in the ADDRESS parameter of the tnsnames entry or that the network is unavailable. In some cases it could also be that the database server down.

If you were to trace the connection attempt you would see something similar to the following.

(3086649024) niotns: Calling address: (DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST=prod)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=proddb)(CID=(PROGRAM=sqlplus)(HOST=ora2.localdomain)(USER=oracle))))
(3086649024) nscall: connecting...
(3086649024) nsc2addr: (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=192.168.56.130)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=proddb)(CID=(PROGRAM=sqlplus)(HOST=ora2.localdomain)(USER=oracle))))
(3086649024) nttbnd2addr: using host IP address: 192.168.56.130
(3086649024) nsopen: opening transport...
(3086649024) nttcni: Tcp conn timeout = 60000 (ms)
(3086649024) nttcni: trying to connect to socket 8.
(3086649024) ntt2err: soc 8 error - operation=1, ntresnt[0]=513, ntresnt[1]=101, ntresnt[2]=0
(3086649024) nserror: nsres: id=0, op=65, ns=12543, ns2=12560; nt[0]=513, nt[1]=101, nt[2]=0; ora[0]=0, ora[1]=0, ora[2]=0
(3086649024) nsopen: unable to open transport
(3086649024) nioqper:  error from nscall
(3086649024) nioqper:    ns main err code: 12543
(3086649024) nioqper:    ns (2)  err code: 12560
(3086649024) nioqper:    nt main err code: 513
(3086649024) nioqper:    nt (2)  err code: 101
(3086649024) nioqper:    nt OS   err code: 0
(3086649024) niqme: reporting NS-12543 error as ORA-12543
(3086649024) niotns: Couldn't connect, returning 12543

Looking at the trace we can see that TNS was unable to open transport to the host.

Below are the following possible issues ranging from least probable to most probable.

The database server is down– Possible and can be easily verified.
The network is down – Probable as simple ping test to another server that is known to be up can narrow down the issue some.
The IP address is incorrect in either the host file or the DNS– Most likely the case. Even if you do not know the IP address, if you factor out the other two possibilities all you are left with is this one.

Resolution

Correct the incorrect IP address in the hosts file/DNS or resolve the network outage.

26 thoughts on “ORA-12543: TNS:destination host unreachable”

  1. i have a similar problem but i have been unable to find an answer from the net. I have 2 VMs on VirtualBox. Each of them have an oracle 11gr2 runnig. i can ping each other, but tnsping is not working, i can also ping the host succesfully.
    This is what i get:
    tnsping MIGRDB01
    Used parameter files:
    /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/sqlnet.ora
    TNS-03505: Failed to resolve name
    ——————-
    cat /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/sqlnet.ora
    NAMES.DIRECTORY_PATH= (TNSNAMES)
    ADR_BASE = /u01/app/oracle
    ———————————————-
    cat /u01/app/oracle/product/11.2.0/dbhome_1/network/admin/tnsnames.ora
    OLAPDB =
    (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oldbapex.localdomain)(PORT = 1521))
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = OLAPDB)
    )
    )

    MIGRDB01 =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 10gTo11g.localdomain)(PORT = 1521))
    )
    (CONNECT_DATA =
    (SERVER = DEDICATED)
    (SERVICE_NAME = MIGRDB01)
    )
    )
    ————————————————————-
    This is my listener:
    LISTENER =
    (DESCRIPTION_LIST =
    (DESCRIPTION =
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = TCP)(HOST = oldbapex.localdomain)(PORT = 1521))
    )
    (ADDRESS_LIST =
    (ADDRESS = (PROTOCOL = IPC)(KEY = EXTPROC))
    )
    )
    )

    SID_LIST_LISTENER =
    (SID_LIST =
    (SID_DESC =
    (SID_NAME = PLSExtProc)
    (ORACLE_HOME = /u01/app/oracle/product/11.2.0/dbhome_1)
    (PROGRAM = extproc)
    )
    (SID_DESC =
    (GLOBAL_DBNAME = OLAPDB)
    (ORACLE_HOME =/u01/app/oracle/product/11.2.0/dbhome_1)
    (SID_NAME = OLAPDB)
    )
    )
    ADR_BASE_LISTENER = /u01/app/oracle
    ————————————————-
    The listener is up and runing in both databases (on different VMs)
    ————————————————————
    the tnsnames can ping itself successfully

    Is there anything wrong with the listener?

    need someone help plz

  2. Hi Eric Jenkinson ..

    Excellent blog all the articles are very good, and easy to understand ….

  3. Hi,

    I also faced this issue . As per I can remember this error occurred due to @ character was used in the password of my database.

    Plz check once and lets know the result.

    Thanks

    Kamran

  4. Thanks a lot kamram, your post helped me. I was wondering to resolve this issue & thank god i got your post & i changed my password & its working now. Thanks a lot

  5. Hi guys , I’ve got a same issue till now am facing the issue. Just now I’ve understand through your replys how to change password I’ve@ character in between my password could you please explain me detailed info for changing the password…

  6. PLZ

    Solution problem oracle error 12543
    first finished password
    and i changed name” hamid@77100
    second appear this problem

    best Regards

  7. hi
    I installed two oracle Linux in VMware workstation and I configured both network settings and I can ping two hosts but I couldn’t connect through tns . I have problem with TNS-12543: TNS:destination host unreachable. I can ping host

    plz give me solution

  8. Thanks a million for the post. The listener on my Virtual box was not working.I followed the steps and found out that the IP address was wrong. I changed it and it worked.

  9. No need to change your DB password, just skip @ sign in your password and try it will work.

  10. Salam brother.. it is the firefire error.
    if we have two vitural machine
    db1
    db2
    issue the following command on db1
    ]$service iptables save
    ]$service iptables stop
    ]$chkconfig iptables off
    similarly issue above command on db2 then
    on db2 issue
    ]$tnsping db1
    and on db1
    ]$ tnsping db2.

  11. Hi Guys,

    Me also same problem facing, but I didn’t use @charector symbol in my oracle user password.
    I used two servers in single VMware workstation and I am connecting to server1 database like $sqlplus scott/scott@server1.test.com:1521 from server2.
    plz give me solution.

  12. For SQLPLUS:
    ORA-12543: TNS:destination host unreachable
    Solution:
    Give User name: sys as sysdba
    If Original Password contains: Welcome@123
    Give password: Welcome123

  13. Hello Rubino,

    I had an issue same as like you.
    Finally i got an issue resolved with disabling firewall and SELinux in linux.
    You can try this solution if you are not using in live environment.

    Thanks

  14. I started to see this issue after changing my pwd with ‘@’ character in it. I tried to skip the ‘@’ character as mentioned here but it didn’t work for me and gives the same error. Is there any other way to fix this issue – Change the password

Leave a Reply

Your email address will not be published. Required fields are marked *