Visualizing a Database Structure with SchemaSpy Albert Guo [email_address]
Agenda Introduction SchemaSpy Parameters SchemaSpy Support Database Type Database Document Generation Process – command line Database Document Generation Process – ant build script My output
Introduction SchemaSpy can be a valuable asset in maintaining and publishing these models.  Like Javadoc for Java source code, SchemaSpy provides an accurate, up-to-date view of the database structure, generated automatically from the actual database.  As an automated tool, SchemaSpy incurs very little cost to set up and virtually no cost to maintain—the diagrams are automatically updated as the database schema evolves.  This alone is a valuable time-saver for both development and maintenance teams. http://schemaspy.sourceforge.net/
SchemaSpy Parameters * denotes required parameter. Please go to here,  http://schemaspy.sourceforge.net/ , to get full parameter list.  Parameter Description -t databaseType Type of database (e.g. ora, db2, etc.). Use -dbhelp for a list of built-in types. Defaults to ora.  * -db dbName Name of database to connect to * -u user Valid database user id with read access -s schema Database schema (optional if the same as user or isn't supported by your database) -p password Password associated with that user. Defaults to no password. * -o outputDirectory Directory to write the generated HTML/graphs to
SchemaSpy Support Database Type Type Description db2 IBM DB2 with the 'App' Driver db2net IBM DB2 with the 'Net' Driver firebird Firebird hsqldb HSQLDB Server mssql Microsoft SQL Server mysql MySQL ora Oracle with OCI8 Driver orathin Oracle with Thin Driver pgsql PostgreSQL sybase Sybase Server with JDBC3 Driver sybase2 Sybase Server with JDBC2 Driver udbt4 DB2 UDB Type 4 Driver
Database Document Generation Process – command line Database document Command line Retrieve database info. generate
Database Document Generation Process – command line A MySQL example: java -jar schemaSpy.jar -t mysql -o library -host localhost -db library -u user -p password –notablecomments will create a series of files in the library directory that give the details of the schema in the database library. An MS SQL Server example: java -jar schemaSpy.jar -t mssql -db library -host localhost -port 1433 -u user -p password -o library does the same thing as the MySQL example, but specifies an mssql database type with MS SQL Server-specific database connection parameters.
Database Document Generation Process – ant build script Database document Retrieve database info. generate
Database Document Generation Process – ant build script Assign parameter values
Database Document Generation Process – ant build script Integrate command line into ant build script
Database Document Generation Process – ant build script Just type in ant to generate database schema document
My output
My output – cont.
My output – cont.

Visualizing a Database Structure with SchemaSpy

  • 1.
    Visualizing a DatabaseStructure with SchemaSpy Albert Guo [email_address]
  • 2.
    Agenda Introduction SchemaSpyParameters SchemaSpy Support Database Type Database Document Generation Process – command line Database Document Generation Process – ant build script My output
  • 3.
    Introduction SchemaSpy canbe a valuable asset in maintaining and publishing these models. Like Javadoc for Java source code, SchemaSpy provides an accurate, up-to-date view of the database structure, generated automatically from the actual database. As an automated tool, SchemaSpy incurs very little cost to set up and virtually no cost to maintain—the diagrams are automatically updated as the database schema evolves. This alone is a valuable time-saver for both development and maintenance teams. http://schemaspy.sourceforge.net/
  • 4.
    SchemaSpy Parameters *denotes required parameter. Please go to here, http://schemaspy.sourceforge.net/ , to get full parameter list. Parameter Description -t databaseType Type of database (e.g. ora, db2, etc.). Use -dbhelp for a list of built-in types. Defaults to ora. * -db dbName Name of database to connect to * -u user Valid database user id with read access -s schema Database schema (optional if the same as user or isn't supported by your database) -p password Password associated with that user. Defaults to no password. * -o outputDirectory Directory to write the generated HTML/graphs to
  • 5.
    SchemaSpy Support DatabaseType Type Description db2 IBM DB2 with the 'App' Driver db2net IBM DB2 with the 'Net' Driver firebird Firebird hsqldb HSQLDB Server mssql Microsoft SQL Server mysql MySQL ora Oracle with OCI8 Driver orathin Oracle with Thin Driver pgsql PostgreSQL sybase Sybase Server with JDBC3 Driver sybase2 Sybase Server with JDBC2 Driver udbt4 DB2 UDB Type 4 Driver
  • 6.
    Database Document GenerationProcess – command line Database document Command line Retrieve database info. generate
  • 7.
    Database Document GenerationProcess – command line A MySQL example: java -jar schemaSpy.jar -t mysql -o library -host localhost -db library -u user -p password –notablecomments will create a series of files in the library directory that give the details of the schema in the database library. An MS SQL Server example: java -jar schemaSpy.jar -t mssql -db library -host localhost -port 1433 -u user -p password -o library does the same thing as the MySQL example, but specifies an mssql database type with MS SQL Server-specific database connection parameters.
  • 8.
    Database Document GenerationProcess – ant build script Database document Retrieve database info. generate
  • 9.
    Database Document GenerationProcess – ant build script Assign parameter values
  • 10.
    Database Document GenerationProcess – ant build script Integrate command line into ant build script
  • 11.
    Database Document GenerationProcess – ant build script Just type in ant to generate database schema document
  • 12.
  • 13.
  • 14.