Visualizing a Database Structure with SchemaSpy

8,329 views
8,072 views

Published on

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
8,329
On SlideShare
0
From Embeds
0
Number of Embeds
5
Actions
Shares
0
Downloads
84
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Visualizing a Database Structure with SchemaSpy

  1. 1. Visualizing a Database Structure with SchemaSpy Albert Guo [email_address]
  2. 2. Agenda <ul><li>Introduction </li></ul><ul><li>SchemaSpy Parameters </li></ul><ul><li>SchemaSpy Support Database Type </li></ul><ul><li>Database Document Generation Process – command line </li></ul><ul><li>Database Document Generation Process – ant build script </li></ul><ul><li>My output </li></ul>
  3. 3. Introduction <ul><li>SchemaSpy can be a valuable asset in maintaining and publishing these models. </li></ul><ul><li>Like Javadoc for Java source code, SchemaSpy provides an accurate, up-to-date view of the database structure, generated automatically from the actual database. </li></ul><ul><li>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. </li></ul><ul><li>This alone is a valuable time-saver for both development and maintenance teams. </li></ul><ul><li>http://schemaspy.sourceforge.net/ </li></ul>
  4. 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. 5. 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
  6. 6. Database Document Generation Process – command line Database document Command line Retrieve database info. generate
  7. 7. Database Document Generation Process – command line <ul><li>A MySQL example: </li></ul><ul><ul><ul><li>java -jar schemaSpy.jar -t mysql -o library -host localhost -db library -u user -p password –notablecomments </li></ul></ul></ul><ul><ul><ul><li>will create a series of files in the library directory that give the details of the schema in the database library. </li></ul></ul></ul><ul><li>An MS SQL Server example: </li></ul><ul><ul><ul><li>java -jar schemaSpy.jar -t mssql -db library -host localhost -port 1433 -u user -p password -o library </li></ul></ul></ul><ul><ul><ul><li>does the same thing as the MySQL example, but specifies an mssql database type with MS SQL Server-specific database connection parameters. </li></ul></ul></ul>
  8. 8. Database Document Generation Process – ant build script Database document Retrieve database info. generate
  9. 9. Database Document Generation Process – ant build script Assign parameter values
  10. 10. Database Document Generation Process – ant build script Integrate command line into ant build script
  11. 11. Database Document Generation Process – ant build script Just type in ant to generate database schema document
  12. 12. My output
  13. 13. My output – cont.
  14. 14. My output – cont.

×