How to get Sqldeveloper 19.1 64-bit working with i

2020-03-31 09:34发布

问题:

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

It works fine with embedded jdbc-client, but I need to get it working using the Oracle OCI-client.

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.

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

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.

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

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

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

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.

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

回答1:

Meanwhile, I've solved it.

Result of testing:

Testing the Instant Client located at C:\Users\myuser\Oracle\instantclient_12_2
Testing client directory ... OK
Testing loading Oracle JDBC driver ... OK
Testing checking Oracle JDBC driver version ... OK
  Driver version: 12.2.0.1.0
Testing testing native OCI library load ... OK
Success! 

Reason were following mistakes:

  1. Forgot "set" in front of Variable assignment (because I'm usually using Unix)
  2. Used quotation marks during Variable assignment, which are taken as part of the value (also different to UNIX).
  3. Added JAVA_HOME and JRE_PATH

See below my complete bat-file (adapted, because of some secret information within pathnames):

REM Optional: setting of USE_OS_DATETIME_FORMAT changes DATE-Format
set USE_OS_DATETIME_FORMAT=1

set JAVA_HOME=C:\Users\myuser\OneDrive - myCompany\Oracle\sqldeveloperx64.19.1\jdk
set JRE_PATH=C:\Users\myuser\OneDrive - myCompany\Oracle\sqldeveloperx64.19.1\jdk\jre
set PATH=C:\Users\myuser\OneDrive - myCompany\Oracle\instantclient_12_2;%JAVA_HOME%;%PATH%

REM Start sqldeveloper with new local environment:
"C:\Users\myuser\OneDrive - myCompany\Oracle\sqldeveloperx64.19.1\sqldeveloper.exe"

Additionally, I've added a shortcut to the bat-file and now I can start it simply with CRTL-SHIFT-S ;-)

BTW: Same solution works fine on Win10 as well