日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 运维知识 > 数据库 >内容正文

数据库

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

發布時間:2023/11/29 数据库 24 豆豆
生活随笔 收集整理的這篇文章主要介紹了 SchemaSpy:数据库构架文档生产器,以及该软件的部分缺陷修改。提供工具包下载... 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

(一)SchemaSpy

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

該軟件名稱的官方解釋為:Graphical Database Schema Metadata Browser

我的壓縮包(SchemaSpy_5.0.0_工具包):

  • SchemaSpy_5.0.0.jar(原版)
  • SchemaSpy_5.0.0_mod.jar(我的格式修改版)
  • SchemaSpy.mht(幫助文檔)
  • jtds-1.2.5.jar(最新 強大、開源、純java的 sqlserverJDBC驅動)
  • jd-gui.exe (java class 反編譯器)
  • __SchemaSpy.cmd (我自己寫的 啟動器,加入?-charset UTF-8 參數)
  • 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?In?Comments.
    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%

    總結

    以上是生活随笔為你收集整理的SchemaSpy:数据库构架文档生产器,以及该软件的部分缺陷修改。提供工具包下载...的全部內容,希望文章能夠幫你解決所遇到的問題。

    如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。