I started working on a project that uses an Oracle database and wanted to get an overview of the tables and their relationships. I decided to see if any tools were out there that could create some documentation based on the schema. Ideally, one that could also create some sort of ERD like diagram. I found just what I was looking for in SchemaSpy.
SchemaSpy is an open source tool written in Java that will create HTML documentation for your tables. It will highlight keys, indexes, constraints, etc. It will also look for Anomalies like: “Tables with incrementing column names, potentially indicating denormalization”. The tool reads the schema’s meta data using the appropriate JDBC driver.
Going beyond that, SchemaSpy uses GraphViz to generate a diagrams from the schema. Below is a screen shot. A larger version can be found here.
SchemaSpy is a command line tool. If you prefer to use a GUI, check out SchemaSpyGUI.
I have not experimented with the various options and customizing the output using meta data described in an XML file. This would be useful to add comments to the documentation or identify columns as foreign keys where that information is not captured in the schema’s meta data.
With the default options, the tool gave me exactly what I was looking for.
