Scripts to automate maintenance on thousands of databases?

view full story

http://serverfault.com – We have a web application that, for government-regulated security reasons, requires each client to have their own database. As a result, we have a few thousand small databases that all have the exact same schema (each database is between 10MB and 50MB right now, but will never be larger than ~400MB) We have a program that automatically scans through each database and upgrades the schema as there are changes to our master copy, which is working great. However, we do not have any scripted maintenance being run other than nightly backups. Any suggestions on what else we should be running? (HowTos)