Skip to Main Content
  • Questions
  • Unable to connect to database xe using sql developer

Breadcrumb

Question and Answer

Connor McDonald

Thanks for the question, Pooyan.

Asked: April 03, 2020 - 7:20 pm UTC

Answered by: Connor McDonald - Last updated: April 06, 2020 - 1:06 am UTC

Category: SQL Developer - Version: 19.4.0.354.1759

Viewed 100+ times

You Asked

Hi ,

I am unable to connect to oracle database using SQL DEVELOPER. It gives me" i/o error network adapter could not establish connection". Please let me know what are the possible reasons for it and provide me the solution for the same.
- I am using sql developer Version: 19.4.0.354.1759 and Oracle XE184
- My connection type is basic to localhost:1521
- It also does not recognize my username "sys" on windows cmd
- I am a beginner in DBMS

Regards

and we said...

1) Make sure the listener is running

Go to Services and check for the OracleTNSListener and start it if needed

2) Make sure XE is running.

Go to Services and check for the OracleServiceXE and start it if needed

Then try the connection again. If that does not work, then

3) Fire up a command prompt and run:

lsnrctl status

It should come back with something like this:

C:\temp>lsnrctl status 

LSNRCTL for 64-bit Windows: Version 19.0.0.0.0 - Production on 06-APR-2020 08:59:55

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

Connecting to (DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=localhost)(PORT=15h21)))
STATUS of the LISTENER
------------------------
Alias                     LISTENER
Version                   TNSLSNR for 64-bit Windows: Version 19.0.0.0.0 - Production
Start Date                20-MAR-2020 19:47:07
Uptime                    16 days 13 hr. 12 min. 47 sec
Trace Level               off
Security                  ON: Local OS Authentication
SNMP                      OFF
Listener Parameter File   C:\oracle\product\19\network\admin\listener.ora
Listener Log File         C:\oracle\diag\tnslsnr\gtx\listener19\alert\log.xml
Listening Endpoints Summary...
  (DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=127.0.0.1)(PORT=1521)))
  (DESCRIPTION=(ADDRESS=(PROTOCOL=ipc)(PIPENAME=\\.\pipe\EXTPROC1519ipc)))
Services Summary...
Service "db19" has 1 instance(s).
  Instance "db19", status READY, has 1 handler(s) for this service...
Service "pdb1" has 1 instance(s).
  Instance "db19", status READY, has 1 handler(s) for this service...
The command completed successfully


Look for your the "listening endpoints" and the "services summary"

So in my case, my SQL Dev entries would then be:

host = localhost
port = 1521
service = pdb1

For XE, the service is normally XEPDB1. I suspect your listener might either be stopped or perhaps listening on a different IP address to localhost.