Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unable to connect to Oracle with SchemaSpy

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
like image 679
Poxipoler Avatar asked Aug 26 '16 17:08

Poxipoler


People also ask

Is ojdbc7 compatible with Oracle 19c?

As noted, ojdbc6 and 7 are both successfully used with 19c.

What is JDBC URL in Oracle?

Connection URL: The connection URL for the oracle10G database is jdbc:oracle:thin:@localhost:1521:xe where jdbc is the API, oracle is the database, thin is the driver, localhost is the server name on which oracle is running, we may also use IP address, 1521 is the port number and XE is the Oracle service name.


1 Answers

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
like image 99
zeisi Avatar answered Oct 14 '22 05:10

zeisi