Fix Oracle “IO ERROR: The network adapter could not establish the connection” error

By | August 7, 2018

Bismillahi-r-Rahmani-r-Rahim (In the name of Allah, the most Compassionate, the most Merciful)

Assalamu alaikum wa rahmatullahi wa barakatuh (May the peace, mercy, and blessings of Allah be with you)

This is the ad hoc tutorial on how to fix “IO ERROR: The network adapter could not establish the connection” error while trying to connect Oracle Database.

Below content is complementary to the video tutorial above.

It is common problem that after the fresh installation of Oracle Database, it is possible to connect to Database Instance locally, but error raised when trying to connect from the other client in the same network. Below are steps that are needed to fix the IO ERROR: The network adapter could not establish the connection:

  1. First check the Firewall and network related issues.
  2. Check if Oracle Listener service is available and running. If not you may use Oracle Net Configuration Assistant tool to add and register new listener.
  3. If the above steps are ok then we need to configure Oracle Listener appropriately. You may use Oracle Net Manager tool or edit “%ORACLE_HOME%\network\admin\listener.ora” file manually. There are 2 options that need to be considered carefully:
    1. Listening Locations associated with the Listener – Hostname(IP) and Port in Listening Location must exactly match the ones used in the connection string. For example, if you use as target hostname, then there must be Listening Location registered with the same IP address. Listening Location registered for localhost or may not work.
    2. Database Services associated with the Listener – make sure the you use the same SID as indicated in Database Service associated with the Listener.

Example listener.ora file:

(ORACLE_HOME = C:\app\user\virtual\product\12.2.0\dbhome_1)

(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))

ADR_BASE_LISTENER = C:\app\user\virtual\product\12.2.0\dbhome_1\log

Related resources: