Reputation: 241
I had made connection to the remote Oracle database through SQLDeveloper on my system. Suddenly, the power went down and I had to restart the system.
Now, when I am trying to connect to the remote oracle database, it's throwing an error message:
The Network adapter could not establish the connection.
Vendor code 20
Can anyone help me solving this problem?
Upvotes: 24
Views: 295361
Reputation: 1188
For me this worked : I just navigated to this path in cmd /d/Oracle/dbHome/NETWORK/ADMIN
and then run command 'lsnrctl start' and now I am able to make a connection.
Upvotes: 1
Reputation: 45
Check The port 1521 in your server. May be its blocked by firewall. Or disable firewall and try.
Upvotes: 0
Reputation: 1663
I had this error after fresh Oracle installation.
To fix this I've launched Net configuration assistant (from start menu or netca.bat in the bin folder) and simply added a Listener.
Upvotes: 1
Reputation: 840
Control Panel > Administrative Tools > Services >
Start OracleOraDb11g_home1TNSListener
Upvotes: 7
Reputation: 31
I have had the same problem. I am using windows 7 and this should also work for windows 8. The services responsible for the TNS listener and database were stopped when I looked in the Task Manager.
1: Hit Ctrl-Alt-Del and select "Start Task Manager".
From there go to the "Services" tab.
There are 5 services that need to be running for the database to be accessed correctly.
In the list below "databasename" is the database name you assigned during creation without the quotes.
I am also using database 11g, if you are using another type those fields would be different below. the * after home is the home install, if you have more than 1 database there would be home1, and home2
These are the 5 services
If any of these services are stopped right click on them and start them. After they have all started go back into SQL developer and re-try the connection and it should work.
Upvotes: 3
Reputation: 31
I just created a local connection by breaking my head for hours. So thought of helping you guys.
Step 1: Check your file name listener.ora located at
C:\app\\product\12.1.0\dbhome_3\NETWORK\ADMIN
Check your HOSTNAME, PORT AND SERVICE and give the same while creating new database connection.
Step 2: if this doesnt work, try these combinations give PORT:1521
and SID: orcl
give PORT: and
SID: orcl
give PORT:1521
and SID: pdborcl
give PORT:1521
and
SID: admin
If you get the error as "wrong username and password" :
Make sure you are giving correct username and password
if still it doesnt work try this: Username :system Password: .
Hope it helps!!!!
Upvotes: 3
Reputation: 11
Problem - I was not able to connect to DB through sql developer.
Solution - First thing to note is that SQL Developer is only UI to access to your database. I need to connect remote database not the localhost so I need not to install the oracle 8i/9i. Only I need is oracle client to install. After installation it got the path in environment variable like C:\oracle\product\10.2.0\client_1\bin. Still I was not able to connect the db.
Things to be checked.
If all points are ok for you then check from where you are running sql developer .exe file. I pasted sql developer folder to C:\oracle folder and run the .exe file from here and I am able to connect the database. and my problem of 'IO Error: The Network Adapter could not establish the connection' got resolved. Hurrey... :) :)
Upvotes: 1
Reputation: 1929
In the connection properties window I changed my selection from "SID" to "Service Name", and copied my SID into the Service Name field. No idea why this change happened or why it worked, but it got me back on Oracle.
Upvotes: 1
Reputation: 11
If you have such error when using remote oracle database, you can delete your tnsname and listener then create new config with "hostname" or ip address instead of "localhost". such as listener.ora
LISTENER =
(DESCRIPTION_LIST =
(DESCRIPTION =
(ADDRESS = (PROTOCOL = TCP)(HOST = hostname)(PORT = 1521))
)
tnsnames.ora
DB =
(DESCRIPTION =
(ADDRESS_LIST =
(ADDRESS = (PROTOCOL = TCP)(HOST = hostname)(PORT = 1521))
)
(CONNECT_DATA =
(SERVICE_NAME = DB)
)
)
It works fine for me.
Upvotes: 1
Reputation: 9
This worked for me :
Try deleting old listener using NETCA and then add new listener with same name.
Upvotes: 0
Reputation: 41
Check the listener status to see if it is down:
ps -ef | grep tns
If you don't see output about the listener:
oracle 18244 /apps/oracle/product/11.2.0/db_1/bin/tnslsnr LISTENER -inherit
Then you will need to start it up. To do this, execute the lsnrctl
command.
Type start
in the LSNRCTL>
prompt.
Upvotes: 4
Reputation: 131
https://forums.oracle.com/forums/thread.jspa?threadID=2150962
Re: SQL DevErr:The Network Adapter could not establish the connection VenCode20 Posted: Dec 7, 2011 3:23 AM in response to: MehulDoshi Reply
This worked for me:
Open the "New/Select Database Connection" dialogue and try changing the connection type setting from "Basic" to "TNS" and then selecting the network alias (for me: "ORCL").
Upvotes: 13