Scroll to navigation

SCHEMASPY(1) General Commands Manual SCHEMASPY(1)

NAME

schemaspyTool for analyzing and graphing database schemas

SYNOPSIS

schemaspy -db dbName -o outputDir [options]

DESCRIPTION

schemaspy is a Java-based tool that analyzes the metadata of a schema in a database and generates a visual representation of it in a browser-displayable format. It lets you click through the hierarchy of database tables via child and parent table relationships as represented by both HTML links and entity-relationship diagrams. It's also designed to help resolve the obtuse errors that a database sometimes gives related to failures due to constraints.

schemaspy uses JDBC's database metadata extraction services to gather the majority of its information, but has to make vendor-specific SQL queries to gather some information such as the SQL associated with a view and the details of check constraints. The differences between vendors have been isolated to configuration files and are extremely limited. Almost all of the vendor-specific SQL is optional.

OPTIONS

Commonly Used Options

databaseType
Type of database (e.g. mysql, ora, db2, etc.). Use -dbhelp for a list of built-in types. Defaults to ora.
dbName
Name of database to connect to. This flag is required.
user
Valid database user id with read access. A user id is required unless -sso is specified.
schema
Database 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).
password
Password associated with that user. Defaults to no password.
output-dir
Directory to write the generated HTML/graphs to. This flag is required.
path-to-drivers
Looks 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.
 
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.

Less Commonly Used Options

path-to-graphviz
By default SchemaSpy expects the dot executable to be in the PATH environment variable. Use this option to explicitly specify where Graphviz is installed.
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>".
Evaluate 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 regex to narrow-down the schemas to include.
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.
metafile
metafile 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 on the website for details.
propsfile
 
key\=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 semi-colon.
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.
tableNamesRegex
Exclude matching tables/views. This regular expression excludes matching tables/views from the analysis. Can be used in conjunction with -i.
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.
columnNamesRegex
Same as -x but excluded relationships will not show up on detail pages.
Exclude all views.
Allow 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.
Don't query or display row counts.
Don't include implied foreign key relationships in the generated table details.
Single Sign-On. Don't require a user to be specified with -u to simplify configuration when running in a single sign-on environment.
Prompt For Password. Prompts for the password so it doesn't appear on the command line.
Only generate files needed for insertion/deletion of data (e.g. for scripts) and an XML representation of the schema
Specifies how verbose logging of programmatic flow should be. The levels in descending order are: severe, warning, info, config, fine, finer, finest.

SEE ALSO

SchemaSpy: Graphical Database Schema Metadata Browser, http://schemaspy.sourceforge.net/.

January 3, 2013 Linux 5.14.21-150500.55.52-default