无法使用SchemaSpy连接到Oracle

时间:2016-08-26 17:07:38

标签: oracle schemaspy

我已经安装了Oracle Instant Client 64位,当与SchemaSpy连接时,我收到以下错误消息。

请注意:这两个文件都存在 C:\程序\ instantclient_12_1 \ ojdbc6.jar C:\应用\ instantclient_12_1 \ ocijdbc12.dll

和" C:\ app \ instantclient_12_1 \"在PATH中。

我也尝试了C:\ app \ instantclient_12_1 \ ojdbc7.jar,结果相同。

Windows 7 64位。

非常感谢任何使这个工作正常的人的帮助。

错误讯息:

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 个答案:

答案 0 :(得分:9)

以下是针对Oracle数据库运行 SchemaSpy 6 的方法:

<强>依赖条件

确保您的计算机上有以下内容:

  1. 来自schemaspy.org的最新版本,以下内容将描述schemaspy-6.0.0-rc1的过程。
  2. Oracle JDBC瘦驱动程序,否则您将不得不使用Oracle OCI。您可以从Oracle Database 12.1.0.2 JDBC Driver & UCP Downloads
  3. 获取
  4. SchemaSpy使用GraphViz生成图表,从graphviz.org获取。您需要更新PATH变量,向其添加C:\Program Files (x86)\Graphviz2.38\bin(确保版本适合您下载的版本)。
  5. 数据库类型

    注意,SchemaSpy支持Oracle OCI(-t ora)和Oracle Thin(-t orathin)作为数据库类型。要获取可用数据库类型的列表:

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

    <强>配置

    您可以将大多数配置参数放入名为schemaspy.properties的文件中,将此文件放在与schemaspy-6.0.0-rc1.jar相同的目录中。

    示例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]
    

    生成文档

    配置到位后,现在您只需运行:

    java -jar schemaspy-6.0.0-rc1.jar