Oracle XE Database Connection Test "Status : failure -Test failed: IO Error: The network adapter could not establish the connection"

I would like to know how to configure oracle sql developer database connection?

I tried the following:

connection name: hr_orcl
username: hr
Password: hr

connection type: basic
port: 1521
SID: xe


Status: failure-Test failed: IO Error: The network adapter could not establish the connection

Can someone help?

No matter which edition of Oracle database you're using or where the database is installed (on the same pc as SQL Developer or on a remote server), there are 4 things you need to know when creating a connection from Oracle SQL Developer:
  • the username
  • the password
  • the hostname (i.e. the name of the machine where the database has been installed)
  • the port that the database listener is using to "listen" for connection attempts
  • and either the Oracle SID or the service name.

If you have Oracle Database eXpress Edition (XE) installed locally then things are much simpler: the username, password, sid and service name should all be the same - XE. That just leaves the host name and the port. Again if installed locally the hostname is most likely to be "localhost" without the quotes or you can use the ip address and the port is most likely to be 1521.

However you can check most of these details quite easily. To check the hostname, open a command window and type "ping localhost", that should result in several messages starting with "Reply from" being displayed.In the same window you enter "tnsping xe" to check that the service name is recognized. Included in the response will be the service name and the port followed by "OK" if the service name is recognized.

Oracle XE also provides another way to check the setting - use the provided Oracle Application Express (APEX) "Get Started" application which you can access from the Windows start menu (from the Oracle Database Express group). This brings up a login page on which you can login as system and then navigate to the Administration -> About Database page. That will confirm the database name.

Having checked the service name/sid, port and hostanme and that there is a network connection to the database (via the Oracle utility TNSPING) if you still can't connect using SQL Developer, then start SQL*Plus from the Oracle Database Express group on the Windows start menu and enter "connect / as sysdba" to connect to the database and query dba_users to ensure that HR is a user. You can only use "connect / as sysdba" if you are logged in as the database owner (usually Oracle on Linux/UNIX) and the database is installed locally. You can then change the HR account password.

In this particular case it is most likely that the hostname field has not been set correctly.

You might also be interested in the following question and answer about SQL Developer Problem connecting "as sysdba" from Oracle SQL Developer.

See our Oracle training page to see how we can help you to learn Oracle both on-line and off-line.

Click here to post comments

Join in and write your own page! It's easy to do. How? Simply click here to return to Oracle Questions.