name: joinerCheck
purpose: Check database internal consistency
example usage:
Weekly usage:
ssh hgwbeta
joinerCheck /usr/local/apache/cgi-bin/all.joiner -dbCoverage >& missingDb.log
joinerCheck /usr/local/apache/cgi-bin/all.joiner -tableCoveragen >& missingTable.log
joinerCheck /usr/local/apache/cgi-bin/all.joiner -times >& badTime.log

New database usage:
ssh hgwbeta
joinerCheck /usr/local/apache/cgi-bin/all.joiner -db=XXX -all >& allXxx.log
This will take a while to run.
parameters: joiner-file - typically all.joiner
options:

-identifier=name - Just validate given identifier.
-database=name - Just validate given database.
-fields - Check fields in joiner file exist, faster with -fieldListIn
    -fieldListOut=file - List all fields in all databases to file.
    -fieldListIn=file - Get list of fields from file rather than mysql.
-keys - Validate (foreign) keys.  Takes about an hour.
-tableCoverage - Check that all tables are mentioned in joiner file
-dbCoverage - Check that all databases are mentioned in joiner file
-times - Check update times of tables are after tables they depend on
-all - Do all tests: -fields -keys -tableCoverage -dbCoverage -times
				        
description: Review the log files. The missingDb.log may remind you of some old databases you want to remove from hgwbeta. In other cases ask the engineer making the database to add it to all.joiner. Similarly notify engineers of things that occur in the missingTable or badTime.log files.

ps - Right now joinerCheck isn't running very cleanly. The -times output in particular is something we need to take seriously.
see also: runJoiner.csh - utility shell around joinerCheck, good for individual tracks.