I've a virtual machine, the latest version of Oracle SQL Developer (kit with JDK 8 included - although I installed it separately anyway), and there's a 11G Oracle Database.
My TNS file on my machine does not have the list of all databases, instead it it is as per below (there are multiple databases):
> CONN_DATA = (DESCRIPTION =
> (ADDRESS_LIST =
> (ADDRESS = (PROTOCOL = TCP)(HOST = HOSTNAME)(PORT = XXXX))
> )
> (CONNECT_DATA =
> (SERVICE_NAME = Bob)
> ) )
I tried connecting to one of the databases using multiple methods.
If I choose the TNS conn type using the dbname as the connect identifier, I get no ocijdbc12 in
java.library.path. I went to the advanced settings, and manually pointed to my TNS file just in case.
If I choose the Basic connection type, ORCL as
service name (also tried the database as SID), localhost as hostname or the name of my database, it
fails to resolve the connection.
Also tried to use TNS conn type and Network identifier using "CONN_DATA"
I don't have a clue on what to do, similar issues seems to resolve on an environmental variable issue on my machine, but I'm unsure on how to confirm that.
解决方案
Even though this question is rather old, I had the same issue.
The reason was completely different.
I did not have the network aliases set correctly.
Go to Preferences - Database - Advanced and set the path to TNSNames Directory.