3

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

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.

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.

D. Lohrsträter
  • 306
  • 3
  • 9
  • Find an admin to update your PATH .. it's not an available instant client until that's set – thatjeffsmith Jul 19 '19 at 14:58
  • Thanks Jeff, but I can't get an admin for this, because the company is very big and strict with such request. The workaround with BAT-file circumvents this requirement. I've used this trick already some time ago with an older version. It worked definitely. Testing worked, but now I can't get it working again. – D. Lohrsträter Jul 20 '19 at 17:19
  • What else is in your bat file? – thatjeffsmith Jul 21 '19 at 12:17
  • Currently not more than you can see in request. Just PATH and start sqld with absolute path. – D. Lohrsträter Jul 22 '19 at 13:14

2 Answers2

3

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. 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"

It works for versions > 20 as well ;-)

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 PATH=%USERPROFILE%\OneDrive - myCompany\Oracle\instantclient_12_2;%JAVA_HOME%;%PATH%

REM start your preferred sqldeveloper
"%USERPROFILE%\OneDrive - myCompany\Oracle\sqldeveloperx64.20.2\sqldeveloper.exe"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

D. Lohrsträter
  • 306
  • 3
  • 9