Oracle SQL Developer - java.library.path 中没有 ocijdbc12

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/42416946/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 01:13:02  来源:igfitidea点击:

Oracle SQL Developer - no ocijdbc12 in java.library.path

oracleoracle-sqldeveloper

提问by Tiago

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.

我有一个虚拟机,最新版本的 Oracle SQL Developer(包括 JDK 8 的套件 - 尽管我还是单独安装了它),还有一个 11G 的 Oracle 数据库。

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):

我的机器上的 TNS 文件没有所有数据库的列表,而是如下所示(有多个数据库):

> 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"
  • 如果我选择使用 dbname 作为连接标识符的 TNS conn 类型,则在 java.library.path 中没有 ocijdbc12。我进入高级设置,并手动指向我的 TNS 文件以防万一。
  • 如果我选择基本连接类型,ORCL 作为服务名称(也尝试将数据库作为 SID),localhost 作为主机名或我的数据库名称,则无法解析连接。
  • 还尝试使用“CONN_DATA”使用 TNS conn 类型和网络标识符

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.

我不知道该怎么做,类似的问题似乎可以解决我机器上的环境变量问题,但我不确定如何确认。

回答by Gunnar Bernstein

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.

转到首选项 - 数据库 - 高级并将路径设置为 TNSNames 目录。

回答by PcSi-L

I've solved this issue by using the same path as Gunnar Bernstein. In SQL Developer "Outils > Préférence > Avancé > Réperttheitroade tnsnames" (yes, i'm French. That' a ;) for french DBA's) My old tnsnames pathwas "C:\oracle"I updated it to the right path "c:\oracle\product\10.2.0\db_1\NETWORK\ADMIN". And, taaataaammmm "Status : success".

我已经通过使用与 Gunnar Bernstein 相同的路径解决了这个问题。在 SQL Developer 中,“Outils > Préférence > Avancé > Réperttheitroade tnsnames”(是的,我是法国人。那是一个 ;)对于法国 DBA)我的旧tnsnames path"C:\oracle"我将它更新到正确的路径"c:\oracle\product\10.2.0\db_1\NETWORK\ADMIN"。而且, taaataaammmm "Status : success"

回答by Ashish Shetkar

the solution is around setting the correct oracle client and tns names directory only

解决方案是仅设置正确的 oracle 客户端和 tns 名称目录

just posting this answer to help others - there might be different directories structure for the same

只是发布此答案以帮助其他人-相同的目录结构可能不同

go to  tools --> preference -->database --> advanced 

in the lower section

在下部

check the box of --> Use oracle client

勾选 --> 使用 oracle 客户端

then click on --> configures

然后点击 --> 配置

if your oracle client is already installed correctly

如果您的 oracle 客户端已经正确安装

you will see client type -->oracle_home if you don't --> select instant client

你会看到客户端类型 --> oracle_home 如果你没有 --> 选择即时客户端

mostly client installation directory will be

主要是客户端安装目录

for oracle 11g

C:\Apps\oracle\Clients2_64

and

for oracle 12c 

C:\Apps\oracle\Clients102_64

the _64 represents 64 bit client. if your client is 32 bit --> select _32 folder

_64 代表 64 位客户端。如果您的客户端是 32 位 --> 选择 _32 文件夹

then in the tns names directory - put this

然后在 tns 名称目录中 - 把这个

C:\Apps\oracle\network\admin

if this is not the tnsnames directory for you --> try to find

如果这不是您的 tnsnames 目录 --> 尝试查找

find this filename on your computer -->  tnsnames.ora