IO Error: The Network Adapter could not establish the connection

Test Failed: IO Error: The network Adapter could not establish the connection is very generic error which you will get while connecting via SQL Developer to the Oracle database.

The resolution of this error is very simple. Below are the few checks you need to follow.

Turn off the firewall worked in my case which is point no 3 mentioned below.

1: Check Listener status using below command.

lsnrctl status
Make sure listener.ora file has correct entry defined. It is located in $ORACLE_HOME/network/admin/listener.ora

2: Check tnsping

[oracle@san-cs-test ~]$ tnsping DBRAID7

TNS Ping Utility for Linux: Version 19.0.0.0.0 - Production on 18-OCT-2023 01:16:21

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

Used parameter files:


Used TNSNAMES adapter to resolve the alias
Attempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP)(HOST = san-cs-test)(PORT = 1521))) (CONNECT_DATA = (SERVICE_NAME = DBRAID7)))
OK (10 msec)

Example of tnsnames.ora file

[oracle@san-cs-test ~]$ cat $ORACLE_HOME/network/admin/tnsnames.ora
DBRAID7=
  (DESCRIPTION =
    (ADDRESS_LIST =
      (ADDRESS = (PROTOCOL = TCP)(HOST = san-cs-test)(PORT = 1521))
    )
    (CONNECT_DATA =
      (SERVICE_NAME = DBRAID7)
    )
  )

3: Check Firewall status

Make sure firewall is turned off to allow incoming connection.
[root@san-cs-test ~]# systemctl status firewalld
[root@san-cs-test ~]# systemctl stop firewalld
[root@san-cs-test ~]# systemctl status firewalld
● firewalld.service - firewalld - dynamic firewall daemon
   Loaded: loaded (/usr/lib/systemd/system/firewalld.service; enabled; vendor preset: enabled)
   Active: inactive (dead) since Wed 2023-10-18 01:32:40 EDT; 6s ago
     Docs: man:firewalld(1)
  Process: 996 ExecStart=/usr/sbin/firewalld --nofork --nopid $FIREWALLD_ARGS (code=exited, status=0/SUCCESS)
 Main PID: 996 (code=exited, status=0/SUCCESS)

Oct 10 01:26:07 san-cs-test systemd[1]: Starting firewalld - dynamic firewall daemon...
Oct 10 01:26:07 san-cs-test systemd[1]: Started firewalld - dynamic firewall daemon.
Oct 10 01:26:08 san-cs-test firewalld[996]: WARNING: AllowZoneDrifting is enabled. This is considered an insecure configuration option. It will be remov...ng it now.
Oct 18 01:32:39 san-cs-test systemd[1]: Stopping firewalld - dynamic firewall daemon...
Oct 18 01:32:40 san-cs-test systemd[1]: Stopped firewalld - dynamic firewall daemon.
Hint: Some lines were ellipsized, use -l to show in full.