让 Sqldeveloper 在没有管理员权限的情况下在 Windows 上使用即时客户端? [英] Getting Sqldeveloper working with instantclient on Windows without admin privileges?

查看:62
本文介绍了让 Sqldeveloper 在没有管理员权限的情况下在 Windows 上使用即时客户端?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在 Win10-64bit 的企业 PC 上安装了 Sqldeveloper Version 19.1 64 位版本.

I've installed Sqldeveloper Version 19.1 64-bit Version on an enterprise PC with Win10-64bit.

它适用于嵌入式 jdbc 客户端,但我需要使用 Oracle OCI 客户端使其正常工作.原因之一是对取消长时间运行的查询的更好支持.

It works fine with embedded jdbc-client, but I need to get it working using the Oracle OCI-client. One reason is the much better support to cancel long running queries.

使用 OCI 客户端(厚驱动程序)肯定需要像 Instantclient_12_2 这样的客户端.我在工作站上没有管理员权限,因此将完整的 Instantclient_12_2 复制到企业 PC.

Using an OCI-client (thick-driver) requires for sure a client like instantclient_12_2. I have no admin privileges on my workstation and so copied the full instantclient_12_2 to the enterprise PC.

由于我不允许自己更改 %PATH%,所以我创建了一个带有所需设置的 start.bat 文件,因为没有它也无法工作(已经尝试过).

Since I'm not allowed to change the %PATH% myself, I created a start.bat file with required settings, because without, it also won't work (already tried).

PATH="C:\Users\myuser\OneDrive\Oracle\instantclient_12_2";%JAVA_HOME%;%PATH%
C:\Users\myuser\OneDrive\Oracle\sqldeveloper64\sqldeveloper.exe

当我尝试在没有此更改的情况下配置另一个 Oracle 客户端时,出现另一个错误,即需要在其他任何其他路径之前定义到 Instantclient 的 PATH.

When I try to configure another Oracle-Client without this change, I get another error, that PATH to instantclient needs to be defined before any others.

现在,用这个 bat 文件启动 sqldeveloper 工作正常.可以使用内部 jdbc 客户端建立连接.

Now, starting sqldeveloper with this bat-file works fine. Connections can be established using the internal jdbc client.

然后,我在 SQLdeveloper (Preferences/Database/Advanced) 中配置了 Oracle Client 并选择了 Instantclient 目录.

Then, I've configured the Oracle Client in SQLdeveloper (Preferences/Database/Advanced) and selected the instantclient directory.

按下测试"按钮按钮打开消息日志Oracle 客户端测试结果 - 日志";并显示错误.

Pressing the "Test" button opens the Messages log "Oracle Client Test Results - Log" and shows an error.

Error: Could not create the Java Virtual Machine.
Error: A fatal exception has occured, Program will exit.
Unrecognized option: -

现在,我迷路了,因为我不是 Java 专家.我想知道,为什么 sqldeveloper 作为 Java 工具正在运行,但即时客户端却说它无法创建 JVM.

Now, I'm lost, because I'm not a Java-Expert. I'm wondering, why sqldeveloper as Java-tool is running, but the instant-client says it can't create the JVM.

我使用 OCI-client 的原因是,它具有例如更好地支持用户中断.

The reason for me to use OCI-client is, that it has e.g. better support of User-breaks.

推荐答案

没有管理员权限,也没有永久更改 %PATH% 环境的权限,您只需要在某处安装整个目录并添加一个 .BAT 文件,该文件会发生变化在调用 SQL-Developer 之前临时环境.

Without admin privileges and no permission to change your %PATH% env permanently, you only need to install the whole directory somewhere and add a .BAT file, that changes environment temporarily before calling SQL-Developer.

  1. 安装完整的 SQL-Developer,例如在 C:\myprogs\sqldeveloper
  2. 在某处安装即时客户端,例如在 C:\myprogs\instantclient_12_2
  3. 创建 .BAT 文件,例如C:\myprogs\sqldeveloper\startsqldev.bat 内容如下:
  1. Install complete SQL-Developer e.g. in C:\myprogs\sqldeveloper
  2. Install instant-client somewhere, e.g. in C:\myprogs\instantclient_12_2
  3. Create .BAT file, e.g. C:\myprogs\sqldeveloper\startsqldev.bat with following content:

set PATH=C:\myprogs\instantclient_12_2;%PATH%
REM start sqldeveloper
"C:\myprogs\sqldeveloper\sqldeveloper.exe"

它适用于版本 >还有 20 个 ;-)

It works for versions > 20 as well ;-)

这篇关于让 Sqldeveloper 在没有管理员权限的情况下在 Windows 上使用即时客户端?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆