Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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).

share|improve this question
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 2 '11 at 19:18
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 2 '11 at 19:32
I'll buy that. HTH… – JeffG Mar 3 '11 at 15:42

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

share|improve this answer

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.