Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. SQL Server
  3. Question
SQL Server

What to do in case of ora-12543: tns:destination host unreachable?

Asked by Donna Chapman Feb 7, 2023 7.1K views 3 answers
Share

About this question

I have a installed oracle 19c

but i am unable to login

What must I do? 

Your answer

3 Answers

Ranjana Admin JanBask Expert Latest answer

Answered on Jan 29, 2025

The ORA-12543: TNS:destination host unreachable error in Oracle happens when your database client cannot connect to the database server. This usually means there’s a network issue or a misconfiguration. Here’s how to fix it:


1. Understand Why This Error Occurs

This error usually happens when:

  • The database server is down or unreachable.
  • The TNS entry is incorrect or the hostname is misspelled.
  • There’s a firewall or network restriction blocking the connection.
  • The Oracle listener isn’t running on the server.

2. Steps to Fix the Error

✅ Check if the Server is Reachable

Try pinging the database server from your client machine:

  ping your-db-server

If there’s no response, the server might be offline or there’s a network issue.

✅ Test the Connection with TNSPING

Run this command in Command Prompt or Terminal:

  tnsping your-db-alias

If this fails, check your TNSNAMES.ORA file for errors.

✅ Verify Your TNSNAMES.ORA File

Open tnsnames.ora (usually in C:Oracle
etworkdmin on Windows).

Ensure the hostname, port, and service name are correct:

YOUR_DB_ALIAS =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = your-db-server)(PORT = 1521))
    (CONNECT_DATA =
      (SERVICE_NAME = your-service-name)
    )
  )

Make sure the HOST value is correct and the database is running on that server.

✅ Check Firewall and Network Settings

If the server is on a different network, a firewall might be blocking port 1521 (default Oracle port).

Try disabling the firewall temporarily (if permitted) and check again.

✅ Restart the Oracle Listener

If the listener is down, restart it on the database server:

lsnrctl stop
lsnrctl start

Then, try connecting again.

3. Final Thoughts

This error is usually network-related, so start by checking connectivity, TNS settings, and firewall rules. If you’re still stuck, let me know what steps you tried!

Was this helpful?

Ranjana Admin JanBask Expert

Answered on May 6, 2024

The ORA-12543 error typically occurs when the Oracle client cannot connect to the Oracle server because the specified destination host is unreachable. Here are some steps you can take to troubleshoot and resolve this issue:


Check Network Connectivity: Ensure that the network connection between the client and the server is working properly. Ping the server from the client machine to verify connectivity.

Verify Hostname and Port: Double-check that the hostname and port specified in the connection string are correct. Ensure there are no typos or errors in the configuration.

Firewall Configuration: Make sure that the firewall settings on both the client and server machines allow communication over the specified port. If necessary, adjust the firewall rules to permit Oracle traffic.

Check Listener Status: Verify that the Oracle Listener service is running on the server. You can do this by using the lsnrctl status command on the server machine.

Verify Listener Configuration: Ensure that the listener configuration (listener.ora) on the server is correct and includes the appropriate entry for the database instance you are trying to connect to.

Restart Services: Sometimes, simply restarting the Oracle services on the server or the client machine can resolve connectivity issues. Restart the Oracle Listener service (lsnrctl stop followed by lsnrctl start) and try connecting again.

Check Server Availability: Make sure that the Oracle database server is up and running. If the server is down or undergoing maintenance, you won't be able to establish a connection.

Review Log Files: Check the Oracle alert log and listener log files for any errors or warnings that might provide clues about the cause of the connectivity issue.

Consult Documentation: If you're still unable to resolve the issue, consult the Oracle documentation or seek assistance from your database administrator or IT support team for further troubleshooting.

By following these steps, you should be able to diagnose and resolve the ORA-12543 error and establish a successful connection to the Oracle database.


Was this helpful?

More SQL Server discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest SQL Server Blogs

Guides, tips and career advice on SQL Server from JanBask experts.