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:
- First check the Firewall and network related issues.
- 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.
- 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:
- 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 192.168.74.139 as target hostname, then there must be Listening Location registered with the same IP address. Listening Location registered for localhost or 127.0.0.1 may not work.
- 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:
SID_LIST_LISTENER =
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = Oracle8)
(ORACLE_HOME = C:\app\user\virtual\product\12.2.0\dbhome_1)
(SID_NAME = ORCL)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.74.139)(PORT = 1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DESKTOP-V5BU0S8)(PORT = 1521))
)
)
ADR_BASE_LISTENER = C:\app\user\virtual\product\12.2.0\dbhome_1\log
(SID_LIST =
(SID_DESC =
(GLOBAL_DBNAME = Oracle8)
(ORACLE_HOME = C:\app\user\virtual\product\12.2.0\dbhome_1)
(SID_NAME = ORCL)
)
)
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = localhost)(PORT = 1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.74.139)(PORT = 1521))
)
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = DESKTOP-V5BU0S8)(PORT = 1521))
)
)
ADR_BASE_LISTENER = C:\app\user\virtual\product\12.2.0\dbhome_1\log
Related resources: