Unable to connect to Oracle with SchemaSpy

6.4k Views Asked by At

I've installed Oracle Instant Client 64 bits, when connecting with SchemaSpy I get the error message below.

PLEASE NOTE: Both these files exist C:\app\instantclient_12_1\ojdbc6.jar C:\app\instantclient_12_1\ocijdbc12.dll

And "C:\app\instantclient_12_1\" is in the PATH.

I've tried C:\app\instantclient_12_1\ojdbc7.jar as well, same result.

Windows 7 64 bits.

Would greatly appreciate any help from anyone who got this to work correctly.

Error message:

Failed to load driver [oracle.jdbc.driver.OracleDriver] from classpath [file:/C:/app/instantclient_12_1/ojdbc6.jar]

Make sure the reported library (.dll/.lib/.so) from the following line can be
found by your PATH (or LIB*PATH) environment variable

java.lang.UnsatisfiedLinkError: C:\app\instantclient_12_1\ocijdbc12.dll: Specified process not found 
    at java.lang.ClassLoader$NativeLibrary.load(Native Method)
    at java.lang.ClassLoader.loadLibrary0(Unknown Source)
    at java.lang.ClassLoader.loadLibrary(Unknown Source)
    at java.lang.Runtime.loadLibrary0(Unknown Source)
    at java.lang.System.loadLibrary(Unknown Source)
    at oracle.jdbc.driver.T2CConnection$1.run(T2CConnection.java:4115)
    at java.security.AccessController.doPrivileged(Native Method)
    at oracle.jdbc.driver.T2CConnection.loadNativeLibrary(T2CConnection.java:4111)
    at oracle.jdbc.driver.T2CConnection.logon(T2CConnection.java:308)
    at oracle.jdbc.driver.PhysicalConnection.connect(PhysicalConnection.java:662)
    at oracle.jdbc.driver.T2CDriverExtension.getConnection(T2CDriverExtension.java:54)
    at oracle.jdbc.driver.OracleDriver.connect(OracleDriver.java:560)
    at net.sourceforge.schemaspy.SchemaAnalyzer.getConnection(SchemaAnalyzer.java:582)
    at net.sourceforge.schemaspy.SchemaAnalyzer.analyze(SchemaAnalyzer.java:157)
    at net.sourceforge.schemaspy.Main.main(Main.java:42)
E=3I=3
1

There are 1 best solutions below

2
On

Here's how to run SchemaSpy 6 against an Oracle database:

Dependecies

Make sure you have the following available on your machine:

  1. The lastest version from schemaspy.org, the following will describe the process for schemaspy-6.0.0-rc1.
  2. The Oracle JDBC thin driver, otherwise you'll have to mess around with Oracle OCI. You can get it from Oracle Database 12.1.0.2 JDBC Driver & UCP Downloads
  3. SchemaSpy uses GraphViz to generate the diagrams, get it from graphviz.org. You'll need to update you PATH variable, add C:\Program Files (x86)\Graphviz2.38\bin to it (make sure the version fits the one you downloaded).

Database Type

Note, SchemaSpy supports Oracle OCI (-t ora) and Oracle Thin (-t orathin) as database types. To get the list of available database types:

java -jar schemaspy-6.0.0-rc1.jar -dbhelp

Configuration

You can put most configuration parameters into a file called schemaspy.properties, put this file into the same directory as schemaspy-6.0.0-rc1.jar.

Example schemaspy.properties:

# type of database. Run with -dbhelp for details
schemaspy.t=orathin
# path to the dowloaded oracle jdbc drivers, for example
schemaspy.dp=C:\tools\dbdoc\drivers\ojdbc7.jar
# database properties: host, port number, name user, password
schemaspy.host=[orcale database host]
schemaspy.port=[orcale database port, usualy 1521]
schemaspy.db=[database name or SID]
schemaspy.u=[username]
schemaspy.p=[password, for complexer ones, put it in quotation marks]

# output dir to save generated files
schemaspy.o=C:\tools\dbdoc\output

# db scheme for which generate diagrams
schemaspy.s=[scheme name]

Generate documentation

With the configuration in place, now all you have to do is run:

java -jar schemaspy-6.0.0-rc1.jar