5

Is there a popular tool for examining the configuration and schema of a database for dubious fields, relationships and configuration, similar to how static analysis tools like lint will flag dubious lines of code?

(I'm not sure that this is technically static, since it would likely connect to a live database server).

jldugger
  • 14,122
  • 19
  • 73
  • 129
  • The tool you are looking for is called a 'DBA.' The problem is that whereas code is logic expressed in a syntactically structured way, a database schema's validity depends entirely on the application it supports. A database engine will not allow a schema to exist in an invalid state (e.g. if a primary key uis required to add a table, the the RDBMS will throw an error if you attempt to create a table without one). Compare this to code, where the code exists as-is. – JeffG Mar 02 '11 at 19:18
  • 1
    Just as lint can determine that if (x = null) is likely an error even though it compiles and type checks, I think a similar tool might detect curious situations for databases. As an example, if you have a schema containing columns ITEM1, ITEM2, ITEM3, ITEM4 etc, it seems likely there's normalization violation. – jldugger Mar 02 '11 at 19:32
  • 1
    I'll buy that. HTH http://it.toolbox.com/blogs/database-soup/testing-for-normalization-33119 – JeffG Mar 03 '11 at 15:42

3 Answers3

4

One tool I've used that offers some sanity checking is SchemaSpy. In particular, the anomalies page gives a few basic checks.

jldugger
  • 14,122
  • 19
  • 73
  • 129
4

I have been working on putting in database schema linting support into SchemaCrawler. SchemaCrawler comes with several linters for common database design issues, as well as the ability to extend them with your own checks. SchemaCrawler also automatically detects what seem like foreign-key relationships, even if a foreign-key constraint is not defined.

SchemaCrawler Lint

Sualeh Fatehi
  • 316
  • 1
  • 7
0

Six years later, and I have just discovered the wonderful Schema Crawler and love its Lint.

(of course, nowadays, we can ask questions like this on https://softwarerecs.stackexchange.com/)