如何使用Navicat Premium连接Oracle数据库

2023-02-25,,

  • 软件环境
  • 直接使用 navicat 连接 oracle 出现的问题
  • 查看 navicat 所使用的 oracle instant client 版本
  • 查看 oracle 版本
  • 检查 oracle 和 instant client 版本是否匹配
  • 下载 instant client 12.2 和 visual studio 2013 (vc++ 12.0)
  • 配置 navicat

软件环境

本文使用的软件版本为:
windows 10 专业版 64 位(10.0,版本 10586)
navicat premium 11.0.18 (x64)
instantclient-basic-windows.x64-12.2.0.1.0
vcredist_x64.exe (microsoft visual c++ 2013 redistributable (x64) - 12.0.40660)

直接使用 navicat 连接 oracle 出现的问题在安装完 navicat 之后,创建 oracle 数据库连接,但发现无法连接到数据库:

出现上述错误的原因,可能是 navicat 自带的 oracle instant client 与我们要连接的 oracle 数据库版本不匹配导致的。

查看 navicat 所使用的 oracle instant client 版本

点击 navicat 菜单栏的 tools → options… → miscellaneous → oci,通过 oci library (oci.dll) * 可知当前 navicat 所使用的 instant client 版本:

查看 navicat 的安装目录,我们会发现 navicat premium 11.0.18 自带的 instant client 版本为 10.2:

查看 oracle 版本

我们再来查看下所要连接的 oracle 数据库版本:

到此为止,我们知道了目前我们所使用的 oracle 版本和 instant client 版本,接下来我们来检查下他们两个版本是否匹配。

检查 oracle 和 instant client 版本是否匹配打开 oracle instant client 官网:

点击 downloads,打开 instant client 下载页:

因为我使用的是 64 位操作系统,故选择 instant client for microsoft windows (x64):

因为我们肯定是要下载 instant client 的,故在此先勾选接受许可协议(accept license agreement)。

并且通过本页面,我们知道了 instant client 18.3 版本可以连接到 oracle 11.2 及以后的版本(第二个红框处),但我们先忽略这里,直接来到该页底部:

我们发现 18.3 和 12.2 版本的 instant client 都是可以连接 oracle 11.2 的(我们所要连接的 oracle 版本),并且 18.3 和 12.2 版本的 instant client 还需要 visual studio 2013 redistributable 才可运行,故我们分别下载这两个软件。

下载 instant client 12.2 和 visual studio 2013 (vc++ 12.0)这里我下载的是 instant client 12.2:

然后,下载 visual studio 2013 (vc++ 12.0):

配置 navicat

我们可以将 instantclient-basic-windows.x64-12.2.0.1.0.zip 解压至任意目录,比如 c:\portable\instantclient_12_2,然后在 navicat 中配置此版本的 oci:

配置完 oci 后,需要重启 navicat,然后再次连接 oracle 数据库:

这时,我们发现 navicat 又报错了,提示 cannot load oci dll, 126…。

这是因为环境中缺少 visual studio 2013 redistributable 所致的。

安装 visual studio 2013 redistributable:

到此为止,我们即可使用 navicat 正确连接到 oracle 数据库了

以上就是如何使用navicat premium连接oracle数据库的详细内容,更多关于使用navicat premium连接oracle数据库的资料请关注其它相关文章!