SchemaSpy:数据库构架文档生产器,以及该软件的部分缺陷修改。提供工具包下载...

(一)SchemaSpy

官方网站:http://schemaspy.sourceforge.net/

该软件名称的官方解释为:Graphical Database Schema Metadata Browser

我的压缩包(SchemaSpy_5.0.0_工具包):

  1. SchemaSpy_5.0.0.jar(原版)
  2. SchemaSpy_5.0.0_mod.jar(我的格式修改版)
  3. SchemaSpy.mht(帮助文档)
  4. jtds-1.2.5.jar(最新 强大、开源、纯java的 sqlserverJDBC驱动)
  5. jd-gui.exe (java class 反编译器)
  6. __SchemaSpy.cmd (我自己写的 启动器,加入 -charset UTF-8 参数)
  7. Dot.java(修改版的)

 

 

(二)常见问题及解决(不断补充中)

1、中文支持问题  

  该软件有个隐藏参数:-charset UTF-8

  命令选项中加入该参数即可解决文档的乱码问题,但不能解决 Graphviz 图表的中文问题

2、 软件所依赖的Graphviz版本问题

  该软件运行必须依赖于Graphviz,主要是依赖其中的Dot命令。

  官方的要求是 Graphviz 2.2.1 或 2.4+,否则会出现Dot命令生成图表失败的问题。原因是SchemaSpy自作聪明的判断引擎对默认PNG质量的格式控制,使得内部调用Dot参数 -Tpng命令后添加了质量修饰符":gd"等参数,从而和Graphviz的支持格式不一致。

  修改:最简单的方式是:修改 net.sourceforge.schemaspy.util 下Dot.class 文件。修改反编译后的源文件的 generateDiagram 方法的调用参数:5.0的版本为:

    String[] arrayOfString = { getExe(), "-T" + getFormat() + getRenderer(), paramFile1.toString(), "-o" + paramFile2, "-Tcmapx" };

修改为

/* 254 */     String[] arrayOfString = { getExe(), "-Tjpeg", paramFile1.toString(), "-o" + paramFile2, "-Tcmapx" };

注意:该处我根本就不用png格式,而是jpeg格式!!!!

3、和“2”相关的问题,因为该软件的最新版本5.0看起来也已经很老了,所有很多的代码和配置不一定适合最新的jdk、db系统,所以,你知道的.......慢慢改呗!

 

(三)支持的数据库类型

TypeDescription
db2IBM DB2 with 'app' Driver
db2netIBM DB2 with 'net' Driver
udbt4DB2 UDB Type 4 Driver
db2zosDB2 for z/OS
derbyDerby (JavaDB) Embedded Server
derbynetDerby (JavaDB) Network Server
firebirdFirebird
hsqldbHSQLDB Server
informixInformix
maxdbMaxDB
mssqlMicrosoft SQL Server
mssql05Microsoft SQL Server 2005
mssql-jtdsMicrosoft SQL Server with jTDS Driver
mssql05-jtdsMicrosoft SQL Server 2005 with jTDS Driver
mysqlMySQL
oraOracle with OCI8 Driver
orathinOracle with Thin Driver
pgsqlPostgreSQL
sqliteSQLite
sybaseSybase Server with JDBC3 Driver
sybase2Sybase Server with JDBC2 Driver
teradataTeradata (requires -connprops)

 

基本使用语法

Commonly used parameters:

 ParameterDescription
 -t databaseTypeType of database (e.g. ora, db2, etc.). Use -dbhelp for a list of built-in types. Defaults to ora.
*-db dbNameName of database to connect to
*-u userValid database user id with read access. A user id is required unless -sso is specified.
 -s schemaDatabase schema. This is optional if it's the same as user or isn't supported by your database.
Use -noschema if your database thinks it supports schemas but doesn't (e.g. older versions of Informix).
 -p passwordPassword associated with that user. Defaults to no password.
*-ooutputDirectoryDirectory to write the generated HTML/graphs to
 -dppathToDriversLooks for drivers here before looking in driverPath in [databaseType].properties. The drivers are usually contained in .jar or .zip files and are typically provided by your database vendor.
 -hq
-lq
Generate either higher or lower-quality diagrams. Various installations of Graphviz (depending on OS and/or version) will default to generating either higher or lower quality images. That is, some might not have the "lower quality" libraries and others might not have the "higher quality" libraries.
Higher quality output takes longer to generate and results in significantly larger image files (which take longer to download / display), but the resultant Entity Relationship diagrams generally look better.

Parameters marked with '*' are required.

Less commonly used parameters:

 

-gv pathToGraphvizBy default SchemaSpy expects the dot executable to be in the PATH environment variable. Use this option to explicitly specify where Graphviz is installed.
-desc "Schema description"Displays the specified textual description on summary pages. If your description includes an equals sign then escape it with a backslash.
For example:
-desc "<a href\='http://schemaspy.sourceforge.net'>SchemaSpy</a>".
-allEvaluate all schemas in a database. Generates a high-level index of the schemas evaluated and allows for traversal of cross-schema foreign key relationships.
Use with -schemaSpec "schemaRegularExpression" to narrow-down the schemas to include.
-schemas"schema1,schema2"Evaluate specified schemas. Similar to -all, but explicitly specifies which schema to evaluate without interrogating the database's metadata. Can be used with databases like MySQL where a database isn't composed of multiple schemas.
-meta metafilemetafile is either the name of an individual XML file or the directory that contains meta files. If a directory is specified then it is expected to contain files matching the pattern [schema].meta.xml.
For databases that don't have schema substitute database for schema.
See Providing Additional Metadata for details.
-connpropspropsfile orkey\=value;Specifies additional properties to be used when connecting to the database. Either specify a .properties file (with key=value entries) or specify the entries directly, escaping the ='s with \= and separating each key\=value pair with a ;.
-i"tableNamesRegex"Only include matching tables/views. This is a regular expression that's used to determine which tables/views to include. 
For example: -i "(.*book.*)|(library.*)" includes only those tables/views with 'book' in their names or that start with 'library'.
You might want to use -desc with this option to describe the subset of tables.
-I"tableNamesRegex"Exclude matching tables/views. This regular expression excludes matching tables/views from the analysis. Can be used in conjunction with -i.
-x"columnNamesRegex"Exclude matching columns from relationship analysis to simplify the generated graphs. This is a regular expression that's used to determine which columns to exclude. It must match table name, followed by a dot, followed by column name.
For example: -x "(book.isbn)|(borrower.address)"
Note that each column name regular expression must be surround by ()'s and separated from other column names by a |
Excluded relationships will still show up on detail pages.
-X"columnNamesRegex"Same as -x but excluded relationships will not show up on detail pages.
-noviewsExclude all views.
-ahicAllow HTML IComments.
Any HTML embedded in comments normally gets encoded so that it's rendered as text. This option allows it to be rendered as HTML.
-norowsDon't query or display row counts.
-noimpliedDon't include implied foreign key relationships in the generated table details.
-ssoSingle Sign-On. Don't require a user to be specified with -u to simplify configuration when running in a single sign-on environment.
-pfpPrompt For Password. Prompts for the password so it doesn't appear on the command line.
-nohtmlOnly generate files needed for insertion/deletion of data (e.g. for scripts) and an XML representation of the schema.
-loglevelSpecifies how verbose logging of programmatic flow should be.
The levels in descending order are:
  • severe (highest - least detail)
  • warning (default)
  • info
  • config
  • fine
  • finer
  • finest (lowest - most detail)

 

(四)示例

You run SchemaSpy from the command line:

    java -jar schemaSpy.jar -t dbType -db dbName [-s schema] -u user [-p password] -o outputDir

A MySQL example:

  java -jar schemaSpy.jar -t mysql -o library -host localhost -db library -u user -p password

 

An MS SQL Server example:

  java -jar schemaSpy.jar -t mssql -db library -host localhost -port 1433 -u user -p password -o library

 我的使用jtds驱动的 MS Sqlserver 实例

java -jar schemaSpy_5.0.0_mod.jar -charset UTF-8 -t mssql05-jtds -dp .\jtds-1.2.5.jar -db %db% -host localhost -port 1433 -u sa -p sa  -s dbo  -o %db% 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mzph.cn/news/403948.shtml

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

container_of分析

1.container_of宏 1> Container_of在Linux内核中是一个常用的宏&#xff0c;用于从包含在某个结构中的指针获得结构本身的指针&#xff0c;通俗地讲就是通过结构体变量中某个成员的首地址进而获得整个结构体变量的首地址。2>接口&#xff1a;container_of(ptr, type, mem…

ZOJ 1450 Minimal Circle 点集的最小圆覆盖

From: http://blog.csdn.net/zmx354/article/details/17076267 给定一个点集&#xff0c;求出能覆盖点集内所有点的半径最小的圆。包含点在圆上的情况。个人感觉算是比较麻烦的计算几何模板了。 在网上看了很多解题&#xff0c;大多数都摘抄自《求一个包含点集所有点的最小圆…

poj1050最大子矩阵和

这篇是看了别人的报告写的&#xff0c;就当是屡屡思路好了. 题目大意。给定一个n阶矩阵&#xff08;方阵&#xff09;,每一个元素中存在一个数字.任务就是求出一个最大的子矩阵使得矩阵元素之间的和是最大的. n100; 1.矩阵A[m][n]的和能够直接 sumA[i][j] ( i 0 to n-1 j0 to …

vue里写三元判断绑定class和style

<a-select:disabled"(dataBaseId ? false : true)"style"width: 100%"showSearchplaceholder"请输入选择表名"v-decorator"[tableId,{rules: [{ required: false, message: 请输入选择表名}]}]":defaultActiveFirstOption"fa…

命令行选项解析函数(C语言):getopt()和getopt_long()

上午在看源码项目 webbench 时&#xff0c;刚开始就被一个似乎挺陌生函数 getopt_long() 给卡住了&#xff0c;说实话这函数没怎么见过&#xff0c;自然不知道这哥们是干什么的。于是乎百度了一番&#xff0c;原来是处理命令行选项参数的&#xff0c;的确&#xff0c;正规点的大…

centos5.3搭建安全高效的LNMP服务器

操作系统基于centos 5.3 #!/bin/bash # BY kerryhu # QQ:263205768 # MAIL:king_819163.com # BLOG:http://kerry.blog.51cto.com # Please manual operation yum of before Operation..... # yum install ntp vim-enhanced gcc gcc-c flex bison autoconf \ # automake …

夺命雷公狗ThinkPHP项目之----企业网站2之数据库的快速设计

我们在一个项目的时候&#xff0c;花费最多事件的估计还是数据库的时间了&#xff0c;我们的数据库暂时就这样设计好了&#xff1a; 暂时我们的数据库就这样设计好了用下先,建好后如下所示&#xff1a; 转载于:https://www.cnblogs.com/leigood/p/5411017.html

vue监听对象某一个属性

watch: {uploadObj: {//监听对象deep: true,handler: function(value) {if (!value.receiver && !value.receiveBastionIds) {this.userArrShow true;this.machineSelectShow true;this.$message.warning("接收人及接收堡垒机至少选择一项&#xff0c;请重新填写…

find 命令搜索符号链接文件夹的方法

From: http://blog.csdn.net/caspiansea/article/details/7456048 find 命令默认情况下&#xff0c;不会到符号链接指向的文件夹下面搜索匹配的文件。 要想达到此目的&#xff0c;可以使用如下的方法&#xff1a; [plain] view plaincopyprint?find -L dirname -name "…

typedef和define具体的详细区别

1) #define是预处理指令&#xff0c;在编译预处理时进行简单的替换&#xff0c;不作正确性检查&#xff0c;不关含义是否正确照样带入&#xff0c;只有在编译已被展开的源程序时才会发现可能的错误并报错。例如&#xff1a; #define PI 3.1415926 程序中的&#xff1a;areaPI*r…

字符串替换方法的优劣

需求&#xff1a;String str "中aacabbbaac中sabbcccdddddeee"; String[] findStr {"aa","b","c","d","e","f","g"} ; String[] repStr {"A","B","C",…

Fedora 19 Mate环境安装Gnome3

From: http://blog.csdn.net/skykingf/article/details/9230297 等了N久的Fedora19终于出来了&#xff0c;安装时选了Mate桌面&#xff0c;装完后发现真是回到了Gnome2的年代&#xff0c;同样是Mate&#xff0c;Fedora就不能向Mint15里的Mate学学&#xff1f;起码也让用户感觉…

6月份美国域名总量新增近5.4万个 环比减少51%

中国IDC评述网07月03日报道&#xff1a;据域名统计机构WebHosting.info公布的数据显示&#xff0c;截至2012年6月25日&#xff0c;美国域名总量达到了79,632,920个&#xff0c;域名增幅较小。下面&#xff0c;IDC评述网与大家一起关注6月份美国域名注册量最新情况。 &#xff0…

vue+element-ui大文件的分片上传和断点续传js-spark-md5和browser-md5-file

注意&#xff1a;以下共两份代码片段&#xff0c;第一份为原博主链接代码&#xff0c;第二份自己写的整体代码&#xff08;比较乱&#xff09; 1.参考 https://www.cnblogs.com/kelelipeng/p/10158599.html &#xff08;js-spark-md5和browser-md5-file&#xff09; 和 https:…

Fedora 20 安装试用体验全程讲解

From: http://www.jb51.net/os/Fedora/177583.html Fedora 20在两次跳票后正式发布&#xff0c;主要特性包括&#xff1a;远程桌面方案X2Go&#xff1b;网络管理器支持扩大绑定和桥接功能&#xff1b;改进3D打印机支持等&#xff0c;本文中&#xff0c;作者对Fedora 20 进行安装…

NUC972配置为支持NFS

为了使用NFS进行调试。需要安装NFS server,具体的流程在上一篇博文中有较为详细的介绍。在配置内核时需要做如下的操作&#xff1a; 对于Boot option中的处理&#xff0c;可以不用写在env.txt配置也是可以的。 baudrate115200 bootargsnoinitrd consolettyS0,115200 r…

华为的冬天(来自网路)---任正非

公司所有员工是否考虑过&#xff0c;如果有一天&#xff0c;公司销售额下滑、利润下滑甚至会破产&#xff0c;我们怎么办&#xff1f;我们公司的太平时间太长了&#xff0c;在和平时期升的官太多了&#xff0c;这也许就是我们的灾难。泰坦尼克号也是在一片欢呼声中出的海。而且…

js call

call 方法 请参阅 应用于&#xff1a;Function 对象 要求 版本 5.5 调用一个对象的一个方法&#xff0c;以另一个对象替换当前对象。 call([thisObj[,arg1[, arg2[, [,.argN]]]]]) 参数 thisObj 可选项。将被用作当前对象的对象。 arg1, arg2, , argN 可选项。将被传…

【Fedora20】 samba配置

From: http://blog.163.com/shi_shun/blog/static/23707849201452641312640/ 1、安装前的准备 关闭防火墙 //不关的后果是windows看不到本机 systemctl stop firewalld //暂时关闭防火墙 systemctl disable firewalld //开机禁止启动 关闭selinux //不关…